From 197f7cd4f744ae8246832343dc514296632554b2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 7 Sep 2010 23:40:31 +0000 Subject: Big, invasive but mostly automated change, with a further attempt at harmonising MemoryRegion with std::vector: The MemoryRegion::clear() function would zeroise the buffer, but keep the memory allocated and the size unchanged. This is very different from STL's clear(), which is basically the equivalent to what is called destroy() in MemoryRegion. So to be able to replace MemoryRegion with a std::vector, we have to rename destroy() to clear() and we have to expose the current functionality of clear() in some other way, since vector doesn't support this operation. Do so by adding a global function named zeroise() which takes a MemoryRegion which is zeroed. Remove clear() to ensure all callers are updated. --- src/mac/ssl3mac/ssl3_mac.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mac/ssl3mac') diff --git a/src/mac/ssl3mac/ssl3_mac.cpp b/src/mac/ssl3mac/ssl3_mac.cpp index a4c0c635e..781cb7f27 100644 --- a/src/mac/ssl3mac/ssl3_mac.cpp +++ b/src/mac/ssl3mac/ssl3_mac.cpp @@ -49,8 +49,8 @@ void SSL3_MAC::key_schedule(const byte key[], u32bit length) void SSL3_MAC::clear() { hash->clear(); - i_key.clear(); - o_key.clear(); + zeroise(i_key); + zeroise(o_key); } /* -- cgit v1.2.3