summaryrefslogtreecommitdiff
path: root/drivers/crypto/nx/nx-aes-ccm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-07-13 20:33:22 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-07-13 20:33:22 +0300
commit34bef46e786ca6f884b8ed4be89e07b62f28ec3c (patch)
tree7b8bcee0b8fb4ec18866e067d0164890f1dbcfac /drivers/crypto/nx/nx-aes-ccm.c
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff)
parent030f4e968741d65aea9cd5f7814d1164967801ef (diff)
downloadlinux-34bef46e786ca6f884b8ed4be89e07b62f28ec3c.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fixes from Herbert Xu: "This fixes a duplicate dma_unmap_sg call in omap-des and reentrancy bugs in the powerpc nx driver which may cause bogus output or worse memory corruption" * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: nx - Fix reentrancy bugs crypto: omap-des - Fix unmapping of dma channels
Diffstat (limited to 'drivers/crypto/nx/nx-aes-ccm.c')
-rw-r--r--drivers/crypto/nx/nx-aes-ccm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/crypto/nx/nx-aes-ccm.c b/drivers/crypto/nx/nx-aes-ccm.c
index 67f80813a06f..e4311ce0cd78 100644
--- a/drivers/crypto/nx/nx-aes-ccm.c
+++ b/drivers/crypto/nx/nx-aes-ccm.c
@@ -494,8 +494,9 @@ out:
static int ccm4309_aes_nx_encrypt(struct aead_request *req)
{
struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(req->base.tfm);
+ struct nx_gcm_rctx *rctx = aead_request_ctx(req);
struct blkcipher_desc desc;
- u8 *iv = nx_ctx->priv.ccm.iv;
+ u8 *iv = rctx->iv;
iv[0] = 3;
memcpy(iv + 1, nx_ctx->priv.ccm.nonce, 3);
@@ -525,8 +526,9 @@ static int ccm_aes_nx_encrypt(struct aead_request *req)
static int ccm4309_aes_nx_decrypt(struct aead_request *req)
{
struct nx_crypto_ctx *nx_ctx = crypto_tfm_ctx(req->base.tfm);
+ struct nx_gcm_rctx *rctx = aead_request_ctx(req);
struct blkcipher_desc desc;
- u8 *iv = nx_ctx->priv.ccm.iv;
+ u8 *iv = rctx->iv;
iv[0] = 3;
memcpy(iv + 1, nx_ctx->priv.ccm.nonce, 3);