1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Merge pull request #8858 from waleed-elmelegy-arm/add_alpn_to_session

Add ALPN information in session tickets
This commit is contained in:
Ronald Cron
2024-03-15 09:50:24 +00:00
committed by GitHub
6 changed files with 155 additions and 8 deletions

View File

@ -467,7 +467,14 @@ static int ssl_tls13_session_copy_ticket(mbedtls_ssl_session *dst,
#if defined(MBEDTLS_SSL_EARLY_DATA)
dst->max_early_data_size = src->max_early_data_size;
#endif
#if defined(MBEDTLS_SSL_ALPN)
int ret = mbedtls_ssl_session_set_ticket_alpn(dst, src->ticket_alpn);
if (ret != 0) {
return ret;
}
#endif /* MBEDTLS_SSL_ALPN */
#endif /* MBEDTLS_SSL_EARLY_DATA*/
return 0;
}
@ -3137,6 +3144,15 @@ static int ssl_tls13_prepare_new_session_ticket(mbedtls_ssl_context *ssl,
MBEDTLS_SSL_PRINT_TICKET_FLAGS(4, session->ticket_flags);
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_ALPN)
if (session->ticket_alpn == NULL) {
ret = mbedtls_ssl_session_set_ticket_alpn(session, ssl->alpn_chosen);
if (ret != 0) {
return ret;
}
}
#endif
/* Generate ticket_age_add */
if ((ret = ssl->conf->f_rng(ssl->conf->p_rng,
(unsigned char *) &session->ticket_age_add,