From 2651d8e09509a7614a66a25e6489d943fd93376b Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Thu, 18 Oct 2018 16:37:09 +0200 Subject: mkfs.ubifs: Enable Cipher selection No longer hard code AES-128-CBC, we support AES-256-XTS too. Signed-off-by: Richard Weinberger Signed-off-by: David Oberhollenzer --- ubifs-utils/mkfs.ubifs/crypto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ubifs-utils/mkfs.ubifs/crypto.c') diff --git a/ubifs-utils/mkfs.ubifs/crypto.c b/ubifs-utils/mkfs.ubifs/crypto.c index 8d113f1..ec41453 100644 --- a/ubifs-utils/mkfs.ubifs/crypto.c +++ b/ubifs-utils/mkfs.ubifs/crypto.c @@ -23,9 +23,8 @@ #include #include -#include "crypto.h" +#include "fscrypt.h" #include "common.h" -#include "mtd_swab.h" static int do_sha256(const unsigned char *in, size_t len, unsigned char *out) { @@ -284,11 +283,15 @@ static struct cipher ciphers[] = { .key_length = 16, .encrypt_block = encrypt_block_aes128_cbc, .encrypt_fname = encrypt_aes128_cbc_cts, + .fscrypt_block_mode = FS_ENCRYPTION_MODE_AES_128_CBC, + .fscrypt_fname_mode = FS_ENCRYPTION_MODE_AES_128_CTS, }, { .name = "AES-256-XTS", .key_length = 64, .encrypt_block = encrypt_block_aes256_xts, .encrypt_fname = encrypt_aes256_cbc_cts, + .fscrypt_block_mode = FS_ENCRYPTION_MODE_AES_256_XTS, + .fscrypt_fname_mode = FS_ENCRYPTION_MODE_AES_256_CTS, } }; -- cgit v1.2.3