From 42f4a68705384eeecb5b31b71cc8a8fe19bca916 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Wed, 7 Aug 2024 09:39:53 +0200 Subject: [PATCH] Initialize crypto in crypt_format_luks2_opal Without this random isn't initialized and crypt_format_luks2_opal is aborted. --- lib/setup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/setup.c b/lib/setup.c index d057adbb..cdf468e1 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -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;