diff options
author | Stephan Mueller <smueller@chronox.de> | 2014-11-10 23:37:07 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2014-11-12 09:14:31 -0500 |
commit | 2a6af25befd0197e805b3aa5ebfc253079ce7136 (patch) | |
tree | 2b4d6741586bfdf6290d7a8b939d91e4b9f55a92 /crypto/algif_hash.c | |
parent | 4c7912e9198b141b6cd85999d28b48cb5a037aa0 (diff) |
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 'crypto/algif_hash.c')
-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 850246206b12..f75db4ce48bf 100644 --- a/crypto/algif_hash.c +++ b/crypto/algif_hash.c | |||
@@ -258,6 +258,8 @@ static void hash_sock_destruct(struct sock *sk) | |||
258 | struct alg_sock *ask = alg_sk(sk); | 258 | struct alg_sock *ask = alg_sk(sk); |
259 | struct hash_ctx *ctx = ask->private; | 259 | struct hash_ctx *ctx = ask->private; |
260 | 260 | ||
261 | memzero_explicit(ctx->result, | ||
262 | crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | ||
261 | sock_kfree_s(sk, ctx->result, | 263 | sock_kfree_s(sk, ctx->result, |
262 | crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); | 264 | crypto_ahash_digestsize(crypto_ahash_reqtfm(&ctx->req))); |
263 | sock_kfree_s(sk, ctx, ctx->len); | 265 | sock_kfree_s(sk, ctx, ctx->len); |