Hi,

Is there any chance that someone can validate this fix? I tested the patch against systemd-215 present in Debian testing, but can't test it with the current version.
However, the patch is very simple and should work with the latest version.

Also, the bug involved is pretty important for cryptsetup / dm-crypt users, so it would be nice to validate the patch.

Sorry to insist.

Best regards,
Quentin

Le 18/11/2014 15:54, qlefebvre_...@yahoo.com a écrit :
From: Quentin Lefebvre <qlefebvre_...@yahoo.com>

For plain dm-crypt devices, the behavior of cryptsetup package is to ignore the 
hash algorithm when a key file is provided.
With this patch, systemd-cryptsetup now behaves as cryptsetup, so that old 
plain dm-crypt devices created with cryptsetup can be mounted at boot time by 
systemd, with no modification of /etc/crypttab.
---
  src/cryptsetup/cryptsetup.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 94570eb..88626da 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -403,6 +403,11 @@ static int attach_luks_or_plain(struct crypt_device *cd,
                  } else
                          params.hash = "ripemd160";

+                /* for CRYPT_PLAIN, the behavior of cryptsetup package
+                 * is to ignore the hash algorithm when a key file is provided 
*/
+                if (key_file)
+                        params.hash = NULL;
+
                  if (arg_cipher) {
                          size_t l;


_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to