Ensure RSA test suite calls rsa_private with PRNG

This commit is contained in:
Hanno Becker 2017-11-06 15:10:23 +00:00
parent 21f83753f5
commit e2ccaddf0a

View File

@ -43,7 +43,8 @@ int mbedtls_rsa_decrypt_func( void *ctx, int mode, size_t *olen,
const unsigned char *input, unsigned char *output, const unsigned char *input, unsigned char *output,
size_t output_max_len ) size_t output_max_len )
{ {
return( mbedtls_rsa_pkcs1_decrypt( (mbedtls_rsa_context *) ctx, NULL, NULL, mode, olen, return( mbedtls_rsa_pkcs1_decrypt( (mbedtls_rsa_context *) ctx,
rnd_std_rand, NULL, mode, olen,
input, output, output_max_len ) ); input, output, output_max_len ) );
} }
int mbedtls_rsa_sign_func( void *ctx, int mbedtls_rsa_sign_func( void *ctx,
@ -51,7 +52,9 @@ int mbedtls_rsa_sign_func( void *ctx,
int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, int mode, mbedtls_md_type_t md_alg, unsigned int hashlen,
const unsigned char *hash, unsigned char *sig ) const unsigned char *hash, unsigned char *sig )
{ {
return( mbedtls_rsa_pkcs1_sign( (mbedtls_rsa_context *) ctx, f_rng, p_rng, mode, ((void) f_rng);
((void) p_rng);
return( mbedtls_rsa_pkcs1_sign( (mbedtls_rsa_context *) ctx, rnd_std_rand, NULL, mode,
md_alg, hashlen, hash, sig ) ); md_alg, hashlen, hash, sig ) );
} }
size_t mbedtls_rsa_key_len_func( void *ctx ) size_t mbedtls_rsa_key_len_func( void *ctx )