Initialize crypto in crypt_format_luks2_opal

Without this random isn't initialized and crypt_format_luks2_opal
is aborted.
This commit is contained in:
Vojtech Trefny
2024-08-07 09:39:53 +02:00
committed by Milan Broz
parent d5fb76a3b4
commit 42f4a68705

View File

@@ -2355,6 +2355,10 @@ int crypt_format_luks2_opal(struct crypt_device *cd,
log_dbg(cd, "Formatting device %s as type LUKS2 with OPAL HW encryption.", mdata_device_path(cd) ?: "(none)");
r = init_crypto(cd);
if (r < 0)
return r;
if (volume_keys_size < opal_params->user_key_size)
return -EINVAL;