mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-09 21:44:28 +00:00
Removes f_rng from mbedtls_rsa_rsassa_pkcs1_v15_verify
Commit performs removal of f_rng parameter from mbedtls_rsa_rsassa_pkcs1_v15_verify function in preparation for removal of mode parameter. Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
cbc088f5d0
commit
475053df2c
@ -1016,9 +1016,6 @@ int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
|
|||||||
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
|
* return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED.
|
||||||
*
|
*
|
||||||
* \param ctx The initialized RSA public key context to use.
|
* \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
|
* \param mode The mode of operation. This must be either
|
||||||
* #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
|
* #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated).
|
||||||
* \param md_alg The message-digest algorithm used to hash the original data.
|
* \param md_alg The message-digest algorithm used to hash the original data.
|
||||||
@ -1038,7 +1035,6 @@ int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
|
|||||||
* \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.
|
* \return An \c MBEDTLS_ERR_RSA_XXX error code on failure.
|
||||||
*/
|
*/
|
||||||
int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
|
int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
|
||||||
int mode,
|
int mode,
|
||||||
mbedtls_md_type_t md_alg,
|
mbedtls_md_type_t md_alg,
|
||||||
unsigned int hashlen,
|
unsigned int hashlen,
|
||||||
|
@ -2331,7 +2331,6 @@ int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx,
|
|||||||
* Implementation of the PKCS#1 v2.1 RSASSA-PKCS1-v1_5-VERIFY function
|
* Implementation of the PKCS#1 v2.1 RSASSA-PKCS1-v1_5-VERIFY function
|
||||||
*/
|
*/
|
||||||
int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
|
int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t),
|
|
||||||
int mode,
|
int mode,
|
||||||
mbedtls_md_type_t md_alg,
|
mbedtls_md_type_t md_alg,
|
||||||
unsigned int hashlen,
|
unsigned int hashlen,
|
||||||
@ -2376,7 +2375,7 @@ int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx,
|
|||||||
|
|
||||||
ret = ( mode == MBEDTLS_RSA_PUBLIC )
|
ret = ( mode == MBEDTLS_RSA_PUBLIC )
|
||||||
? mbedtls_rsa_public( ctx, sig, encoded )
|
? mbedtls_rsa_public( ctx, sig, encoded )
|
||||||
: mbedtls_rsa_private( ctx, f_rng, NULL, sig, encoded );
|
: mbedtls_rsa_private( ctx, NULL, NULL, sig, encoded );
|
||||||
if( ret != 0 )
|
if( ret != 0 )
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -2428,7 +2427,7 @@ int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx,
|
|||||||
{
|
{
|
||||||
#if defined(MBEDTLS_PKCS1_V15)
|
#if defined(MBEDTLS_PKCS1_V15)
|
||||||
case MBEDTLS_RSA_PKCS_V15:
|
case MBEDTLS_RSA_PKCS_V15:
|
||||||
return mbedtls_rsa_rsassa_pkcs1_v15_verify( ctx, NULL, MBEDTLS_RSA_PUBLIC, md_alg,
|
return mbedtls_rsa_rsassa_pkcs1_v15_verify( ctx, MBEDTLS_RSA_PUBLIC, md_alg,
|
||||||
hashlen, hash, sig );
|
hashlen, hash, sig );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -297,22 +297,22 @@ void rsa_invalid_param( )
|
|||||||
buf ) );
|
buf ) );
|
||||||
|
|
||||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
||||||
mbedtls_rsa_rsassa_pkcs1_v15_verify( NULL, NULL,
|
mbedtls_rsa_rsassa_pkcs1_v15_verify( NULL,
|
||||||
MBEDTLS_RSA_PUBLIC,
|
MBEDTLS_RSA_PUBLIC,
|
||||||
0, sizeof( buf ), buf,
|
0, sizeof( buf ), buf,
|
||||||
buf ) );
|
buf ) );
|
||||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
||||||
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx, NULL,
|
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx,
|
||||||
MBEDTLS_RSA_PUBLIC,
|
MBEDTLS_RSA_PUBLIC,
|
||||||
0, sizeof( buf ),
|
0, sizeof( buf ),
|
||||||
NULL, buf ) );
|
NULL, buf ) );
|
||||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
||||||
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx, NULL,
|
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx,
|
||||||
MBEDTLS_RSA_PUBLIC,
|
MBEDTLS_RSA_PUBLIC,
|
||||||
0, sizeof( buf ), buf,
|
0, sizeof( buf ), buf,
|
||||||
NULL ) );
|
NULL ) );
|
||||||
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_RSA_BAD_INPUT_DATA,
|
||||||
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx, NULL,
|
mbedtls_rsa_rsassa_pkcs1_v15_verify( &ctx,
|
||||||
MBEDTLS_RSA_PUBLIC,
|
MBEDTLS_RSA_PUBLIC,
|
||||||
MBEDTLS_MD_SHA1,
|
MBEDTLS_MD_SHA1,
|
||||||
0, NULL,
|
0, NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user