From: Daniel Troeder <daniel@admin-box.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: Kernel upgrade and now LUKS failure.
Date: Wed, 05 May 2010 21:39:21 +0200 [thread overview]
Message-ID: <4BE1C969.1010009@admin-box.com> (raw)
In-Reply-To: <4BE12F73.2080708@xunil.at>
[-- Attachment #1: Type: text/plain, Size: 2768 bytes --]
On 05/05/2010 10:42 AM, Stefan G. Weichinger wrote:
> Am 05.05.2010 10:00, schrieb Daniel Troeder:
>
>> That is a message from cryptsetup. As you are using openssl to get
>> the key, I think the problem might be there.
>
> ok ....
>
>> lvcreate -n crypttest -L 100M vg0 KEY=`tr -cd [:graph:] <
>> /dev/urandom | head -c 79` echo $KEY | openssl aes-256-ecb >
>> verysekrit.key openssl aes-256-ecb -d -in verysekrit.key # (aha :)
>> openssl aes-256-ecb -d -in verysekrit.key | cryptsetup -v --cipher
>> aes-cbc-plain --key-size 256 luksFormat /dev/vg0/crypttest
>> openssl aes-256-ecb -d -in verysekrit.key | cryptsetup luksOpen
>> /dev/vg0/crypttest decryptedtest cryptsetup luksClose crypttest #
>> (i couldn't close it... don't know why...)
>>
>> The key that cryptsetup is given to decrypt the partition is
>> created by openssl from the file. Please check the output of $
>> openssl aes-256-ecb -d -in verysekrit.key under both kernel - it
>> should be identical.
>
> At first, thank you for your time and work!
>
> Tried that. I have to admit that I don't know the decryption
> password ... but as far as I understand it should be the same as the
> unix-password of the user sgw. pam_mount.so should read it when I
> log in, correct?
Yes. Than pam_mount man page (http://linux.die.net/man/8/pam_mount) says so.
It's actually quite verbose on the topic.
> With this password I get a "bad decrypt" so this explains why it
> fails.
If you cannot decrypt your keyfile (with openssl) then you have just
lost any way to decrypt your partition!
But there is an idea in the man page of which I didn't think: did you
maybe change your users password? If so, you need to use the old pw to
decrypt the keyfile. If you can, then you can use the new pw to encrypt
the key again (make backups of the original file).
There is also the possibility your keyfile was corrupted somehow (file
system corruption?). Do you have a backup of the keyfile (and your data:)?
BTW: a LUKS encrypted partition can have 8 keys (in so called "key
slots"), so that you can add a "fallback key" the next time, which you
store at a trusted place.
Good luck,
Daniel
> Please let me repeat/point out that it is the same for 3 kernels
> (2.6.32-r1, 2.6.33-r[12] ... ), so I should change the subject to
> stay correct ...
>
>> BTW: You'll get your error message if you run: $ echo notmykey |
>> cryptsetup luksOpen /dev/vg0/crypttest decryptedtes
>
> Yes, correct.
>
> -
>
> I really wonder what the reason is ... should I downgrade openssl?
>
> Thanks Stefan
>
--
PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get
# gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
next prev parent reply other threads:[~2010-05-05 19:40 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-03 16:56 [gentoo-user] Kernel upgrade and now LUKS failure Jason Dusek
2010-05-03 17:31 ` Florian Philipp
2010-05-04 10:06 ` Stefan G. Weichinger
2010-05-04 16:54 ` [gentoo-user] " walt
2010-05-04 17:38 ` Stefan G. Weichinger
2010-05-04 19:28 ` Stefan G. Weichinger
2010-05-04 21:24 ` Daniel Troeder
2010-05-05 4:42 ` Stefan G. Weichinger
2010-05-05 8:00 ` Daniel Troeder
2010-05-05 8:42 ` Stefan G. Weichinger
2010-05-05 19:39 ` Daniel Troeder [this message]
2010-05-05 20:17 ` Stefan G. Weichinger
2010-05-05 20:23 ` Stefan G. Weichinger
2010-05-06 16:24 ` Daniel Troeder
2010-05-06 18:38 ` Stefan G. Weichinger
2010-05-07 8:53 ` Stefan G. Weichinger
2010-05-07 14:24 ` Stefan G. Weichinger
2010-05-07 21:14 ` Stefan G. Weichinger
2010-05-10 16:48 ` Daniel Troeder
2010-05-04 23:51 ` walt
-- strict thread matches above, loose matches on Subject: below --
2010-05-16 12:36 Jan Engelhardt
2010-05-17 9:14 ` Stefan G. Weichinger
2010-05-17 21:01 ` Daniel Troeder
2010-05-18 13:05 ` Jan Engelhardt
2010-05-18 13:44 ` Stefan G. Weichinger
2010-05-18 16:04 ` Jan Engelhardt
2010-05-18 16:56 ` Stefan G. Weichinger
2010-05-18 17:57 ` Jan Engelhardt
2010-05-18 18:57 ` Stefan G. Weichinger
2010-05-18 19:33 ` Stefan G. Weichinger
2010-05-18 20:06 ` Jan Engelhardt
2010-05-18 20:17 ` Stefan G. Weichinger
2010-05-18 21:16 ` Jan Engelhardt
2010-05-18 21:49 ` Stefan G. Weichinger
2010-05-18 22:23 ` Jan Engelhardt
2010-05-20 10:25 ` Stefan G. Weichinger
2010-05-20 13:40 ` Stefan G. Weichinger
2010-05-18 19:38 ` Eray Aslan
2010-05-21 20:24 ` Daniel Troeder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE1C969.1010009@admin-box.com \
--to=daniel@admin-box.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox