mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Session ticket expiration checked on server
This commit is contained in:
@ -288,6 +288,16 @@ static int ssl_parse_ticket( ssl_context *ssl,
|
||||
return( ret );
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_HAVE_TIME)
|
||||
/* Check if still valid */
|
||||
if( (int) ( time( NULL) - session.start ) > ssl->ticket_lifetime )
|
||||
{
|
||||
SSL_DEBUG_MSG( 1, ( "session ticket expired" ) );
|
||||
memset( &session, 0, sizeof( ssl_session ) );
|
||||
return( POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED );
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Keep the session ID sent by the client, since we MUST send it back to
|
||||
* inform him we're accepting the ticket (RFC 5077 section 3.4)
|
||||
|
Reference in New Issue
Block a user