diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index 58750c8b7..1336c7e4c 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -210,7 +210,7 @@ static int hmac_drbg_reseed_core( mbedtls_hmac_drbg_context *ctx, size_t seedlen = 0; size_t total_entropy_len; int ret = MBEDTLS_ERR_PLATFORM_FAULT_DETECTED; - volatile const unsigned char *additional_dup = additional; + const unsigned char * volatile additional_dup = additional; volatile size_t len_dup = len; int reseed_counter_backup = -1; @@ -417,7 +417,7 @@ int mbedtls_hmac_drbg_random_with_add( void *p_rng, mbedtls_hmac_drbg_context *ctx = (mbedtls_hmac_drbg_context *) p_rng; size_t md_len = mbedtls_md_get_size( mbedtls_md_get_handle( &ctx->md_ctx ) ); - size_t left = out_len; + volatile size_t left = out_len; unsigned char *out = output; /* II. Check request length */ @@ -430,8 +430,8 @@ int mbedtls_hmac_drbg_random_with_add( void *p_rng, /* 1. (aka VII and IX) Check reseed counter and PR */ if( ctx->f_entropy != NULL && /* For no-reseeding instances */ - ( ctx->prediction_resistance == MBEDTLS_HMAC_DRBG_PR_ON || - ctx->reseed_counter > ctx->reseed_interval ) ) + ( ctx->prediction_resistance == MBEDTLS_HMAC_DRBG_PR_ON || + ctx->reseed_counter > ctx->reseed_interval ) ) { if( ( ret = mbedtls_hmac_drbg_reseed( ctx, additional, add_len ) ) != 0 ) return( ret );