public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Re: Kernel upgrade and now LUKS failure
@ 2010-05-16 12:36 Jan Engelhardt
  2010-05-17  9:14 ` Stefan G. Weichinger
  0 siblings, 1 reply; 22+ messages in thread
From: Jan Engelhardt @ 2010-05-16 12:36 UTC (permalink / raw
  To: gentoo-user
  Cc: Daniel Troeder, Stefan G. Weichinger, walt, Florian Philipp,
	Jason Dusek, Till Maas

[Replying to 
http://thread.gmane.org/gmane.linux.gentoo.user/229533/focus=229542 ]

On 2010-05-05 08:00:43 GMT, Daniel Troeder wrote:
>On 05/05/2010 06:42 AM, Stefan G. Weichinger wrote:
>> Am 04.05.2010 23:24, schrieb Daniel Troeder:
>> 
>>> I'm using sys-fs/cryptsetup-1.1.1_rc1 since 02.05.2010 and didn't have
>>> any issues.
>>> Please decrypt your partition from the command line, so we can see if it
>>> is a cryptsetup/luks/kernel problem or a pam_mount problem.
>>>
>>> Cmdline should something like:
>>> $ sudo cryptsetup -d /etc/security/verysekrit.key luksOpen
>>> /dev/mapper/VG01-crypthome myhome
>>> Which should create /dev/mapper/myhome.
>> 
>> My user sgw is currently not allowed to sudo this (should it be? it
>> never was).
>> 
>> And for root it says "Kein Schlüssel mit diesem Passsatz verfügbar."
>> (german) which should be "No key available with this passphrase." in
>> english.
>That is a message from cryptsetup. As you are using openssl to get the
>key, I think the problem might be there.
>
>I followed the guide you linked here (website is down, but google-cache
>works:
>http://webcache.googleusercontent.com/search?q=cache:7eaSac72CoIJ:home.coming.dk/index.php/2009/05/20/encrypted_home_partition_using_luks_pam_+encrypted_home_partition_using_luks_pam&cd=2&hl=de&ct=clnk&gl=de&client=firefox-a)
>and it works for me (kernel is 2.6.33-zen2):
>
>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

In my personal opinion, both the quality of shell commands and key
generation is suboptimal. What makes it bad is that people follow it.

First, it generates a key which does not exploit the entire space. 
People claim it's because they want an ASCII readout, but frankly, you 
get the same with `hexdump -C`.

Second, it's using echo without the -n parameter, thus implicitly 
inserting a newline into the key -- which is the cause for yoru observed 
mounting problems.

Third, because you are passing the key via stdin into cryptsetup, it 
only uses the first line of whatever you pipe into it; whereas pam_mount 
uses the entire keyfile as it is supposed to be.

(Fourth, the howto suggests ECB, which, well, looks rather weak 
considering the ECB's Tux picture on Wikipedia.)

All of that should be in doc/bugs.txt, and mount.crypt even warns about 
ECB. You really cannot ignore seeing that.

Phew!



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-05-25 18:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-16 12:36 [gentoo-user] Re: Kernel upgrade and now LUKS failure 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-23 20:37                               ` [gentoo-user] SOLVED: " Stefan G. Weichinger
2010-05-23 21:57                                 ` Mick
2010-05-25 18:44                                   ` Stefan G. Weichinger
2010-05-18 19:38               ` [gentoo-user] " Eray Aslan
2010-05-21 20:24             ` Daniel Troeder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox