@@ -167,28 +167,17 @@ MBEDTLS_DEPRECATED typedef int mbedtls_deprecated_numeric_constant_t;
167
167
* \param len Length of the buffer in bytes
168
168
*
169
169
*/
170
- #if defined(MBEDTLS_PLATFORM_ZEROIZE_CHECK_UNSAFE )
171
- #define MBEDTLS_PLATFORM_ZEROIZE_ALT
172
- #define mbedtls_platform_zeroize (buf , len ) memset(buf, 0, len)
173
- #include <string.h>
174
- #else
170
+ #if !defined(MBEDTLS_TEST_DEFINES_ZEROIZE )
175
171
void mbedtls_platform_zeroize (void * buf , size_t len );
176
172
#endif
177
173
178
- /* MBEDTLS_PLATFORM_ZEROIZE_CHECK_UNSAFE
179
- *
180
- * Replaces calls to mbedtls_platform_zeroize() with calls to memset(),
181
- * to allow compiler analysis to check for invalid length arguments (e.g.
182
- * specifying sizeof(pointer) rather than sizeof(pointee)).
183
- *
184
- * Note that this option is meant for internal use only and must not be used
185
- * in production builds, because that would lead to zeroization calls being
186
- * optimised out by the compiler.
174
+ /* MBEDTLS_TEST_DEFINES_ZEROIZE
187
175
*
188
- * It is only intended to be used in CFLAGS, with -Wsizeof-pointer-memaccess,
189
- * to check for those incorrect calls to mbedtls_platform_zeroize().
176
+ * Indicates that the library is being built by the test framework, and the
177
+ * framework is going to provide a replacement mbedtls_platform_zeroize()
178
+ * using a pre-processor macro, so the function declaration should be omitted.
190
179
*/
191
- //#define MBEDTLS_PLATFORM_ZEROIZE_CHECK_UNSAFE
180
+ //#define MBEDTLS_TEST_DEFINES_ZEROIZE
192
181
193
182
#if defined(MBEDTLS_HAVE_TIME_DATE )
194
183
/**
0 commit comments