From 4eac9b7ad908e60dbc1203088a86fbf880df5e5e Mon Sep 17 00:00:00 2001 From: Quentin Lefebvre Date: Tue, 18 Nov 2014 14:22:31 +0100 Subject: [PATCH] This patch solves the bug 52630 described here: https://bugs.freedesktop.org/show_bug.cgi?id=52630 . 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; -- 2.1.3