You are not logged in.

#1 2014-01-15 08:19:59

bk
Member
Registered: 2014-01-15
Posts: 7

LUKS-Passphrase not working after update

Hi,

after a long time I updated one of my laptop yesterday (last update was on 2013-12-29).
After a pacman -Syu my problem is that cryptsetup seems not to accept my correct password for my encrypted /.

The order of hooks in mkinitcpio.conf is the same as before the update.

For debugging I modified my initramfs by adding launch_interactive_shell one line before the call of cryptsetup into the encrypt-hook-file. Keyboardlayout was correct, dm_crypt and dm_mod loaded.
Using strace in initramfs I've seen that my entered passphrase was the correct one, but cryptsetup says that my correct one isn't the correct one (No key available with this passphrase) sad

Using a livecd my passphrase works (same keyboardlayout / identical phrase) ...

Here the pacman.log of my last update

Any idea?

EDIT:

Even after adding a new passphrase to a different keyslot cryptsetup will not accept this new one...

Last edited by bk (2014-01-15 09:45:17)

Offline

#2 2014-01-15 21:37:56

poplin
Member
Registered: 2014-01-15
Posts: 3

Re: LUKS-Passphrase not working after update

Hi bk,

Same problem here.  Downgrading to cryptsetup-1.6.3-1-x86_64.pkg.tar.xz libgcrypt-1.5.3-1-x86_64.pkg.tar.xz allowed me to decrypt.

Once downgraded, after reboot I was not able to mount any crypt partition (the system hangs or maybe take ages, as reported by Fruckiwacki ).

