zkey: Correct crypttab entry generation

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 <ifranzki@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Ingo Franzki
2019-02-21 16:16:06 +01:00
committed by Jan Höppner
parent ec9c67189e
commit 90dc65659f

View File

@@ -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;
}