Milan Broz 4eaf0932c6 block: Fix regression in sed-opal for a saved key.
The commit 3bfeb61256643281ac4be5b8a57e9d9da3db4335
introduced the use of keyring for sed-opal.

Unfortunately, there is also a possibility to save
the Opal key used in opal_lock_unlock().

This patch switches the order of operation, so the cached
key is used instead of failure for opal_get_key.

The problem was found by the cryptsetup Opal test recently
added to the cryptsetup tree.

Fixes: 3bfeb6125664 ("block: sed-opal: keyring support for SED keys")
Tested-by: Ondrej Kozina <okozina@redhat.com>
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Link: https://lore.kernel.org/r/20231003100209.380037-1-gmazyland@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-10-13 08:16:08 -06:00
..
2023-08-29 20:21:42 -07:00
2023-08-23 13:06:55 +02:00
2023-06-30 11:57:07 -07:00
2023-08-14 15:40:42 -06:00
2023-08-29 20:21:42 -07:00
2023-04-26 12:52:58 -07:00
2023-08-29 20:21:42 -07:00
2023-06-26 12:47:20 -07:00
2023-08-14 15:40:42 -06:00
2023-06-30 11:57:07 -07:00
2022-03-07 12:48:35 -07:00