aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2013-11-12 11:46:04 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-11 22:36:26 -0800
commit1c651d3627a2d3ba10f2f116303ca620e17b14d5 (patch)
tree7763b0e333e80d36f9ebd40d8e06e8b9c413fbe3
parentbf2e52300b9e5a329c5f76ba8d77e33ade976b1c (diff)
downloadlinaro-lsk-1c651d3627a2d3ba10f2f116303ca620e17b14d5.tar.gz
crypto: authenc - Find proper IV address in ablkcipher callback
commit fc019c7122dfcd69c50142b57a735539aec5da95 upstream. When performing an asynchronous ablkcipher operation the authenc completion callback routine is invoked, but it does not locate and use the proper IV. The callback routine, crypto_authenc_encrypt_done, is updated to use the same method of calculating the address of the IV as is done in crypto_authenc_encrypt function which sets up the callback. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--crypto/authenc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/authenc.c b/crypto/authenc.c
index ffce19de05c..528b00bc476 100644
--- a/crypto/authenc.c
+++ b/crypto/authenc.c
@@ -368,9 +368,10 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req,
if (!err) {
struct crypto_aead *authenc = crypto_aead_reqtfm(areq);
struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc);
- struct ablkcipher_request *abreq = aead_request_ctx(areq);
- u8 *iv = (u8 *)(abreq + 1) +
- crypto_ablkcipher_reqsize(ctx->enc);
+ struct authenc_request_ctx *areq_ctx = aead_request_ctx(areq);
+ struct ablkcipher_request *abreq = (void *)(areq_ctx->tail
+ + ctx->reqoff);
+ u8 *iv = (u8 *)abreq - crypto_ablkcipher_ivsize(ctx->enc);
err = crypto_authenc_genicv(areq, iv, 0);
}