ssl_key_cert not available in all configurations

This commit is contained in:
Paul Bakker 2014-07-09 11:09:24 +02:00
parent ec3a617d40
commit 968afaa06f

View file

@ -3270,8 +3270,7 @@ int ssl_parse_finished( ssl_context *ssl )
return( 0 );
}
static void ssl_handshake_params_init( ssl_handshake_params *handshake,
ssl_key_cert *key_cert )
static void ssl_handshake_params_init( ssl_handshake_params *handshake )
{
memset( handshake, 0, sizeof( ssl_handshake_params ) );
@ -3302,10 +3301,6 @@ static void ssl_handshake_params_init( ssl_handshake_params *handshake,
#if defined(POLARSSL_ECDH_C)
ecdh_init( &handshake->ecdh_ctx );
#endif
#if defined(POLARSSL_X509_CRT_PARSE_C)
handshake->key_cert = key_cert;
#endif
}
static void ssl_transform_init( ssl_transform *transform )
@ -3377,7 +3372,11 @@ static int ssl_handshake_init( ssl_context *ssl )
/* Initialize structures */
ssl_session_init( ssl->session_negotiate );
ssl_transform_init( ssl->transform_negotiate );
ssl_handshake_params_init( ssl->handshake, ssl->key_cert );
ssl_handshake_params_init( ssl->handshake );
#if defined(POLARSSL_X509_CRT_PARSE_C)
ssl->handshake->key_cert = ssl->key_cert;
#endif
return( 0 );
}