Get rid of MBEDTLS_TEST_DEFINES_ZEROIZE #9434
Labels
api-break
This issue/PR breaks the API and must wait for a new major version
component-platform
Portability layer and build scripts
enhancement
size-s
Estimated task size: small (~2d)
In
include/mbedtls/platform_util.h
, since #8143, we skip the declaration ofmbedtls_platform_zeroize
in some test builds, based on whetherMBEDTLS_TEST_DEFINES_ZEROIZE
is defined. There's a good reason for wanting to skip the declaration: we want to makembedtls_platform_zeroize
a macro so that we can benefit from a compiler warning (see discussion).The current situation is unfortunate for two reasons. One reason is that it's generally error-prone to have differences in how the product behave based on whether it's being tested, and what we're doing here breaks our invasive testing guidelines. Another more specific reason is that it would be good to have this compiler warning in production builds on platforms where it's possible. I'm not sure what these platforms are, but hopefully platforms with
memset_s
could have both a good zeroize function and a warning from GCC and Clang.So we should redesign the platform configuration for
mbedtls_platform_zeroize
to allow production builds to have the warning. We noted in the discussion at the time that we should do that when we redesign the platform interface, which we are doing now for 4.0.The text was updated successfully, but these errors were encountered: