Change pbkdf2 password to array

Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
This commit is contained in:
Kusumit Ghoderao 2023-05-24 12:28:46 +05:30
parent 9016bc4ed2
commit 52fe517a77
2 changed files with 1 additions and 6 deletions

View file

@ -119,7 +119,7 @@ typedef struct {
size_t MBEDTLS_PRIVATE(input_cost); size_t MBEDTLS_PRIVATE(input_cost);
uint8_t *MBEDTLS_PRIVATE(salt); uint8_t *MBEDTLS_PRIVATE(salt);
size_t MBEDTLS_PRIVATE(salt_length); size_t MBEDTLS_PRIVATE(salt_length);
uint8_t *MBEDTLS_PRIVATE(password); uint8_t MBEDTLS_PRIVATE(password)[PSA_HMAC_MAX_HASH_BLOCK_SIZE];
size_t MBEDTLS_PRIVATE(password_length); size_t MBEDTLS_PRIVATE(password_length);
} psa_pbkdf2_key_derivation_t; } psa_pbkdf2_key_derivation_t;
#endif /* MBEDTLS_PSA_BUILTIN_ALG_PBKDF2_HMAC */ #endif /* MBEDTLS_PSA_BUILTIN_ALG_PBKDF2_HMAC */

View file

@ -5101,11 +5101,6 @@ psa_status_t psa_key_derivation_abort(psa_key_derivation_operation_t *operation)
operation->ctx.pbkdf2.salt_length); operation->ctx.pbkdf2.salt_length);
mbedtls_free(operation->ctx.pbkdf2.salt); mbedtls_free(operation->ctx.pbkdf2.salt);
} }
if (operation->ctx.pbkdf2.password != NULL) {
mbedtls_platform_zeroize(operation->ctx.pbkdf2.password,
operation->ctx.pbkdf2.password_length);
mbedtls_free(operation->ctx.pbkdf2.password);
}
status = PSA_SUCCESS; status = PSA_SUCCESS;
} else } else