From 2d6599284f0b2b9414dca3fbf04a33ee89f6ffa7 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Thu, 11 Aug 2016 10:45:33 +0100 Subject: [PATCH] Do not add empty cert / key in cert_app --- programs/x509/cert_app.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/programs/x509/cert_app.c b/programs/x509/cert_app.c index c6434fe1f..73e853e97 100644 --- a/programs/x509/cert_app.c +++ b/programs/x509/cert_app.c @@ -153,9 +153,7 @@ int main( int argc, char *argv[] ) mbedtls_ssl_context ssl; mbedtls_ssl_config conf; mbedtls_x509_crt cacert; - mbedtls_x509_crt clicert; mbedtls_x509_crl cacrl; - mbedtls_pk_context pkey; int i, j; uint32_t flags; int verify = 0; @@ -170,7 +168,6 @@ int main( int argc, char *argv[] ) mbedtls_ssl_init( &ssl ); mbedtls_ssl_config_init( &conf ); mbedtls_x509_crt_init( &cacert ); - mbedtls_x509_crt_init( &clicert ); #if defined(MBEDTLS_X509_CRL_PARSE_C) mbedtls_x509_crl_init( &cacrl ); #else @@ -178,7 +175,6 @@ int main( int argc, char *argv[] ) it to the verify function */ memset( &cacrl, 0, sizeof(mbedtls_x509_crl) ); #endif - mbedtls_pk_init( &pkey ); if( argc == 0 ) { @@ -423,12 +419,6 @@ int main( int argc, char *argv[] ) mbedtls_ssl_conf_rng( &conf, mbedtls_ctr_drbg_random, &ctr_drbg ); mbedtls_ssl_conf_dbg( &conf, my_debug, stdout ); - if( ( ret = mbedtls_ssl_conf_own_cert( &conf, &clicert, &pkey ) ) != 0 ) - { - mbedtls_printf( " failed\n ! mbedtls_ssl_conf_own_cert returned %d\n\n", ret ); - goto ssl_exit; - } - if( ( ret = mbedtls_ssl_setup( &ssl, &conf ) ) != 0 ) { mbedtls_printf( " failed\n ! mbedtls_ssl_setup returned %d\n\n", ret ); @@ -484,11 +474,9 @@ exit: mbedtls_net_free( &server_fd ); mbedtls_x509_crt_free( &cacert ); - mbedtls_x509_crt_free( &clicert ); #if defined(MBEDTLS_X509_CRL_PARSE_C) mbedtls_x509_crl_free( &cacrl ); #endif - mbedtls_pk_free( &pkey ); mbedtls_ctr_drbg_free( &ctr_drbg ); mbedtls_entropy_free( &entropy );