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-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c1f4cd7b4726f58a5a764b66b67edea87371d7a;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) (cherry picked from commit 105c5807ce34144b123dbaf939301fa13a6918bc) --- diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 05285b9690e..9114398095a 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -2839,7 +2839,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)) { @@ -2850,7 +2852,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 41a2e8901b7..a2be3481ef8 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -4192,7 +4192,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); @@ -4239,7 +4241,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,