Allow compiling without RSA or DH
Only library and programs now, need to check test suites later.
This commit is contained in:
parent
ee98f8e7a3
commit
e511ffca50
5 changed files with 24 additions and 14 deletions
|
@ -3937,7 +3937,7 @@ int x509_self_test( int verbose )
|
|||
size_t i, j;
|
||||
x509_cert cacert;
|
||||
x509_cert clicert;
|
||||
rsa_context rsa;
|
||||
pk_context pkey;
|
||||
#if defined(POLARSSL_DHM_C)
|
||||
dhm_context dhm;
|
||||
#endif
|
||||
|
@ -3975,9 +3975,9 @@ int x509_self_test( int verbose )
|
|||
i = strlen( test_ca_key );
|
||||
j = strlen( test_ca_pwd );
|
||||
|
||||
rsa_init( &rsa, RSA_PKCS_V15, 0 );
|
||||
pk_init( &pkey );
|
||||
|
||||
if( ( ret = x509parse_key_rsa( &rsa,
|
||||
if( ( ret = x509parse_key( &pkey,
|
||||
(const unsigned char *) test_ca_key, i,
|
||||
(const unsigned char *) test_ca_pwd, j ) ) != 0 )
|
||||
{
|
||||
|
@ -3990,12 +3990,14 @@ int x509_self_test( int verbose )
|
|||
if( verbose != 0 )
|
||||
printf( "passed\n X.509 signature verify: ");
|
||||
|
||||
ret = x509parse_verify( &clicert, &cacert, NULL, "PolarSSL Client 2", &flags, NULL, NULL );
|
||||
ret = x509parse_verify( &clicert, &cacert, NULL, NULL, &flags, NULL, NULL );
|
||||
if( ret != 0 )
|
||||
{
|
||||
if( verbose != 0 )
|
||||
printf( "failed\n" );
|
||||
|
||||
printf("ret = %d, &flags = %04x\n", ret, flags);
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
||||
|
@ -4020,7 +4022,7 @@ int x509_self_test( int verbose )
|
|||
|
||||
x509_free( &cacert );
|
||||
x509_free( &clicert );
|
||||
rsa_free( &rsa );
|
||||
pk_free( &pkey );
|
||||
#if defined(POLARSSL_DHM_C)
|
||||
dhm_free( &dhm );
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue