From c573dc0021310e1956da638ecf654d65043a42ca Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Thu, 18 Oct 2018 16:37:10 +0200 Subject: mkfs.ubifs: Use correct sizes for keys and hash lengths This works currently by chance since the sizes match, but that might change with different cipher setups. Signed-off-by: Richard Weinberger Signed-off-by: David Oberhollenzer --- ubifs-utils/mkfs.ubifs/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 ec41453..7d35ae7 100644 --- a/ubifs-utils/mkfs.ubifs/crypto.c +++ b/ubifs-utils/mkfs.ubifs/crypto.c @@ -119,7 +119,7 @@ static size_t gen_essiv_salt(const void *iv, size_t iv_len, const void *key, siz return -1; } - ret = do_encrypt(cipher, iv, iv_len, sha256, EVP_CIPHER_key_length(cipher), NULL, 0, salt); + ret = do_encrypt(cipher, iv, iv_len, sha256, EVP_MD_size(EVP_sha256()), NULL, 0, salt); if (ret != iv_len) errmsg("Unable to compute ESSIV salt, return value %zi instead of %zi", ret, iv_len); -- cgit v1.2.3