mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: <davem@davemloft.net>, <linux-crypto@vger.kernel.org>,
	<herbert@gondor.hengli.com.au>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback
Date: Tue, 12 Nov 2013 11:46:04 -0600	[thread overview]
Message-ID: <20131112174604.19746.83804.stgit@tlendack-t1.amdoffice.net> (raw)
In-Reply-To: <20131112174558.19746.47262.stgit@tlendack-t1.amdoffice.net>

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>
---
 crypto/authenc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/crypto/authenc.c b/crypto/authenc.c
index ffce19d..528b00b 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);
 	}



  reply	other threads:[~2013-11-12 17:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-12 17:45 [PATCH 00/10] AMD Cryptographic Coprocessor support Tom Lendacky
2013-11-12 17:46 ` Tom Lendacky [this message]
2013-11-28 14:18   ` [PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback Herbert Xu
2013-11-12 17:46 ` [PATCH 02/10] crypto: scatterwalk - Set the chain pointer indication bit Tom Lendacky
2013-11-28 14:21   ` Herbert Xu
2015-01-20  8:06     ` [PATCH] crypto: replace scatterwalk_sg_next with sg_next Cristian Stoica
2015-01-26  2:55       ` Herbert Xu
2013-11-12 17:46 ` [PATCH 03/10] crypto: CCP device driver and interface support Tom Lendacky
2013-11-12 17:46 ` [PATCH 04/10] crypto: crypto API interface to the CCP device driver Tom Lendacky
2013-11-12 17:46 ` [PATCH 05/10] crypto: CCP AES crypto API support Tom Lendacky
2013-11-12 17:46 ` [PATCH 06/10] crypto: CCP AES CMAC mode " Tom Lendacky
2013-11-12 17:46 ` [PATCH 07/10] crypto: CCP XTS-AES " Tom Lendacky
2013-11-12 17:46 ` [PATCH 08/10] crypto: CCP SHA " Tom Lendacky
2013-11-12 17:46 ` [PATCH 09/10] crytpo: CCP device driver build files Tom Lendacky
2013-11-12 17:46 ` [PATCH 10/10] crypto: CCP maintainer information Tom Lendacky
2013-11-20 16:20 ` [PATCH 00/10] AMD Cryptographic Coprocessor support Tom Lendacky
2013-11-21  3:20   ` Herbert Xu
2013-12-05 14:35 ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2013-11-12 17:39 Tom Lendacky
2013-11-12 17:39 ` [PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback Tom Lendacky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131112174604.19746.83804.stgit@tlendack-t1.amdoffice.net \
    --to=thomas.lendacky@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®