Skip to content

Commit bc574f7

Browse files
committed
dtls13: WOLFSSL_DTLS13_5_9_0_COMPAT -> WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID
1 parent 87f8078 commit bc574f7

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

.wolfssl_known_macro_extras

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ WOLFSSL_DRBG_SHA256
744744
WOLFSSL_DTLS_DISALLOW_FUTURE
745745
WOLFSSL_DTLS_RECORDS_CAN_SPAN_DATAGRAMS
746746
WOLFSSL_DTLS_RESEND_ONLY_TIMEOUT
747-
WOLFSSL_DTLS13_5_9_0_COMPAT
747+
WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID
748748
WOLFSSL_DUMP_MEMIO_STREAM
749749
WOLFSSL_DUP_CERTPOL
750750
WOLFSSL_EARLY_DATA_NO_ANTI_REPLAY

src/dtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ static int SendStatelessReplyDtls13(const WOLFSSL* ssl, WolfSSL_CH* ch)
860860
nonConstSSL->options.tls1_1 = 1;
861861
nonConstSSL->options.tls1_3 = 1;
862862

863-
#ifdef WOLFSSL_DTLS13_5_9_0_COMPAT
863+
#ifdef WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID
864864
nonConstSSL->session->sessionIDSz = (byte)ch->sessionId.size;
865865
if (ch->sessionId.size > 0)
866866
XMEMCPY(nonConstSSL->session->sessionID, ch->sessionId.elements,

src/tls13.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5776,7 +5776,7 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
57765776
/* RFC 9147 Section 5.3 / RFC 9001 Section 8.4: DTLS 1.3 and QUIC
57775777
* ServerHello must have empty legacy_session_id_echo. */
57785778
int requireEmptyEcho = 1;
5779-
#ifdef WOLFSSL_DTLS13_5_9_0_COMPAT
5779+
#ifdef WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID
57805780
/* Compat: a wolfSSL <= 5.9.0 DTLS 1.3 server echoes the client's
57815781
* legacy_session_id; accept any echo. */
57825782
if (ssl->options.dtls)
@@ -6980,7 +6980,7 @@ static int RestartHandshakeHashWithCookie(WOLFSSL* ssl, Cookie* cookie)
69806980

69816981
/* Reconstruct the HelloRetryMessage for handshake hash. */
69826982
sessIdSz = ssl->session->sessionIDSz;
6983-
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_5_9_0_COMPAT)
6983+
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID)
69846984
/* RFC 9147 Section 5.3: DTLS 1.3 must use empty legacy_session_id. */
69856985
if (ssl->options.dtls)
69866986
sessIdSz = 0;
@@ -7460,7 +7460,7 @@ int DoTls13ClientHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
74607460
if (sessIdSz + args->idx > helloSz)
74617461
ERROR_OUT(BUFFER_ERROR, exit_dch);
74627462

7463-
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_5_9_0_COMPAT)
7463+
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID)
74647464
/* RFC 9147 Section 5.3: DTLS 1.3 ServerHello must have empty
74657465
* legacy_session_id_echo. Don't store the client's value so it
74667466
* won't be echoed in SendTls13ServerHello. */
@@ -8065,7 +8065,7 @@ int SendTls13ServerHello(WOLFSSL* ssl, byte extMsgType)
80658065
WOLFSSL_BUFFER(ssl->arrays->serverRandom, RAN_LEN);
80668066
#endif
80678067

8068-
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_5_9_0_COMPAT)
8068+
#if defined(WOLFSSL_DTLS13) && !defined(WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID)
80698069
if (ssl->options.dtls) {
80708070
/* RFC 9147 Section 5.3: DTLS 1.3 ServerHello must have empty
80718071
* legacy_session_id_echo. */

tests/api/test_dtls.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,7 +2956,7 @@ int test_dtls13_no_session_id_echo(void)
29562956
EXPECT_DECLS;
29572957
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_DTLS13) && \
29582958
defined(HAVE_SESSION_TICKET) && defined(HAVE_ECC) && \
2959-
!defined(WOLFSSL_DTLS13_5_9_0_COMPAT)
2959+
!defined(WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID)
29602960
struct test_memio_ctx test_ctx;
29612961
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;
29622962
WOLFSSL *ssl_c = NULL, *ssl_s = NULL;
@@ -3032,14 +3032,14 @@ int test_dtls13_no_session_id_echo(void)
30323032
return EXPECT_RESULT();
30333033
}
30343034

3035-
/* Test that a server built with WOLFSSL_DTLS13_5_9_0_COMPAT echoes the
3035+
/* Test that a server built with WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID echoes the
30363036
* client's legacy_session_id in both the direct ServerHello path and the
30373037
* stateless HRR path (which also exercises RestartHandshakeHashWithCookie). */
30383038
int test_dtls13_5_9_0_compat(void)
30393039
{
30403040
EXPECT_DECLS;
30413041
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_DTLS13) && \
3042-
defined(HAVE_SESSION_TICKET) && defined(WOLFSSL_DTLS13_5_9_0_COMPAT) && \
3042+
defined(HAVE_SESSION_TICKET) && defined(WOLFSSL_DTLS13_ECHO_LEGACY_SESSION_ID) && \
30433043
defined(HAVE_ECC)
30443044
struct test_memio_ctx test_ctx;
30453045
WOLFSSL_CTX *ctx_c = NULL, *ctx_s = NULL;

0 commit comments

Comments
 (0)