From f484282e965a94c79ae0b05b8a33a282d9176ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 22 Aug 2013 16:03:41 +0200 Subject: [PATCH] Rm a few unneeded tests --- library/ssl_cli.c | 5 ++--- library/ssl_srv.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 08d3bda37..79bba4242 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -1449,8 +1449,7 @@ static int ssl_parse_server_key_exchange( ssl_context *ssl ) /* * Verify signature */ - if( pk_alg != POLARSSL_PK_NONE && - ! pk_can_do( &ssl->session_negotiate->peer_cert->pk, pk_alg ) ) + if( ! pk_can_do( &ssl->session_negotiate->peer_cert->pk, pk_alg ) ) { SSL_DEBUG_MSG( 1, ( "bad server key exchange message" ) ); return( POLARSSL_ERR_SSL_PK_TYPE_MISMATCH ); @@ -1939,7 +1938,7 @@ static int ssl_write_certificate_verify( ssl_context *ssl ) return( 0 ); } - if( ssl->pk_key == NULL || ssl->pk_key->pk_info == NULL ) + if( ssl->pk_key == NULL ) { SSL_DEBUG_MSG( 1, ( "got no private key" ) ); return( POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED ); diff --git a/library/ssl_srv.c b/library/ssl_srv.c index c0808656f..ff914e552 100644 --- a/library/ssl_srv.c +++ b/library/ssl_srv.c @@ -2029,7 +2029,7 @@ static int ssl_write_server_key_exchange( ssl_context *ssl ) /* * Make the signature */ - if( ssl->pk_key == NULL || ssl->pk_key->pk_info == NULL ) + if( ssl->pk_key == NULL ) { SSL_DEBUG_MSG( 1, ( "got no private key" ) ); return( POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED );