Fixed unitialized n when resuming a session

This commit is contained in:
Paul Bakker 2013-08-15 11:40:48 +02:00
parent 936539ad4b
commit f0e39acb58

View File

@ -1484,7 +1484,7 @@ static int ssl_write_server_hello( ssl_context *ssl )
} }
else else
{ {
ssl->session_negotiate->length = 0; ssl->session_negotiate->length = n = 0;
memset( ssl->session_negotiate->id, 0, 32 ); memset( ssl->session_negotiate->id, 0, 32 );
} }
#else #else
@ -1499,6 +1499,7 @@ static int ssl_write_server_hello( ssl_context *ssl )
/* /*
* Resuming a session * Resuming a session
*/ */
n = ssl->session_negotiate->length;
ssl->state = SSL_SERVER_CHANGE_CIPHER_SPEC; ssl->state = SSL_SERVER_CHANGE_CIPHER_SPEC;
if( ( ret = ssl_derive_keys( ssl ) ) != 0 ) if( ( ret = ssl_derive_keys( ssl ) ) != 0 )