]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: Fix IV selection
authorRichard Weinberger <richard@nod.at>
Wed, 7 Nov 2018 20:21:07 +0000 (21:21 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Fri, 9 Nov 2018 13:24:39 +0000 (14:24 +0100)
We need to check for AES being in 128-cbc mode and not 256-cbc.
fscrypt supports only 128-cbc and 256-xts so far.

Signed-off-by: Richard Weinberger <richard@nod.at>
Tested-by: Heiko Schocher <hsdenx.de>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/mkfs.ubifs/crypto.c

index 9c6073ec00f9f017cd49005d976fa6542a0b1290..cd68e372601f8894949d8a9db5566d444828c6ea 100644 (file)
@@ -152,7 +152,7 @@ static ssize_t encrypt_block(const void *plaintext, size_t size,
        iv.index = cpu_to_le64(block_index);
        memset(iv.padding, 0, sizeof(iv.padding));
 
-       if (cipher == EVP_aes_256_cbc()) {
+       if (cipher == EVP_aes_128_cbc()) {
                tweak = alloca(ivsize);
                gen_essiv_salt(&iv, FS_IV_SIZE, key, key_len, tweak);
        } else {