Fix bug with NewSessionTicket and non-blocking I/O

This commit is contained in:
Manuel Pégourié-Gonnard 2014-02-26 14:23:33 +01:00
parent 5575316385
commit 145dfcbfc2
2 changed files with 8 additions and 3 deletions

View File

@ -36,6 +36,8 @@ Bugfix
* Fixed bug in ssl_cache: when max_entries = 0 and TIMING_C is enabled, * Fixed bug in ssl_cache: when max_entries = 0 and TIMING_C is enabled,
entries would still be created. entries would still be created.
* Fixed bug in m_sleep: whould sleep twice too long on most Unix platforms. * Fixed bug in m_sleep: whould sleep twice too long on most Unix platforms.
* Fixed bug with session tickets and non-blocking I/O in the unlikely case
send() would return an EAGAIN error when sending the ticket.
= PolarSSL 1.3.4 released on 2014-01-27 = PolarSSL 1.3.4 released on 2014-01-27
Features Features

View File

@ -3003,15 +3003,18 @@ static int ssl_write_new_session_ticket( ssl_context *ssl )
ssl->out_msglen = 10 + tlen; ssl->out_msglen = 10 + tlen;
/*
* Morally equivalent to updating ssl->state, but NewSessionTicket and
* ChangeCipherSpec share the same state.
*/
ssl->handshake->new_session_ticket = 0;
if( ( ret = ssl_write_record( ssl ) ) != 0 ) if( ( ret = ssl_write_record( ssl ) ) != 0 )
{ {
SSL_DEBUG_RET( 1, "ssl_write_record", ret ); SSL_DEBUG_RET( 1, "ssl_write_record", ret );
return( ret ); return( ret );
} }
/* No need to remember writing a NewSessionTicket any more */
ssl->handshake->new_session_ticket = 0;
SSL_DEBUG_MSG( 2, ( "<= write new session ticket" ) ); SSL_DEBUG_MSG( 2, ( "<= write new session ticket" ) );
return( 0 ); return( 0 );