So my workaround so far involves manually mounting the partitions... :-(

Offline

#3 2014-01-15 22:07:19

bk
Member
Registered: 2014-01-15
Posts: 7

Re: LUKS-Passphrase not working after update

poplin wrote:

Downgrading to cryptsetup-1.6.3-1-x86_64.pkg.tar.xz libgcrypt-1.5.3-1-x86_64.pkg.tar.xz allowed me to decrypt.

Tested it, too. Here my result:
libgcrypt-1.6.0-1 + cryptsetup-1.6.3-2 = no decrypt
libgcrypt-1.5.3    + cryptsetup-1.6.2-2 = decrypt (without mount)

So what would be the next step to get this fixed?

Offline

#4 2014-01-15 22:48:56

jynnantonix
Member
Registered: 2012-09-07
Posts: 33

Re: LUKS-Passphrase not working after update

I'm having the exact same issue, although I use a keyfile on a usb stick.  I can confirm that downgrading to libgcrypt-1.5.3 + cryptsetup1.6.3-1 allows me to decrypt my rootfs but libgcrypt-1.6.0 + cryptsetup1.6.3-2 gives me a "No keyslot matches this passphrase" message followed by an "Invalid keyfile" error.

Offline

#5 2014-01-15 23:32:06

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: LUKS-Passphrase not working after update

Did you try either with cryptsetup using its own pbkdf2 implementation, or with the patch for libgcrypt (both mentioned here), to see if it changes anything?

Offline

#6 2014-01-16 00:44:17

jynnantonix
Member
Registered: 2012-09-07
Posts: 33

Re: LUKS-Passphrase not working after update

I built cryptsetup with the configure patch from here after fixing the yes -> xyes typo.  If I understand correctly this defaults to using the internal pbkdf2 implementation so the only change I made to the PKGBUILD from [core] was to apply the patch in a prepare function.  After building and installing the new cryptsetup, I rebuilt the initramfs before rebooting.  Unfortunately, this didn't seem to make a difference as I got the same error about the invalid keyfile.

Offline

#7 2014-01-16 08:38:58

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: LUKS-Passphrase not working after update

Actually you also need to add --disable-gcrypt-pbkdf2 to the configure line in the PKGBUILD, otherwise (with libgcrypt 1.6.0) it defaults to using libgcrypt's implementation. The patch allows the --disable-gcrypt-pbkdf2 option to work (without it you can only force to enable it, not disable it)

Offline

#8 2014-01-16 10:37:08

plasmoid
Member
Registered: 2012-04-15
Posts: 7

Re: LUKS-Passphrase not working after update

jjacky wrote:

Actually you also need to add --disable-gcrypt-pbkdf2 to the configure line in the PKGBUILD, otherwise (with libgcrypt 1.6.0) it defaults to using libgcrypt's implementation. The patch allows the --disable-gcrypt-pbkdf2 option to work (without it you can only force to enable it, not disable it)

bk/jynnantonix can you confirm that the patch and --disable-gcrypt-pbkdf2 fixes the problem?

Offline

#9 2014-01-16 18:46:14

jynnantonix
Member
Registered: 2012-09-07
Posts: 33

Re: LUKS-Passphrase not working after update

plasmoid wrote:

bk/jynnantonix can you confirm that the patch and --disable-gcrypt-pbkdf2 fixes the problem?

I rebuilt it with --disable-gcrypt-pbkdf2 but sadly I still get the "No key available for this passphrase" error.  I think this is a problem with libgcrypt rather than cryptsetup:

- libgcrypt-1.5.3 + cryptsetup-1.6.3-1 works
- libgcrypt-1.6.0 + cryptsetup-1.6.3-2 does not work
- Since cryptsetup only got a package version bump I would hope that the source code itself did not change.  It was only repackaged because libgcrypt got a major version bump

What else can I try to troubleshoot this problem?  I'm not very familiar with cryptsetup or libgcrypt so I'm not really sure where to start

Offline

#10 2014-01-16 18:55:56

bk
Member
Registered: 2014-01-15
Posts: 7

Re: LUKS-Passphrase not working after update

jynnantonix wrote:
plasmoid wrote:

bk/jynnantonix can you confirm that the patch and --disable-gcrypt-pbkdf2 fixes the problem?

I rebuilt it with --disable-gcrypt-pbkdf2 but sadly I still get the "No key available for this passphrase" error.

Have done the same right before jynnantonix was posting: Can confirm, still broken.

Offline

#11 2014-01-16 19:10:44

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: LUKS-Passphrase not working after update

I recently re-built my system (on Tuesday, not because of LVM on LUKS) and I have that:

cryptsetup-nuke-keys (AUR) 1.6.3-2 + libgcrypt 1.6.0-1 = works
cryptsetup 1.6.3-2 + libgcrypt 1.6.0-1 = works


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#12 2014-01-16 19:25:39

eisensheng
Member
From: Bremen, Germany
Registered: 2014-01-16
Posts: 3

Re: LUKS-Passphrase not working after update

I'm also affected by this. I can't open an older LUKS container with
libgcrypt-1.6.0 + cryptsetup-1.6.3-2
but with
libgcrypt-1.5.3 + cryptsetup-1.6.3-1
it works.

On the other hand I can open a newly created LUKS container with the same hash algo, the same cipher and the same key size with
libgcrypt-1.6.0 + cryptsetup-1.6.3-2

Offline

#13 2014-01-16 21:05:35

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: LUKS-Passphrase not working after update

No idea what could be causing this, but it sounds like an issue that should be reported to cryptsetup.

Offline

#14 2014-01-16 21:34:16

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: LUKS-Passphrase not working after update

eisensheng wrote:

I'm also affected by this. I can't open an older LUKS container with
libgcrypt-1.6.0 + cryptsetup-1.6.3-2
but with
libgcrypt-1.5.3 + cryptsetup-1.6.3-1
it works.

On the other hand I can open a newly created LUKS container with the same hash algo, the same cipher and the same key size with
libgcrypt-1.6.0 + cryptsetup-1.6.3-2

So it reads like this issue is only affecting older LUKS containers.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#15 2014-01-16 22:14:42

eisensheng
Member
From: Bremen, Germany
Registered: 2014-01-16
Posts: 3

Re: LUKS-Passphrase not working after update

Appears to be a problem with the whirlpool hash option.

I've created the following LUKS containers on an older system with

  • libgcrypt 1.5.3-1

  • cryptsetup 1.6.3-1

and tried to open those LUKS containers on an updated system with

  • libgcrypt 1.6.0-1

  • cryptsetup 1.6.3-2

# cryptsetup luksFormat /dev/sdj1 --hash whirlpool -c aes-cbc-plain -s 128

can't open

# cryptsetup luksFormat /dev/sdj1 --hash whirlpool -c serpent-xts-essiv:sha256 -s 128

can't open

# cryptsetup luksFormat /dev/sdj1 --hash sha1 -c serpent-xts-essiv:sha256 -s 128

can open

I would be glad if someone else could contact upstream about this. I'm heading to bed for now.

Last edited by eisensheng (2014-01-16 22:15:35)

Offline

#16 2014-01-17 10:13:46

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: LUKS-Passphrase not working after update

I've opened a bug report on the Arch Bug Tracker here: https://bugs.archlinux.org/task/38550

Please comment there on your findings.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#17 2014-01-17 14:03:51

bk
Member
Registered: 2014-01-15
Posts: 7

Re: LUKS-Passphrase not working after update

eisensheng wrote:

Appears to be a problem with the whirlpool hash option.

I think this is very plausible. Between 1.5.3 and 1.6.0 there was a huge amount of changes in whirlpool.c.

Offline

#18 2014-01-17 17:42:26

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: LUKS-Passphrase not working after update

clfarron4 wrote:

I've opened a bug report on the Arch Bug Tracker here: https://bugs.archlinux.org/task/38550

Please comment there on your findings.

No offense, but why not go upstream directly? The arch-dev's cannot fix this and will be more likely to pass a new update with higher priority (rather then rolling back)

Last edited by Spider.007 (2014-01-17 17:43:32)

Offline

#19 2014-01-17 18:24:47

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: LUKS-Passphrase not working after update

Spider.007 wrote:
clfarron4 wrote:

I've opened a bug report on the Arch Bug Tracker here: https://bugs.archlinux.org/task/38550

Please comment there on your findings.

No offense, but why not go upstream directly? The arch-dev's cannot fix this and will be more likely to pass a new update with higher priority (rather then rolling back)

I don't actually have this problem, which I tested on my other rig, so I have no motivation to report upstream to the cryptsetup.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#20 2014-01-17 19:57:53

eisensheng
Member
From: Bremen, Germany
Registered: 2014-01-16
Posts: 3

Re: LUKS-Passphrase not working after update

I got the 200 for this issue: <https://code.google.com/p/cryptsetup/issues/detail?id=200>. Lets wait and see.

Offline

#21 2014-01-17 21:00:39

plasmoid
Member
Registered: 2012-04-15
Posts: 7

Re: LUKS-Passphrase not working after update

I also haven't experienced this issue using aes-xts-plain:

# cryptsetup luksDump /dev/sda2
...
Cipher name:    aes
Cipher mode:    xts-plain
Hash spec:      sha1
Payload offset: 4040
MK bits:        512
...

Offline

#22 2014-01-18 10:24:17

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: LUKS-Passphrase not working after update

I had an odd experience, which might be a coincidence. I have two partitions using luks, both with default settings:

Version:       	1
Cipher name:   	aes
Cipher mode:   	xts-plain64
Hash spec:     	sha1
Payload offset:	4096
MK bits:       	256

This morning as I booted both my encrypted partitions failed to be decrypted. I found this thread on my phone, so I thought perhaps I should downgrade the cryptsetup package. My terminal was stuck doing a manual cryptsetup luksOpen, so I held the power button and rebooted that way. On the second boot everything worked fine. No problems.

So perhaps it was just a coincidence, but this hasn't happened to me before. I guess if others have the same thing happen, then it's worth looking into. Sorry I didn't get more info out on the failed boot.

Offline

#23 2014-01-18 19:36:11

bk
Member
Registered: 2014-01-15
Posts: 7

Re: LUKS-Passphrase not working after update

My current workaround was this:
- cryptsetup-reencrypt -h sha1 /dev/sdaX
- upgrade to libgcrypt 1.6.0
- cryptsetup-reencrypt -h whirlpool /dev/sdaX

I skipped my last point to save time a reencrypt-run takes.

Remember: cryptsetup-reencrypt is experimental!

Offline

#24 2014-01-19 09:48:06

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: LUKS-Passphrase not working after update

This thread is highly relevant: http://www.saout.de/pipermail/dm-crypt/ … 03813.html

It turns out the implementation of whirlpool was incorrect in all older cryptsetup versions! There may be some solution later to allow opening the old volumes with new libgcrypt. However, I still advise everyone who is affected to back up their data, re-create their LUKS volume and restore the backup.

Offline

#25 2014-01-20 22:08:58

bk
Member
Registered: 2014-01-15
Posts: 7

Re: LUKS-Passphrase not working after update

Offline

Board footer

Powered by FluxBB