Allow compiling without RSA or DH
Only library and programs now, need to check test suites later.
diff --git a/library/x509parse.c b/library/x509parse.c
index 9f90b5a..132d285 100644
--- a/library/x509parse.c
+++ b/library/x509parse.c
@@ -3937,7 +3937,7 @@
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 @@
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 @@
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 @@
x509_free( &cacert );
x509_free( &clicert );
- rsa_free( &rsa );
+ pk_free( &pkey );
#if defined(POLARSSL_DHM_C)
dhm_free( &dhm );
#endif