1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

- Added initialization for RSA where needed

This commit is contained in:
Paul Bakker
2010-07-18 09:00:25 +00:00
parent b924f0494a
commit 545570e208
2 changed files with 27 additions and 11 deletions

View File

@ -701,6 +701,14 @@ void rsa_free( rsa_context *ctx )
#define RSA_PT "\xAA\xBB\xCC\x03\x02\x01\x00\xFF\xFF\xFF\xFF\xFF" \
"\x11\x22\x33\x0A\x0B\x0C\xCC\xDD\xDD\xDD\xDD\xDD"
static int myrand( void *rng_state )
{
if( rng_state != NULL )
rng_state = NULL;
return( rand() );
}
/*
* Checkup routine
*/
@ -713,7 +721,7 @@ int rsa_self_test( int verbose )
unsigned char rsa_decrypted[PT_LEN];
unsigned char rsa_ciphertext[KEY_LEN];
memset( &rsa, 0, sizeof( rsa_context ) );
rsa_init( &rsa, RSA_PKCS_V15, 0, &myrand, NULL );
rsa.len = KEY_LEN;
mpi_read_string( &rsa.N , 16, RSA_N );