Remove MBEDTLS_PLATFORM_GET_ENTROPY_ALT

Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
Ronald Cron
2025-09-09 08:27:45 +02:00
parent d0d817541a
commit 275f8dd5c7
2 changed files with 5 additions and 19 deletions
@@ -37,7 +37,7 @@ 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) || defined(MBEDTLS_PSA_DRIVER_GET_ENTROPY)
#if defined(MBEDTLS_PSA_DRIVER_GET_ENTROPY)
#include <mbedtls/platform.h>
@@ -73,6 +73,6 @@ void mbedtls_test_platform_get_entropy_set_entropy_content(size_t val);
/* Return the number of times mbedtls_platform_get_entropy() was called. */
size_t mbedtls_test_platform_get_entropy_get_call_count(void);
#endif /* MBEDTLS_PLATFORM_GET_ENTROPY_ALT || MBEDTLS_PSA_DRIVER_GET_ENTROPY */
#endif /* MBEDTLS_PSA_DRIVER_GET_ENTROPY */
#endif /* FAKE_EXTERNAL_RNG_FOR_TEST_H */
+3 -17
View File
@@ -55,7 +55,7 @@ psa_status_t mbedtls_psa_external_get_random(
#endif /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */
#if defined(MBEDTLS_PLATFORM_GET_ENTROPY_ALT) || defined(MBEDTLS_PSA_DRIVER_GET_ENTROPY)
#if defined(MBEDTLS_PSA_DRIVER_GET_ENTROPY)
#include <test/random.h>
@@ -130,7 +130,7 @@ static int fake_get_entropy(unsigned char *output, size_t output_size,
return 0;
}
#endif /* MBEDTLS_PLATFORM_GET_ENTROPY_ALT || MBEDTLS_PSA_DRIVER_GET_ENTROPY */
#endif /* MBEDTLS_PSA_DRIVER_GET_ENTROPY */
#if defined(MBEDTLS_PSA_DRIVER_GET_ENTROPY)
int mbedtls_platform_get_entropy(psa_driver_get_entropy_flags_t flags,
@@ -145,18 +145,4 @@ int mbedtls_platform_get_entropy(psa_driver_get_entropy_flags_t flags,
int ret = fake_get_entropy(output, output_size, estimate_bits);
return ret;
}
#elif defined(MBEDTLS_PLATFORM_GET_ENTROPY_ALT)
int mbedtls_platform_get_entropy(unsigned char *output, size_t output_size,
size_t *output_len, size_t *entropy_content)
{
int ret = fake_get_entropy(output, output_size, entropy_content);
if (ret == 0) {
if (platform_get_entropy_forced_output_len == SIZE_MAX) {
*output_len = output_size;
} else {
*output_len = platform_get_entropy_forced_output_len;
}
}
return ret;
}
#endif /* MBEDTLS_PLATFORM_GET_ENTROPY_ALT */
#endif /* MBEDTLS_PSA_DRIVER_GET_ENTROPY */