mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-02-24 02:26:47 +00:00
Introduce ticket field in session structure
This commit is contained in:
parent
5f280cc6cf
commit
75d440192c
|
@ -338,6 +338,9 @@ struct _ssl_session
|
|||
x509_cert *peer_cert; /*!< peer X.509 cert chain */
|
||||
#endif /* POLARSSL_X509_PARSE_C */
|
||||
|
||||
unsigned char *ticket; /*!< RFC 5077 session ticket */
|
||||
size_t ticket_len; /*!< session ticket length */
|
||||
|
||||
unsigned char mfl_code; /*!< MaxFragmentLength negotiated by peer */
|
||||
int trunc_hmac; /*!< flag for truncated hmac activation */
|
||||
};
|
||||
|
|
|
@ -3258,6 +3258,14 @@ int ssl_get_session( const ssl_context *ssl, ssl_session *dst )
|
|||
}
|
||||
#endif /* POLARSSL_X509_PARSE_C */
|
||||
|
||||
if( src->ticket != NULL )
|
||||
{
|
||||
if( ( dst->ticket = polarssl_malloc( src->ticket_len ) ) == NULL )
|
||||
return( POLARSSL_ERR_SSL_MALLOC_FAILED );
|
||||
|
||||
memcpy( dst->ticket, src->ticket, src->ticket_len );
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
@ -3579,6 +3587,8 @@ void ssl_session_free( ssl_session *session )
|
|||
}
|
||||
#endif
|
||||
|
||||
polarssl_free( session->ticket );
|
||||
|
||||
memset( session, 0, sizeof( ssl_session ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue