Initialize return variable to the appropriate error code

The return variable is initilized to make the code more robust against glitch attacks.

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
gabor-mezei-arm 2020-08-24 09:53:04 +02:00
parent d1c98fcf5e
commit b8513fa6ac
No known key found for this signature in database
GPG key ID: 106F5A41ECC305BD

View file

@ -223,7 +223,8 @@ int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx,
unsigned int iteration_count,
uint32_t key_length, unsigned char *output )
{
int ret = 0, j;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
int j;
unsigned int i;
unsigned char md1[MBEDTLS_MD_MAX_SIZE];
unsigned char work[MBEDTLS_MD_MAX_SIZE];