Patch "crypto: caam/qi - properly set IV after {en,de}crypt" has been added to the 4.13-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
crypto: caam/qi - properly set IV after {en,de}crypt
to the 4.13-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-caam-qi-properly-set-iv-after-en-de-crypt.patch
and it can be found in the queue-4.13 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
a68a193805224d90bedd94e9e8ac287600f07b78Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Horia=20Geant=C4=83?= <[email protected]>
Date: Mon, 10 Jul 2017 08:40:30 +0300
Subject: crypto: caam/qi - properly set IV after {en,de}crypt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Horia Geantă <[email protected]>
commit a68a193805224d90bedd94e9e8ac287600f07b78 upstream.
caam/qi needs a fix similar to what was done for caam/jr in commit "crypto: caam/qi - properly set IV after {en,de}crypt", to allow for ablkcipher/skcipher chunking/streaming.
--- drivers/crypto/caam/caamalg_qi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/crypto/caam/caamalg_qi.c +8 -1
@@ -776,9 +776,9 @@ static void ablkcipher_done(struct caam_struct crypto_ablkcipher *ablkcipher =crypto_ablkcipher_reqtfm (req);struct caam_ctx *caam_ctx =crypto_ablkcipher_ctx (ablkcipher);struct device *qidev = caam_ctx->qidev; -#ifdef DEBUG int ivsize =crypto_ablkcipher_ivsize (ablkcipher); +#ifdef DEBUG dev_err (qidev,"%s %d: status 0x%x\n" , __func__, __LINE__, status);#endif
@@ -799,6 +799,13 @@ static void ablkcipher_done(struct caam_ablkcipher_unmap (qidev, edesc, req);qi_cache_free (edesc); +/* +* The crypto API expects us to set the IV (req->info) to the last +* ciphertext block. This is used e.g. by the CTS mode. +*/ +scatterwalk_map_and_copy (req->info, req->dst, req->nbytes - ivsize, + ivsize,0 ); +ablkcipher_request_complete (req, status); }
Patches currently in stable-queue which might be from [email protected] are
queue-4.13/crypto-caam-qi-properly-set-iv-after-en-de-crypt.patch queue-4.13/crypto-caam-qi-fix-typo-in-authenc-alg-driver-name.patch