Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of MBEDTLS_TEST_DEFINES_ZEROIZE #9434

Open
gilles-peskine-arm opened this issue Jul 30, 2024 · 0 comments
Open

Get rid of MBEDTLS_TEST_DEFINES_ZEROIZE #9434

gilles-peskine-arm opened this issue Jul 30, 2024 · 0 comments
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)

Comments

@gilles-peskine-arm
Copy link
Contributor

In include/mbedtls/platform_util.h, since #8143, we skip the declaration of mbedtls_platform_zeroize in some test builds, based on whether MBEDTLS_TEST_DEFINES_ZEROIZE is defined. There's a good reason for wanting to skip the declaration: we want to make mbedtls_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.

@gilles-peskine-arm gilles-peskine-arm added enhancement component-platform Portability layer and build scripts api-break This issue/PR breaks the API and must wait for a new major version size-s Estimated task size: small (~2d) labels Jul 30, 2024
@gilles-peskine-arm gilles-peskine-arm moved this to Design needed in Mbed TLS 4.0 planning Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
Status: Design needed
Development

No branches or pull requests

1 participant