From 8a44bb47ac715529c1b338f0b8fc7cc5cdbd6153 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 3 Mar 2022 13:16:13 +0100 Subject: [PATCH] Handle INVALID_SIGNATURE instead of INVALID_PADDING in rsa_verify_wrap() Signed-off-by: Neil Armstrong --- library/pk_wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index 02331c345..2447cf688 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -215,9 +215,9 @@ static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg, sig, sig_len ); if( status != PSA_SUCCESS ) { - if ( status == PSA_ERROR_INVALID_PADDING ) + if ( status == PSA_ERROR_INVALID_SIGNATURE ) { - ret = MBEDTLS_ERR_RSA_INVALID_PADDING; + ret = MBEDTLS_ERR_RSA_VERIFY_FAILED; } else {