mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-02-19 00:39:46 +00:00
Refactored RSA to have random generator in every RSA operation
Primarily so that rsa_private() receives an RNG for blinding purposes.
This commit is contained in:
@@ -197,7 +197,7 @@ int main( int argc, char *argv[] )
|
||||
printf( " . Generating the RSA decrypted value for OpenSSL (PUBLIC) with PolarSSL (PRIVATE) ..." );
|
||||
fflush( stdout );
|
||||
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, RSA_PRIVATE, &olen, o_pub_encrypted, p_pub_decrypted, 1024 ) ) != 0 )
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, ctr_drbg_random, &ctr_drbg, RSA_PRIVATE, &olen, o_pub_encrypted, p_pub_decrypted, 1024 ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! rsa_pkcs1_decrypt returned %d\n\n", ret );
|
||||
}
|
||||
@@ -221,7 +221,7 @@ int main( int argc, char *argv[] )
|
||||
printf( " . Generating the RSA decrypted value for OpenSSL (PRIVATE) with PolarSSL (PUBLIC) ..." );
|
||||
fflush( stdout );
|
||||
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, RSA_PUBLIC, &olen, o_priv_encrypted, p_priv_decrypted, 1024 ) ) != 0 )
|
||||
if( ( ret = rsa_pkcs1_decrypt( &p_rsa, NULL, NULL, RSA_PUBLIC, &olen, o_priv_encrypted, p_priv_decrypted, 1024 ) ) != 0 )
|
||||
{
|
||||
printf( " failed\n ! rsa_pkcs1_decrypt returned %d\n\n", ret );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user