aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/sha256-prf.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-05 16:05:58 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-06 00:49:13 (GMT)
commit51f3427019401625dae50fecff0f116b27087b49 (patch)
tree07d1f6662fe83e7327b6811797482124dc9cfd52 /src/crypto/sha256-prf.c
parent77a2c3941e23d4fb0374ea041cce8de9b21cf07e (diff)
downloadhostap-51f3427019401625dae50fecff0f116b27087b49.zip
hostap-51f3427019401625dae50fecff0f116b27087b49.tar.gz
hostap-51f3427019401625dae50fecff0f116b27087b49.tar.bz2
crypto: Clear temporary stack buffers after use
This reduces possibility of exposure of private keys should something get access to stack memory. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/crypto/sha256-prf.c')
-rw-r--r--src/crypto/sha256-prf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/sha256-prf.c b/src/crypto/sha256-prf.c
index 9a11208..79791c0 100644
--- a/src/crypto/sha256-prf.c
+++ b/src/crypto/sha256-prf.c
@@ -95,4 +95,6 @@ void sha256_prf_bits(const u8 *key, size_t key_len, const char *label,
u8 mask = 0xff << (8 - buf_len_bits % 8);
buf[pos - 1] &= mask;
}
+
+ os_memset(hash, 0, sizeof(hash));
}