Skip to content

Commit f3e183a

Browse files
committed
fenrir: address review feedback on PR 10230
- tls.c: TLSX_CertWithExternPsk_GetSize takes word16*, but length was widened to word32 in TLSX_GetSize. Use the hsz staging variable like the other cases so WOLFSSL_CERT_WITH_EXTERN_PSK builds compile. - tls.c: silence -Wunused-variable for hsz in builds where every case that consumes it (TLS 1.3, PSK, ETM, early data, PHA, cookie, cert with extern PSK) is compiled out, e.g. user_settings_tls12.h. - test_tls_ext.c: assert session->ticketLen > 0 before mutating ticketAdd in the ticket-age out-of-window test so it fails loudly if no NewSessionTicket was received.
1 parent ff60134 commit f3e183a

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/tls.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14930,6 +14930,8 @@ static int TLSX_GetSize(TLSX* list, byte* semaphore, byte msgType,
1493014930
msgType == certificate_request);
1493114931
(void)cbShim;
1493214932

14933+
(void)hsz;
14934+
1493314935
while ((extension = list)) {
1493414936
list = extension->next;
1493514937

tests/api/test_tls_ext.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ int test_tls13_ticket_age_out_of_window(void)
439439
(void)wolfSSL_read(ssl_c, &tmp, sizeof(tmp));
440440

441441
ExpectNotNull(session = wolfSSL_get1_session(ssl_c));
442+
/* The test only exercises the age window check if the client actually
443+
* received a NewSessionTicket and the session carries ticket material. */
444+
ExpectIntGT(session->ticketLen, 0);
442445

443446
/* Flip the high bit to push the unobfuscated age out of window. */
444447
if (session != NULL)

0 commit comments

Comments
 (0)