summaryrefslogtreecommitdiff
path: root/crypto/algif_skcipher.c
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2014-11-11 05:37:57 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2014-11-12 22:14:31 +0800
commita7468e6b54f4478cfb56e73baa4a3b8e057bf2c9 (patch)
treeb3920c40d1d4ad7670ff04eb92eca3325646ca0d /crypto/algif_skcipher.c
parent8bd21048c8034afb85923f5c390df3b6dad85bfe (diff)
downloadlinux-crypto-a7468e6b54f4478cfb56e73baa4a3b8e057bf2c9.tar.gz
linux-crypto-a7468e6b54f4478cfb56e73baa4a3b8e057bf2c9.zip
crypto: algif - zeroize IV buffer
Zeroize the buffer holding the IV used for the completed cipher operation before the buffer is released by the skcipher AF_ALG interface handler. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/algif_skcipher.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index 83187f49..85e3bdbe 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -566,6 +566,7 @@ static void skcipher_sock_destruct(struct sock *sk)
struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(&ctx->req);
skcipher_free_sgl(sk);
+ memzero_explicit(ctx->iv, crypto_ablkcipher_ivsize(tfm));
sock_kfree_s(sk, ctx->iv, crypto_ablkcipher_ivsize(tfm));
sock_kfree_s(sk, ctx, ctx->len);
af_alg_release_parent(sk);