From dfb5f397e6a9ca45b387ed1becf102a2bdc56a32 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 22 Oct 2024 18:34:06 +0200 Subject: [PATCH] secp256k1_memclear: enforce variant using volatile_memset (for CI testing) --- src/util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.h b/src/util.h index 69c508c2da..698611b1d8 100644 --- a/src/util.h +++ b/src/util.h @@ -229,10 +229,10 @@ static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) { /* Cleanses memory to prevent leaking sensitive info. Won't be optimized out. */ static SECP256K1_INLINE void secp256k1_memclear(void *ptr, size_t len) { -#if defined(_MSC_VER) +#if 0 /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */ SecureZeroMemory(ptr, len); -#elif defined(__GNUC__) +#elif 0 /* We use a memory barrier that scares the compiler away from optimizing out the memset. * * Quoting Adam Langley in commit ad1907fe73334d6c696c8539646c21b11178f20f