summaryrefslogtreecommitdiff
path: root/ubifs-utils/mkfs.ubifs/crypto.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2018-10-18 16:37:09 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2018-11-01 12:41:34 +0100
commit2651d8e09509a7614a66a25e6489d943fd93376b (patch)
treef1e4c0986c07f81f27bf9b1089234a8eda20ce61 /ubifs-utils/mkfs.ubifs/crypto.c
parentd9421785a18fdfae0ada62ecbfcbbdd28c4e0fde (diff)
mkfs.ubifs: Enable Cipher selection
No longer hard code AES-128-CBC, we support AES-256-XTS too. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/mkfs.ubifs/crypto.c')
-rw-r--r--ubifs-utils/mkfs.ubifs/crypto.c7
1 files changed, 5 insertions, 2 deletions
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 <string.h>
#include <assert.h>
-#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,
}
};