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

mbedtls_hardware_poll should have a public prototype #9881

Open
gilles-peskine-arm opened this issue Jan 8, 2025 · 0 comments
Open

mbedtls_hardware_poll should have a public prototype #9881

gilles-peskine-arm opened this issue Jan 8, 2025 · 0 comments
Labels
bug component-crypto Crypto primitives and low-level interfaces size-xs Estimated task size: extra small (a few hours at most)

Comments

@gilles-peskine-arm
Copy link
Contributor

In Mbed TLS 3, the function mbedtls_hardware_poll() is the main way to set up an entropy source on a platform. Integrators enable MBEDTLS_ENTROPY_HARDWARE_ALT and define a function which “must be called mbedtls_hardware_poll(), have the same prototype as declared in library/entropy_poll.h, and accept NULL as first argument”.

library/entropy_poll.h is not a public header, so there's no way for the compiler to validate that mbedtls_hardware_poll() has the correct type. Furthermore there's no way to tell how mbedtls_hardware_poll() should behave, or even what its prototype is, without looking at the source code of Mbed TLS.

The declaration and documentation of mbedtls_hardware_poll() should be in a public header, like we do for ALT interfaces.

This only affects Mbed TLS 3.6. In 2.28, entropy_poll.h was private. In TF-PSA-Crypto, this interface will change and we intend to declare the function in a public header.

Note: since no integrator has complained about this (to my knowledge), we are likely to treat this as a low-priority issue.

@gilles-peskine-arm gilles-peskine-arm added bug component-crypto Crypto primitives and low-level interfaces size-xs Estimated task size: extra small (a few hours at most) labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-crypto Crypto primitives and low-level interfaces size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: No status
Status: No status
Development

No branches or pull requests

1 participant