From beb4948d1067b41bc52ef2ec0f5a08d825e46b21 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 8 Jun 2018 17:44:35 +0200 Subject: [PATCH] Add RSA PSS verification (untested) --- library/psa_crypto.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index cd20738d9..459373652 100755 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1383,7 +1383,13 @@ psa_status_t psa_asymmetric_verify( psa_key_slot_t key, #if defined(MBEDTLS_PKCS1_V21) if( alg == PSA_ALG_RSA_PSS_MGF1 ) { - return( PSA_ERROR_NOT_SUPPORTED ); + mbedtls_rsa_set_padding( rsa, MBEDTLS_RSA_PKCS_V21, md_alg ); + ret = mbedtls_rsa_rsassa_pss_verify( rsa, + mbedtls_ctr_drbg_random, + &global_data.ctr_drbg, + MBEDTLS_RSA_PUBLIC, + md_alg, hash_length, hash, + signature ); } else #endif /* MBEDTLS_PKCS1_V21 */