diff options
author | Sebastian Hahn <sebastian@torproject.org> | 2010-02-22 11:39:29 +0100 |
---|---|---|
committer | Sebastian Hahn <sebastian@torproject.org> | 2010-02-26 05:47:25 +0100 |
commit | a9802d3322f14e9649cbec354ffcf7e1cf266494 (patch) | |
tree | cae9b145058690e97c874c59a2a211dc15f1bc06 /src/common | |
parent | 5e5bc8724edf28491c36fa2e9dd505967f21d45b (diff) | |
download | tor-a9802d3322f14e9649cbec354ffcf7e1cf266494.tar.gz tor-a9802d3322f14e9649cbec354ffcf7e1cf266494.zip |
Zero a cipher completely before freeing it
We used to only zero the first ptrsize bytes of the cipher. Since
cipher is large enough, we didn't zero too many bytes. Discovered
and fixed by ekir. Fixes bug 1254.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/aes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/aes.c b/src/common/aes.c index e07665635b..224988915b 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -267,7 +267,7 @@ aes_free_cipher(aes_cnt_cipher_t *cipher) #ifdef USE_OPENSSL_EVP EVP_CIPHER_CTX_cleanup(&cipher->key); #endif - memset(cipher, 0, sizeof(cipher)); + memset(cipher, 0, sizeof(aes_cnt_cipher_t)); tor_free(cipher); } |