Adapt ssl_set_own_cert() to generic keys
diff --git a/programs/ssl/ssl_fork_server.c b/programs/ssl/ssl_fork_server.c
index 986458b..98a518c 100644
--- a/programs/ssl/ssl_fork_server.c
+++ b/programs/ssl/ssl_fork_server.c
@@ -104,7 +104,7 @@
ctr_drbg_context ctr_drbg;
ssl_context ssl;
x509_cert srvcert;
- rsa_context rsa;
+ pk_context pkey;
((void) argc);
((void) argv);
@@ -139,7 +139,7 @@
/*
* This demonstration program uses embedded test certificates.
* Instead, you may want to use x509parse_crtfile() to read the
- * server and CA certificates, as well as x509parse_keyfile_rsa().
+ * server and CA certificates, as well as x509parse_keyfile().
*/
ret = x509parse_crt( &srvcert, (const unsigned char *) test_srv_crt,
strlen( test_srv_crt ) );
@@ -157,12 +157,12 @@
goto exit;
}
- rsa_init( &rsa, RSA_PKCS_V15, 0 );
- ret = x509parse_key_rsa( &rsa, (const unsigned char *) test_srv_key,
+ pk_init( &pkey );
+ ret = x509parse_key( &pkey, (const unsigned char *) test_srv_key,
strlen( test_srv_key ), NULL, 0 );
if( ret != 0 )
{
- printf( " failed\n ! x509parse_key_rsa returned %d\n\n", ret );
+ printf( " failed\n ! x509parse_key returned %d\n\n", ret );
goto exit;
}
@@ -265,7 +265,7 @@
net_send, &client_fd );
ssl_set_ca_chain( &ssl, srvcert.next, NULL, NULL );
- ssl_set_own_cert( &ssl, &srvcert, &rsa );
+ ssl_set_own_cert( &ssl, &srvcert, &pkey );
/*
* 5. Handshake
@@ -363,7 +363,7 @@
net_close( client_fd );
x509_free( &srvcert );
- rsa_free( &rsa );
+ pk_free( &pkey );
ssl_free( &ssl );
#if defined(_WIN32)