summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-06 09:05:03 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-06 09:05:03 -0800
commit37d98457e3c414a1673bf5dce97eb4c79b5cff25 (patch)
treeb443b237fa80f2cc8ca8510b63aaa4861ba3ea7a /crypto
parent3b1e5139cbefbef975f448698267f42d2016b166 (diff)
parentac3f51069c1b0fb5150e527605afddef129c107c (diff)
downloadlinux-crypto-37d98457e3c414a1673bf5dce97eb4c79b5cff25.tar.gz
linux-crypto-37d98457e3c414a1673bf5dce97eb4c79b5cff25.zip
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes an unaligned panic in x86/sha-mb and a bug in ccm that triggers with certain underlying implementations" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ccm - preserve the IV buffer crypto: x86/sha1-mb - fix panic due to unaligned access crypto: x86/sha256-mb - fix panic due to unaligned access
Diffstat (limited to 'crypto')
-rw-r--r--crypto/ccm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/ccm.c b/crypto/ccm.c
index 1ce37ae0..0a083342 100644
--- a/crypto/ccm.c
+++ b/crypto/ccm.c
@@ -363,7 +363,7 @@ static int crypto_ccm_decrypt(struct aead_request *req)
unsigned int cryptlen = req->cryptlen;
u8 *authtag = pctx->auth_tag;
u8 *odata = pctx->odata;
- u8 *iv = req->iv;
+ u8 *iv = pctx->idata;
int err;
cryptlen -= authsize;
@@ -379,6 +379,8 @@ static int crypto_ccm_decrypt(struct aead_request *req)
if (req->src != req->dst)
dst = pctx->dst;
+ memcpy(iv, req->iv, 16);
+
skcipher_request_set_tfm(skreq, ctx->ctr);
skcipher_request_set_callback(skreq, pctx->flags,
crypto_ccm_decrypt_done, req);