Removes f_rng param from mbedtls_rsa_rsassa_pss_verify_ext
Commit removes the f_rng parameter from
the mbedtls_rsa_rsassa_pss_verify_ext
function. This is in preparation for
the removal of the mode parameter.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
diff --git a/include/mbedtls/rsa.h b/include/mbedtls/rsa.h
index 0fde575..3f453f6 100644
--- a/include/mbedtls/rsa.h
+++ b/include/mbedtls/rsa.h
@@ -1080,9 +1080,6 @@
* \note The \p hash_id in the RSA context is ignored.
*
* \param ctx The initialized RSA public key context to use.
- * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE,
- * this is used for blinding and should be provided; see
- * mbedtls_rsa_private() for more. Otherwise, it is ignored.
* \param mode The mode of operation. This must be either
* #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE.
* \param md_alg The message-digest algorithm used to hash the original data.
@@ -1105,7 +1102,6 @@
* \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.
*/
int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx,
- int (*f_rng)(void *, unsigned char *, size_t),
int mode,
mbedtls_md_type_t md_alg,
unsigned int hashlen,
diff --git a/library/pk.c b/library/pk.c
index e0dedec..65a4d0c 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -367,7 +367,7 @@
return( MBEDTLS_ERR_RSA_VERIFY_FAILED );
ret = mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_pk_rsa( *ctx ),
- NULL, MBEDTLS_RSA_PUBLIC,
+ MBEDTLS_RSA_PUBLIC,
md_alg, (unsigned int) hash_len, hash,
pss_opts->mgf1_hash_id,
pss_opts->expected_salt_len,
diff --git a/library/rsa.c b/library/rsa.c
index 6b18fe7..db684c8 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -2147,7 +2147,6 @@
* Implementation of the PKCS#1 v2.1 RSASSA-PSS-VERIFY function
*/
int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx,
- int (*f_rng)(void *, unsigned char *, size_t),
int mode,
mbedtls_md_type_t md_alg,
unsigned int hashlen,
@@ -2186,7 +2185,7 @@
ret = ( mode == MBEDTLS_RSA_PUBLIC )
? mbedtls_rsa_public( ctx, sig, buf )
- : mbedtls_rsa_private( ctx, f_rng, NULL, sig, buf );
+ : mbedtls_rsa_private( ctx, NULL, NULL, sig, buf );
if( ret != 0 )
return( ret );
@@ -2312,7 +2311,7 @@
? (mbedtls_md_type_t) ctx->hash_id
: md_alg;
- return( mbedtls_rsa_rsassa_pss_verify_ext( ctx, NULL,
+ return( mbedtls_rsa_rsassa_pss_verify_ext( ctx,
MBEDTLS_RSA_PUBLIC,
md_alg, hashlen, hash,
mgf1_hash_id,
diff --git a/tests/suites/test_suite_pkcs1_v21.function b/tests/suites/test_suite_pkcs1_v21.function
index 82f33d6..c52edcb 100644
--- a/tests/suites/test_suite_pkcs1_v21.function
+++ b/tests/suites/test_suite_pkcs1_v21.function
@@ -248,7 +248,7 @@
hash_len, hash_result,
result_str->x ) == result_simple );
- TEST_ASSERT( mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, MBEDTLS_RSA_PUBLIC,
+ TEST_ASSERT( mbedtls_rsa_rsassa_pss_verify_ext( &ctx, MBEDTLS_RSA_PUBLIC,
msg_digest_id, hash_len, hash_result,
mgf_hash, salt_len,
result_str->x ) == result_full );
diff --git a/tests/suites/test_suite_rsa.function b/tests/suites/test_suite_rsa.function
index 05886ff..b822ed9 100644
--- a/tests/suites/test_suite_rsa.function
+++ b/tests/suites/test_suite_rsa.function
@@ -333,26 +333,26 @@
buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
- mbedtls_rsa_rsassa_pss_verify_ext( NULL, NULL,
+ mbedtls_rsa_rsassa_pss_verify_ext( NULL,
MBEDTLS_RSA_PUBLIC,
0, sizeof( buf ),
buf,
0, 0,
buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
- mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL,
+ mbedtls_rsa_rsassa_pss_verify_ext( &ctx,
MBEDTLS_RSA_PUBLIC,
0, sizeof( buf ),
NULL, 0, 0,
buf ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
- mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL,
+ mbedtls_rsa_rsassa_pss_verify_ext( &ctx,
MBEDTLS_RSA_PUBLIC,
0, sizeof( buf ),
buf, 0, 0,
NULL ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
- mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL,
+ mbedtls_rsa_rsassa_pss_verify_ext( &ctx,
MBEDTLS_RSA_PUBLIC,
MBEDTLS_MD_SHA1,
0, NULL,