mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
+1
-1
@@ -268,7 +268,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user