From e5e1bb972cc8b4f316b3eff12e9e18ae88a36262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 30 Oct 2013 11:25:30 +0100 Subject: [PATCH] Fix misplaced initialisation --- library/ssl_tls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index e636f9d31c..6dd5cc0aca 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -3277,6 +3277,10 @@ static int ssl_handshake_init( ssl_context *ssl ) ecdh_init( &ssl->handshake->ecdh_ctx ); #endif +#if defined(POLARSSL_X509_CRT_PARSE_C) + ssl->handshake->key_cert = ssl->key_cert; +#endif + return( 0 ); } @@ -3951,10 +3955,6 @@ int ssl_handshake( ssl_context *ssl ) SSL_DEBUG_MSG( 2, ( "=> handshake" ) ); -#if defined(POLARSSL_X509_CRT_PARSE_C) - ssl->handshake->key_cert = ssl->key_cert; -#endif - while( ssl->state != SSL_HANDSHAKE_OVER ) { ret = ssl_handshake_step( ssl );