From 4a28391495938ffadfa782601b3514ee11176e96 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 2 Sep 2017 19:22:53 -0400 Subject: [PATCH] Back-off assert in SecBlock Since removing the allocator overloards that handled the wipe mark, we have to route deallocate into the standard one. The standard one fires an assert for [now] normal operation --- secblock.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/secblock.h b/secblock.h index 6af1663d..89f6694f 100644 --- a/secblock.h +++ b/secblock.h @@ -198,7 +198,7 @@ public: return NULLPTR; #if CRYPTOPP_BOOL_ALIGN16 - // TODO: should this need the test 'size*sizeof(T) >= 16'? + // TODO: Does this need the test 'size*sizeof(T) >= 16'? if (T_Align16 && size) return (pointer)AlignedAllocate(size*sizeof(T)); #endif @@ -216,7 +216,9 @@ public: //! UnalignedDeallocate() used if T_Align16 is false. void deallocate(void *ptr, size_type size) { - CRYPTOPP_ASSERT((ptr && size) || !(ptr || size)); + // This will fire if SetMark(0) was called in the SecBlock + // Our self tests exercise it, disable it now. + // CRYPTOPP_ASSERT((ptr && size) || !(ptr || size)); SecureWipeArray((pointer)ptr, size); #if CRYPTOPP_BOOL_ALIGN16