Skip to content

tls 1.3: respect advertised psk_key_exchange modes for tickets and PSKs - #11137

Open
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:gh-11087
Open

tls 1.3: respect advertised psk_key_exchange modes for tickets and PSKs#11137
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:gh-11087

Conversation

@gasbytes

Copy link
Copy Markdown
Contributor

Description

A wolfSSL server ignored the client's advertised psk_key_exchange_modes when issuing a NewSessionTicket, handing out tickets it would never accept , and then aborted the resuption attempt with PSK_KEY_ERROR instead of falling back to a full handshake.
This skips tickets no advertised mode can use (as mentioned in RFC 8446, around section 4.2.9) and declines unusuable PSKs rather than failing the connection (section 4.2.11).

Fixes #11087.

Testing

Added two regression tests: test_tls13_psk_mode_no_incompatible_ticket test_tls13_psk_mode_incompatible_falls_back. The first one asserts no ticket is sent to a psk_ke-only client when the server requires psk_dhe_ke, with a compatible-client control that still gets one.
The second offers a valid ticket under that same mode mismatch and asserts the handshake completes unresumed instead of aborting.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@gasbytes gasbytes self-assigned this Aug 11, 2026
Copilot AI lite review requested due to automatic review settings August 11, 2026 11:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a TLS 1.3 interoperability/standards issue where the server could (a) issue NewSessionTicket messages that cannot be resumed under the client’s advertised psk_key_exchange_modes, and (b) abort resumption with PSK_KEY_ERROR instead of declining an unusable PSK and continuing with a full handshake, aligning behavior with RFC 8446 (Sections 4.2.9 and 4.2.11).

Changes:

  • Adds a TLS 1.3 helper to evaluate whether any client-advertised PSK key exchange mode is usable and uses it to (1) ignore offered PSKs when no advertised mode is usable and (2) skip sending NewSessionTicket in that case.
  • Adds two regression tests covering ticket suppression for incompatible modes and fallback-to-full-handshake behavior when an incompatible ticket is offered.
  • Registers the new tests in the TLS 1.3 API test header.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/api/test_tls13.h Declares and registers two new TLS 1.3 regression tests.
tests/api/test_tls13.c Implements regression tests for mode-incompatible tickets and resumption fallback.
src/tls13.c Adds PskKeyModesUsable() and uses it to skip unusable tickets and ignore unusable PSKs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tls13.c
Comment thread src/tls13.c Outdated
@gasbytes
gasbytes marked this pull request as ready for review August 11, 2026 13:08
@github-actions

Copy link
Copy Markdown

retest this please

@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m4-pq

  • FLASH: .text +192 B (+0.1%, 297,500 B / 1,048,576 B, total: 28% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +128 B (+0.0%, 327,984 B / 1,048,576 B, total: 31% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +256 B (+0.1%, 238,305 B / 262,144 B, total: 91% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +192 B (+0.1%, 298,460 B / 1,048,576 B, total: 28% used)

gcc-arm-cortex-m7-tls13

@gasbytes gasbytes assigned rizlik and julek-wolfssl and unassigned gasbytes Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mismatch mismatch in sending tickets incompatible with advertised PSK modes

4 participants