mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-31 03:30:35 -04:00 
			
		
		
		
	Removes p_rng param from mbedtls_rsa_rsassa_pss_verify_ext
Commit removes p_rng parameter from the mbedtls_rsa_rsassa_pss_verify_ext function in preparation for removal of the mode parameter. Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
		
							parent
							
								
									5ee4cc031c
								
							
						
					
					
						commit
						578e9abcbd
					
				| @ -1083,8 +1083,6 @@ int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx, | |||||||
|  * \param f_rng    The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE, |  * \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 |  *                 this is used for blinding and should be provided; see | ||||||
|  *                 mbedtls_rsa_private() for more. Otherwise, it is ignored. |  *                 mbedtls_rsa_private() for more. Otherwise, it is ignored. | ||||||
|  * \param p_rng    The RNG context to be passed to \p f_rng. This may be |  | ||||||
|  *                 \c NULL if \p f_rng is \c NULL or doesn't need a context. |  | ||||||
|  * \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. |  *                 #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. | ||||||
|  * \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. | ||||||
| @ -1108,7 +1106,6 @@ int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx, | |||||||
|  */ |  */ | ||||||
| int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, | int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, | ||||||
|                                int (*f_rng)(void *, unsigned char *, size_t), |                                int (*f_rng)(void *, unsigned char *, size_t), | ||||||
|                                void *p_rng, |  | ||||||
|                                int mode, |                                int mode, | ||||||
|                                mbedtls_md_type_t md_alg, |                                mbedtls_md_type_t md_alg, | ||||||
|                                unsigned int hashlen, |                                unsigned int hashlen, | ||||||
|  | |||||||
| @ -367,7 +367,7 @@ int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options, | |||||||
|             return( MBEDTLS_ERR_RSA_VERIFY_FAILED ); |             return( MBEDTLS_ERR_RSA_VERIFY_FAILED ); | ||||||
| 
 | 
 | ||||||
|         ret = mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_pk_rsa( *ctx ), |         ret = mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_pk_rsa( *ctx ), | ||||||
|                 NULL, NULL, MBEDTLS_RSA_PUBLIC, |                 NULL, MBEDTLS_RSA_PUBLIC, | ||||||
|                 md_alg, (unsigned int) hash_len, hash, |                 md_alg, (unsigned int) hash_len, hash, | ||||||
|                 pss_opts->mgf1_hash_id, |                 pss_opts->mgf1_hash_id, | ||||||
|                 pss_opts->expected_salt_len, |                 pss_opts->expected_salt_len, | ||||||
|  | |||||||
| @ -2148,7 +2148,6 @@ int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx, | |||||||
|  */ |  */ | ||||||
| int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, | int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, | ||||||
|                                int (*f_rng)(void *, unsigned char *, size_t), |                                int (*f_rng)(void *, unsigned char *, size_t), | ||||||
|                                void *p_rng, |  | ||||||
|                                int mode, |                                int mode, | ||||||
|                                mbedtls_md_type_t md_alg, |                                mbedtls_md_type_t md_alg, | ||||||
|                                unsigned int hashlen, |                                unsigned int hashlen, | ||||||
| @ -2187,7 +2186,7 @@ int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, | |||||||
| 
 | 
 | ||||||
|     ret = ( mode == MBEDTLS_RSA_PUBLIC ) |     ret = ( mode == MBEDTLS_RSA_PUBLIC ) | ||||||
|           ? mbedtls_rsa_public(  ctx, sig, buf ) |           ? mbedtls_rsa_public(  ctx, sig, buf ) | ||||||
|           : mbedtls_rsa_private( ctx, f_rng, p_rng, sig, buf ); |           : mbedtls_rsa_private( ctx, f_rng, NULL, sig, buf ); | ||||||
| 
 | 
 | ||||||
|     if( ret != 0 ) |     if( ret != 0 ) | ||||||
|         return( ret ); |         return( ret ); | ||||||
| @ -2313,7 +2312,7 @@ int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx, | |||||||
|                              ? (mbedtls_md_type_t) ctx->hash_id |                              ? (mbedtls_md_type_t) ctx->hash_id | ||||||
|                              : md_alg; |                              : md_alg; | ||||||
| 
 | 
 | ||||||
|     return( mbedtls_rsa_rsassa_pss_verify_ext( ctx, NULL, NULL, |     return( mbedtls_rsa_rsassa_pss_verify_ext( ctx, NULL, | ||||||
|                                                MBEDTLS_RSA_PUBLIC, |                                                MBEDTLS_RSA_PUBLIC, | ||||||
|                                                md_alg, hashlen, hash, |                                                md_alg, hashlen, hash, | ||||||
|                                                mgf1_hash_id, |                                                mgf1_hash_id, | ||||||
|  | |||||||
| @ -248,7 +248,7 @@ void pkcs1_rsassa_pss_verify_ext( int mod, data_t * input_N, data_t * input_E, | |||||||
|                                            hash_len, hash_result, |                                            hash_len, hash_result, | ||||||
|                                            result_str->x ) == result_simple ); |                                            result_str->x ) == result_simple ); | ||||||
| 
 | 
 | ||||||
|     TEST_ASSERT( mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, NULL, MBEDTLS_RSA_PUBLIC, |     TEST_ASSERT( mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, MBEDTLS_RSA_PUBLIC, | ||||||
|                                         msg_digest_id, hash_len, hash_result, |                                         msg_digest_id, hash_len, hash_result, | ||||||
|                                         mgf_hash, salt_len, |                                         mgf_hash, salt_len, | ||||||
|                                         result_str->x ) == result_full ); |                                         result_str->x ) == result_full ); | ||||||
|  | |||||||
| @ -333,26 +333,26 @@ 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_pss_verify_ext( NULL, NULL, NULL, |                             mbedtls_rsa_rsassa_pss_verify_ext( NULL, NULL, | ||||||
|                                                                MBEDTLS_RSA_PUBLIC, |                                                                MBEDTLS_RSA_PUBLIC, | ||||||
|                                                                0, sizeof( buf ), |                                                                0, sizeof( buf ), | ||||||
|                                                                buf, |                                                                buf, | ||||||
|                                                                0, 0, |                                                                0, 0, | ||||||
|                                                                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_pss_verify_ext( &ctx, NULL, NULL, |                             mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, | ||||||
|                                                                MBEDTLS_RSA_PUBLIC, |                                                                MBEDTLS_RSA_PUBLIC, | ||||||
|                                                                0, sizeof( buf ), |                                                                0, sizeof( buf ), | ||||||
|                                                                NULL, 0, 0, |                                                                NULL, 0, 0, | ||||||
|                                                                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_pss_verify_ext( &ctx, NULL, NULL, |                             mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, | ||||||
|                                                                MBEDTLS_RSA_PUBLIC, |                                                                MBEDTLS_RSA_PUBLIC, | ||||||
|                                                                0, sizeof( buf ), |                                                                0, sizeof( buf ), | ||||||
|                                                                buf, 0, 0, |                                                                buf, 0, 0, | ||||||
|                                                                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_pss_verify_ext( &ctx, NULL, NULL, |                             mbedtls_rsa_rsassa_pss_verify_ext( &ctx, NULL, | ||||||
|                                                                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
	 Thomas Daubney
						Thomas Daubney