Merge pull request #161 from valeriosetti/issue9618-framework

[framework] MBEDTLS_PLATFORM_GET_ENTROPY_ALT in 4.0
This commit is contained in:
Gilles Peskine
2025-04-23 18:39:44 +02:00
committed by GitHub
3 changed files with 42 additions and 6 deletions
@@ -37,4 +37,21 @@ void mbedtls_test_enable_insecure_external_rng(void);
void mbedtls_test_disable_insecure_external_rng(void);
#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */
#if defined(MBEDTLS_PLATFORM_GET_ENTROPY_ALT)
#include <mbedtls/platform.h>
/* Force return value or entropy content in mbedtls_platform_get_entropy()
* as follows:
* - if fail == 0 && forced_entropy_content == 0 then
* mbedtls_platform_get_entropy() behaves properly.
* - if fail != 0 then MBEDTLS_ERR_ENTROPY_SOURCE_FAILED is returned.
* - if forced_entropy_content != 0 then
* - return value is success (0) but
* - returned entropy_content will be equal to forced_entropy_content.
*/
void mbedtls_test_get_entropy_force(int fail, size_t forced_entropy_content);
#endif /* MBEDTLS_PLATFORM_GET_ENTROPY_ALT */
#endif /* FAKE_EXTERNAL_RNG_FOR_TEST_H */