ctr_drbg: remove mbedtls_aes_init call from mbedtls_ctr_drbg_seed

Since 11e9310 add mbedtls_aes_init call in mbedtls_ctr_drbg_init, it
should not init aes_ctx again in mbedtls_ctr_drbg_seed.

Signed-off-by: kXuan <kxuanobj@gmail.com>
This commit is contained in:
kXuan 2022-08-11 09:52:18 +08:00
parent 11e9310fd1
commit 9ac6b28e27
No known key found for this signature in database
GPG Key ID: E53EA872AFCA251C
2 changed files with 4 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Bugfix
* Fix mbedtls_ctr_drbg_free() on an initialized but unseeded context. When
MBEDTLS_AES_ALT is enabled, it could call mbedtls_aes_free() on an
uninitialized context.

View File

@ -449,8 +449,6 @@ int mbedtls_ctr_drbg_seed( mbedtls_ctr_drbg_context *ctx,
mbedtls_mutex_init( &ctx->mutex );
#endif
mbedtls_aes_init( &ctx->aes_ctx );
ctx->f_entropy = f_entropy;
ctx->p_entropy = p_entropy;