Ensure memsets of sensitive memory aren't optimized away

This commit is contained in:
Andrew Ayer
2014-07-23 19:32:30 -07:00
parent 23ff272f7d
commit 477983f4bc
5 changed files with 17 additions and 4 deletions

View File

@@ -45,8 +45,8 @@
Key_file::Entry::Entry ()
{
version = 0;
std::memset(aes_key, 0, AES_KEY_LEN);
std::memset(hmac_key, 0, HMAC_KEY_LEN);
explicit_memset(aes_key, 0, AES_KEY_LEN);
explicit_memset(hmac_key, 0, HMAC_KEY_LEN);
}
void Key_file::Entry::load (std::istream& in)