Fix server-initiated renego with non-blocking I/O

This commit is contained in:
Manuel Pégourié-Gonnard 2014-08-15 19:04:47 +02:00
parent a8c0a0dbd0
commit f07f421759
3 changed files with 34 additions and 2 deletions
library

View file

@ -4167,8 +4167,6 @@ static int ssl_write_hello_request( ssl_context *ssl )
return( ret );
}
ssl->renegotiation = SSL_RENEGOTIATION_PENDING;
SSL_DEBUG_MSG( 2, ( "<= write hello request" ) );
return( 0 );
@ -4222,6 +4220,12 @@ int ssl_renegotiate( ssl_context *ssl )
if( ssl->state != SSL_HANDSHAKE_OVER )
return( POLARSSL_ERR_SSL_BAD_INPUT_DATA );
ssl->renegotiation = SSL_RENEGOTIATION_PENDING;
/* Did we already try/start sending HelloRequest? */
if( ssl->out_left != 0 )
return( ssl_flush_output( ssl ) );
return( ssl_write_hello_request( ssl ) );
}
#endif /* POLARSSL_SSL_SRV_C */