From: Angel Baez Date: Wed, 12 Nov 2025 12:46:28 +0000 (-0500) Subject: TLS 1.3 session resumption convert nonce_label to ASCII hex X-Git-Tag: 4.0-PRE-CLANG-FORMAT-WEBKIT~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=105c5807ce34144b123dbaf939301fa13a6918bc;p=thirdparty%2Fopenssl.git TLS 1.3 session resumption convert nonce_label to ASCII hex Fixes #27815 CLA: trivial Reviewed-by: Bernd Edlinger Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/29127) --- diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index a968becdfc9..5639048a8e6 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -2864,7 +2864,9 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s, const EVP_MD *md = ssl_handshake_md(s); int hashleni = EVP_MD_get_size(md); size_t hashlen; - static const unsigned char nonce_label[] = "resumption"; + /* ASCII: "resumption", in hex for EBCDIC compatibility */ + static const unsigned char nonce_label[] = { 0x72, 0x65, 0x73, 0x75, 0x6D, + 0x70, 0x74, 0x69, 0x6F, 0x6E }; /* Ensure cast to size_t is safe */ if (!ossl_assert(hashleni > 0)) { @@ -2875,7 +2877,7 @@ MSG_PROCESS_RETURN tls_process_new_session_ticket(SSL_CONNECTION *s, if (!tls13_hkdf_expand(s, md, s->resumption_master_secret, nonce_label, - sizeof(nonce_label) - 1, + sizeof(nonce_label), PACKET_data(&nonce), PACKET_remaining(&nonce), s->session->master_key, diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 4582a70ba96..5b6465bc239 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -4202,7 +4202,9 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt if (SSL_CONNECTION_IS_TLS13(s)) { size_t i, hashlen; uint64_t nonce; - static const unsigned char nonce_label[] = "resumption"; + /* ASCII: "resumption", in hex for EBCDIC compatibility */ + static const unsigned char nonce_label[] = { 0x72, 0x65, 0x73, 0x75, 0x6D, + 0x70, 0x74, 0x69, 0x6F, 0x6E }; const EVP_MD *md = ssl_handshake_md(s); int hashleni = EVP_MD_get_size(md); @@ -4249,7 +4251,7 @@ CON_FUNC_RETURN tls_construct_new_session_ticket(SSL_CONNECTION *s, WPACKET *pkt if (!tls13_hkdf_expand(s, md, s->resumption_master_secret, nonce_label, - sizeof(nonce_label) - 1, + sizeof(nonce_label), tick_nonce, TICKET_NONCE_SIZE, s->session->master_key,