summaryrefslogtreecommitdiff
path: root/crypto/keywrap.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-01-30 17:38:28 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-02-01 22:27:05 +0800
commitcce1a0d88445a62a2a92126af47cb81b377f656f (patch)
treebfcb7ad449bb456624ddaa823d0b5d7cbfb7cc60 /crypto/keywrap.c
parent0a3eb652fbcb75d3d1977f94831426b0c52456a8 (diff)
downloadlinux-crypto-cce1a0d88445a62a2a92126af47cb81b377f656f.tar.gz
linux-crypto-cce1a0d88445a62a2a92126af47cb81b377f656f.zip
crypto: keywrap - memzero the correct memory
We're clearing the wrong memory. The memory corruption is likely harmless because we weren't going to use that stack memory again but not zeroing is a potential information leak. Fixes: 30d50a867e98 ('crypto: keywrap - add key wrapping block chaining mode') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/keywrap.c')
-rw-r--r--crypto/keywrap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/keywrap.c b/crypto/keywrap.c
index b1d106ce..72014f96 100644
--- a/crypto/keywrap.c
+++ b/crypto/keywrap.c
@@ -212,7 +212,7 @@ static int crypto_kw_decrypt(struct blkcipher_desc *desc,
SEMIBSIZE))
ret = -EBADMSG;
- memzero_explicit(&block, sizeof(struct crypto_kw_block));
+ memzero_explicit(block, sizeof(struct crypto_kw_block));
return ret;
}
@@ -297,7 +297,7 @@ static int crypto_kw_encrypt(struct blkcipher_desc *desc,
/* establish the IV for the caller to pick up */
memcpy(desc->info, block->A, SEMIBSIZE);
- memzero_explicit(&block, sizeof(struct crypto_kw_block));
+ memzero_explicit(block, sizeof(struct crypto_kw_block));
return 0;
}