diff mbox series

[1/2] mkfs.ubifs: Fix IV selection

Message ID 20181107202108.13734-1-richard@nod.at
State Accepted
Delegated to: Richard Weinberger
Headers show
Series [1/2] mkfs.ubifs: Fix IV selection | expand

Commit Message

Richard Weinberger Nov. 7, 2018, 8:21 p.m. UTC
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>
---
 ubifs-utils/mkfs.ubifs/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heiko Schocher Nov. 8, 2018, 5:28 a.m. UTC | #1
Hello Richard,

Am 07.11.2018 um 21:21 schrieb Richard Weinberger:
> 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>
> ---
>   ubifs-utils/mkfs.ubifs/crypto.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Thanks! Fixes my problems with encryption on imx6 based board.

Tested-by: Heiko Schocher <hsdenx.de>

bye,
Heiko
David Oberhollenzer Nov. 9, 2018, 1:36 p.m. UTC | #2
Applied to mtd-utils.git master.

Thanks,

David
diff mbox series

Patch

diff --git a/ubifs-utils/mkfs.ubifs/crypto.c b/ubifs-utils/mkfs.ubifs/crypto.c
index 9c6073ec00f9..cd68e372601f 100644
--- a/ubifs-utils/mkfs.ubifs/crypto.c
+++ b/ubifs-utils/mkfs.ubifs/crypto.c
@@ -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 {