Patch "crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD" has been added to the 3.18-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
crypto-talitos-extend-max-key-length-for-sha384-512-hmac-and-aead.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
03d2c5114c95797c0aa7d9f463348b171a274fd4Mon Sep 17 00:00:00 2001
From: Martin Hicks <[email protected]>
Date: Tue, 2 May 2017 09:38:35 -0400
Subject: crypto: talitos - Extend max key length for SHA384/512-HMAC and AEAD
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Martin Hicks <[email protected]>
commit 03d2c5114c95797c0aa7d9f463348b171a274fd4 upstream.
An updated patch that also handles the additional key length requirements for the AEAD algorithms.
The max keysize is not 96. For SHA384/512 it's 128, and for the AEAD algorithms it's longer still. Extend the max keysize for the AEAD size for AES256 + HMAC(SHA512).
--- drivers/crypto/talitos.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/crypto/talitos.c +6 -1
@@ -634,7 +634,7 @@ static void talitos_unregister_rng(struc* crypto alg */ #define TALITOS_CRA_PRIORITY 3000 -#define TALITOS_MAX_KEY_SIZE 96 +#define TALITOS_MAX_KEY_SIZE (AES_MAX_KEY_SIZE + SHA512_BLOCK_SIZE)#define TALITOS_MAX_IV_LENGTH 16/* max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */ #define MD5_BLOCK_SIZE 64
@@ -1324,6 +1324,11 @@ static int ablkcipher_setkey(struct cryp {struct talitos_ctx *ctx =crypto_ablkcipher_ctx (cipher); +if (keylen >TALITOS_MAX_KEY_SIZE ) { +crypto_ablkcipher_set_flags (cipher,CRYPTO_TFM_RES_BAD_KEY_LEN ); +return -EINVAL ; + } +memcpy (&ctx->key, key, keylen); ctx->keylen = keylen;
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/crypto-talitos-extend-max-key-length-for-sha384-512-hmac-and-aead.patch