From da6dbbd433c2d6496f2fe33348ecb533dd289e4b Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sat, 17 Nov 2018 11:10:56 +0100 Subject: [PATCH] Fallback to default keyslot algorithm if backend does not know the cipher. --- lib/luks2/luks2_keyslot.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/luks2/luks2_keyslot.c b/lib/luks2/luks2_keyslot.c index 10048294..bf015910 100644 --- a/lib/luks2/luks2_keyslot.c +++ b/lib/luks2/luks2_keyslot.c @@ -123,6 +123,10 @@ int LUKS2_keyslot_cipher_incompatible(struct crypt_device *cd) if (crypt_cipher_wrapped_key(cipher)) return 1; + /* Check if crypto backend can use the cipher */ + if (crypt_cipher_blocksize(cipher) < 0) + return 1; + return 0; }