diff options
author | Stephan Mueller <smueller@chronox.de> | 2014-11-11 05:37:07 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-11-12 22:14:31 +0800 |
commit | 8bd21048c8034afb85923f5c390df3b6dad85bfe (patch) | |
tree | c67b75817f97d650989b6bf05ddbbabb9ad0b9e1 /crypto | |
parent | d693ed2a68fae6b84e345a9816636c8c53129fa8 (diff) | |
download | linux-crypto-8bd21048c8034afb85923f5c390df3b6dad85bfe.tar.gz linux-crypto-8bd21048c8034afb85923f5c390df3b6dad85bfe.zip |
crypto: algif - zeroize message digest buffer
Zeroize the buffer holding the message digest calculated for the
consumer before the buffer is released by the hash 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_hash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/algif_hash.c b/crypto/algif_hash.c index 85024620..f75db4ce 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c @@ -258,6 +258,8 @@ static void hash_sock_destruct(struct sock *sk) struct alg_sock *ask = alg_sk(sk); struct hash_ctx *ctx = ask->private; + memzero_explicit(ctx->result, + crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); sock_kfree_s(sk, ctx->result, crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); sock_kfree_s(sk, ctx, ctx->len); |