From 712bb9c5af135b9d4159f997fccd93056c14bf96 Mon Sep 17 00:00:00 2001 From: Przemek Stekiel Date: Fri, 29 Jul 2022 11:12:00 +0200 Subject: [PATCH] Use more suitable function for checking if hash is supported Signed-off-by: Przemek Stekiel --- library/rsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/rsa.c b/library/rsa.c index 5e7cbcc8d6..e461f6ed94 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -515,7 +515,7 @@ int mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding, ( hash_id != MBEDTLS_MD_NONE ) ) { /* Just make sure this hash is supported in this build. */ - if( mbedtls_hash_info_get_size( hash_id ) == 0 ) + if( mbedtls_hash_info_psa_from_md( hash_id ) == PSA_ALG_NONE ) return( MBEDTLS_ERR_RSA_INVALID_PADDING ); } #endif /* MBEDTLS_PKCS1_V21 */