public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Kernel upgrade and now LUKS failure.
@ 2010-05-03 16:56 Jason Dusek
  2010-05-03 17:31 ` Florian Philipp
  2010-05-04 10:06 ` Stefan G. Weichinger
  0 siblings, 2 replies; 39+ messages in thread
From: Jason Dusek @ 2010-05-03 16:56 UTC (permalink / raw
  To: gentoo-user

  I have an encrypted block device, `/dev/sda2', which is
  mounted as my root filesystem. I recently installed this
  system -- I've been away from Gentoo for awhile -- and used
  gentoo sources 2.6.31-r6. When the kernel upgrade rolled
  around, to 2.6.32-r7, I installed and rebooted and then my
  passphrase didn't work anymore. The error message:

    Command failed: No key available with this passphrase.

  However, rebooting with my old kernel works fine so I'm not
  sure what the problem is. Could it be a different version of
  `cryptsetup'? When the device can't be opened on boot, I have
  the option to drop to a shell. I try to run `cryptsetup' and I
  get the same error -- so maybe that's my problem? Would
  different versions of `cryptsetup' be incompatible with
  devices encrypted by older versions? That seems brittle and
  dangerous to me.

--
Jason Dusek



^ permalink raw reply	[flat|nested] 39+ messages in thread
* [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; 39+ 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] 39+ messages in thread

end of thread, other threads:[~2010-05-21 15:24 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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