Merge branch 'bugfix/eap_hash_key_len_validation_v5.0' into 'release/v5.0'

esp_wifi:Adding hash key length validation(backport v5.0)

See merge request espressif/esp-idf!20484
This commit is contained in:
Jiang Jiang Jian 2022-10-14 11:16:03 +08:00
commit ab848877a8

View File

@ -339,8 +339,11 @@ int crypto_public_key_decrypt_pkcs1(struct crypto_public_key *key,
size_t len;
u8 *pos;
mbedtls_pk_context *pkey = (mbedtls_pk_context *)key;
len = mbedtls_pk_rsa(*pkey)->MBEDTLS_PRIVATE(len);
if (len != crypt_len) {
return -1;
}
len = *plain_len;
if (mbedtls_rsa_public(mbedtls_pk_rsa(*pkey), crypt, plain) < 0)
return -1;