summaryrefslogtreecommitdiff
path: root/drivers/crypto/nx/nx-aes-ctr.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-10-13 07:39:15 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-10-23 11:46:58 +0300
commit7740bd51efd697fe3750c7317229ec83571f5d98 (patch)
tree2e40c28085ac630f59d207bd5029a832ab01fe67 /drivers/crypto/nx/nx-aes-ctr.c
parent713b2e7203354a52ec65a913e89c957bfc8d9220 (diff)
downloadlinux-7740bd51efd697fe3750c7317229ec83571f5d98.tar.xz
crypto: nx - don't abuse blkcipher_desc to pass iv around
The NX crypto driver is using 'struct blkcipher_desc' to pass the IV around, even for AEADs (for which it creates the struct on the stack). This is not appropriate since this structure is part of the "blkcipher" API, which is deprecated and will be removed. Just pass around the IV directly instead. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/nx/nx-aes-ctr.c')
-rw-r--r--drivers/crypto/nx/nx-aes-ctr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/crypto/nx/nx-aes-ctr.c b/drivers/crypto/nx/nx-aes-ctr.c
index 191e226a11a1..05e558cefe94 100644
--- a/drivers/crypto/nx/nx-aes-ctr.c
+++ b/drivers/crypto/nx/nx-aes-ctr.c
@@ -85,8 +85,9 @@ static int ctr_aes_nx_crypt(struct blkcipher_desc *desc,
do {
to_process = nbytes - processed;
- rc = nx_build_sg_lists(nx_ctx, desc, dst, src, &to_process,
- processed, csbcpb->cpb.aes_ctr.iv);
+ rc = nx_build_sg_lists(nx_ctx, desc->info, dst, src,
+ &to_process, processed,
+ csbcpb->cpb.aes_ctr.iv);
if (rc)
goto out;