Add double check for checking if source is strong
To prevent glitching past a strong source.
diff --git a/library/entropy.c b/library/entropy.c
index fdb2e15..6b0b47b 100644
--- a/library/entropy.c
+++ b/library/entropy.c
@@ -271,7 +271,13 @@
*/
for( i = 0; i < ctx->source_count; i++ )
{
- if( ctx->source[i].strong == MBEDTLS_ENTROPY_SOURCE_STRONG )
+ volatile int strong_fi = ctx->source[i].strong;
+ if( strong_fi == MBEDTLS_ENTROPY_SOURCE_STRONG )
+ have_one_strong_fi = 1;
+
+ mbedtls_platform_enforce_volatile_reads();
+
+ if( strong_fi == MBEDTLS_ENTROPY_SOURCE_STRONG )
have_one_strong_fi = 1;
olen = 0;