mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Use PSA-neutral function for availability check
We just want to check if this hash is available, and the check is present in builds both with PSA and without it. The function we were using is only present in builds with PSA, so it wasn't appropriate. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
@ -478,7 +478,7 @@ int mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding,
|
||||
if ((padding == MBEDTLS_RSA_PKCS_V21) &&
|
||||
(hash_id != MBEDTLS_MD_NONE)) {
|
||||
/* Just make sure this hash is supported in this build. */
|
||||
if (mbedtls_md_psa_alg_from_type(hash_id) == PSA_ALG_NONE) {
|
||||
if (mbedtls_md_info_from_type(hash_id) == NULL) {
|
||||
return MBEDTLS_ERR_RSA_INVALID_PADDING;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user