mbed TLS upgraded to 2.6.0
Fork of mbedtls by
Diff: library/ctr_drbg.c
- Revision:
- 1:9ebc941037d5
- Parent:
- 0:cdf462088d13
--- a/library/ctr_drbg.c Thu Jan 05 00:18:44 2017 +0000 +++ b/library/ctr_drbg.c Fri Sep 29 18:41:59 2017 +0100 @@ -290,7 +290,8 @@ unsigned char seed[MBEDTLS_CTR_DRBG_MAX_SEED_INPUT]; size_t seedlen = 0; - if( ctx->entropy_len + len > MBEDTLS_CTR_DRBG_MAX_SEED_INPUT ) + if( ctx->entropy_len > MBEDTLS_CTR_DRBG_MAX_SEED_INPUT || + len > MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - ctx->entropy_len ) return( MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG ); memset( seed, 0, MBEDTLS_CTR_DRBG_MAX_SEED_INPUT );