From 90dc65659fa868ab446db07cac82235fa8a184a5 Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Thu, 21 Feb 2019 16:16:06 +0100 Subject: [PATCH] zkey: Correct crypttab entry generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove 'hash=plain' option for plain type entries, add 'none luks' for LUKS type entries. Note that the format of a crypttab entry is distribution specific. On some distributions only the first 2 fields are required, the remaining are optional, on other distributions all 4 fields are required. With this patch correct crypttab entries are generated for all distributions. Closes: https://github.com/ibm-s390-tools/s390-tools/pull/55 Fixes: https://github.com/ibm-s390-tools/s390-tools/issues/57 Signed-off-by: Ingo Franzki Signed-off-by: Jan Höppner --- zkey/keystore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zkey/keystore.c b/zkey/keystore.c index 9dcac075..ffe3580b 100644 --- a/zkey/keystore.c +++ b/zkey/keystore.c @@ -3388,11 +3388,11 @@ static int _keystore_process_crypttab(struct keystore *UNUSED(keystore), } sprintf(temp, ",sector-size=%lu", sector_size); - printf("%s\t%s\t%s\tplain,cipher=%s,size=%lu,hash=plain%s\n", + printf("%s\t%s\t%s\tplain,cipher=%s,size=%lu%s\n", dmname, volume, key_file_name, cipher_spec, key_file_size * 8, sector_size > 0 ? temp : ""); } else if (strcasecmp(volume_type, VOLUME_TYPE_LUKS2) == 0) { - printf("%s\t%s\n", dmname, volume); + printf("%s\t%s\tnone\tluks\n", dmname, volume); } else { return -EINVAL; }