Skip to content

Fix a few TLS compliance issues - #10594

Open
kareem-wolfssl wants to merge 11 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd21873
Open

Fix a few TLS compliance issues#10594
kareem-wolfssl wants to merge 11 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd21873

Conversation

@kareem-wolfssl

@kareem-wolfssl kareem-wolfssl commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

Partially fixes zd#21873

Testing

Built in tests

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this Jun 4, 2026
Copilot AI review requested due to automatic review settings June 4, 2026 00:41

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 tightens TLS compliance-related behavior in the core handshake and exporter paths, primarily by enforcing correct timing/validity constraints for keying material export and session ticket usage.

Changes:

  • Refuse wolfSSL_export_keying_material() calls until the handshake has fully completed (per RFC 8446 / RFC 5705 intent).
  • Suppress use of expired stored session tickets (fall back to full handshake instead of attempting resumption).
  • Map BUFFER_E to decode_error in TranslateErrorToAlert().

Reviewed changes

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

File Description
src/ssl.c Adds a “handshake complete” gate before exporting keying material.
src/internal.c Adds client-side session ticket expiry suppression and extends alert translation for buffer errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/internal.c Outdated
Comment thread src/ssl.c Outdated
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m3

  • FLASH: .text +4 B (+0.0%, 125,779 B / 262,144 B, total: 48% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +64 B (+0.0%, 783,268 B / 1,048,576 B, total: 75% used)

gcc-arm-cortex-m4-rsa-only

@kareem-wolfssl
kareem-wolfssl force-pushed the zd21873 branch 2 times, most recently from 133b754 to 9528e7c Compare June 10, 2026 19:04

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Skoll Code Review

Scan type: reviewOverall recommendation: COMMENT
Findings: 4 total — 3 posted, 1 skipped
2 finding(s) posted as inline comments (see file-level comments below)

Posted findings

  • [Medium] Expired-ticket branch drops SessionTicket extension entirely; client may no longer obtain a fresh ticketsrc/internal.c:31665-31687
  • [Medium] No tests added for the three new compliance behaviorstests/api.c
  • [Low] Redundant dual condition in keying-material handshake-complete gatesrc/ssl.c:4076-4080

Skipped findings

  • [Low] Preprocessor directives indented to code column instead of repo convention

Review generated by Skoll

Comment thread src/internal.c Outdated
Comment thread src/ssl.c Outdated

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See skoll review #10594 (review)

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Skoll Code Review

Scan type: reviewOverall recommendation: COMMENT
Findings: 13 total — 6 posted, 7 skipped
5 finding(s) posted as inline comments (see file-level comments below)
1 finding(s) not tied to a diff line (full detail below)

Posted findings

  • [Medium] New build macro not added to the src/internal.c macro documentation blocksrc/internal.c:3742
  • [Medium] "eNULL" directive now behaves asymmetrically between TLS 1.2 and TLS 1.3 NULL suitessrc/internal.c:3733-3757
  • [Medium] Expired ticket is not deleted from the session, contrary to the cited RFCsrc/internal.c:32701-32715
  • [Low] Expiry comparison differs from the server-side check and treats timeout 0 as immediately expiredsrc/internal.c:32701-32706
  • [Low] Continuation line left misaligned and over 80 columns after re-indentsrc/internal.c:32719-32720

Findings not tied to a diff line

Removal of integrity-only .conf cases drops end-to-end coverage that would still pass

File: tests/test-tls13.conf:213-231, tests/test-dtls13.conf:270-292
Function: n/a
Severity: Medium

Eight entries (four TLS 1.3, four DTLS 1.3) that ran real client/server processes over TLS13-SHA256-SHA256 / TLS13-SHA384-SHA384 were deleted. These do not appear to be broken by the source change: IsValidCipherSuite() in tests/suites.c:128-169 validates a conf -l entry by calling wolfSSL_CTX_set_cipher_list() with the literal name, and the explicit-name path in ParseCipherList() is untouched by the InitSuites_Tls13 gating - which is precisely what the new tests/api.c:2548-2552 assertion ("TLS13-SHA256-SHA256" -> suite present) proves. Both peers pass -l, so the handshake should still negotiate. After the removal the documented opt-in path is exercised only by in-process memio unit tests (tests/api/test_tls_ext.c:420, tests/api/test_dtls13.c:131,783); the cross-process client/server coverage, including the DTLS 1.3 record path, is gone.

Recommendation: Restore the conf entries (they exercise the opt-in path the PR says remains supported), or state in the PR why they can no longer pass.

Referenced code: tests/test-tls13.conf:213-231, tests/test-dtls13.conf:270-276 (7 lines)


Skipped findings

  • [Medium] Default TLS 1.3 suite list can become empty in NULL-cipher-only builds
  • [Medium] Exporter gate is stricter than the TLS 1.3 key schedule requires (0.5-RTT server window)
  • [Medium] New public-API precondition in wolfSSL_export_keying_material has no test
  • [Medium] New BUFFER_E - decode_error alert mapping is untested
  • [Medium] BUFFER_E also signals local send-side failures, so decode_error can blame the peer for our own error
  • [Low] Comment cites RFC 8446 4.6.1 in a code path unreachable for TLS 1.3
  • [Low] Test opens a block solely to declare a variable and cites a non-existent flag

Review generated by Skoll

Comment thread src/internal.c Outdated
Comment thread src/internal.c
Comment thread src/internal.c Outdated
Comment thread src/internal.c Outdated
Comment thread src/internal.c

@dgarske dgarske left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Comment thread tests/test-dtls13.conf
Comment thread tests/test-tls13.conf
Comment thread .wolfssl_known_macro_extras
@JacobBarthelmeh

Copy link
Copy Markdown
Contributor

@kareem-wolfssl please go through and address comments. Assign to wolfSSL-bot and un-assign yourself when ready for review/merge.

Comment thread src/internal.c Outdated
Comment thread src/internal.c
Comment thread src/ssl.c
Comment thread tests/api.c
@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

2 similar comments
@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

@kareem-wolfssl
kareem-wolfssl force-pushed the zd21873 branch 2 times, most recently from 9b63072 to 32a0d59 Compare September 4, 2026 18:34
…set. This should fix hostap EAP-FAST failures.
…NULL_CIPHER_IN_DEFAULT is defined.

Thanks to Ben Smyth for the report.
Added tests
Restored NULL cipher suite tests into new conf files
Restored previous eNULL handling
Fix session timeout check and clear ticket when not resuming
Document WOLFSSL_TLS13_NULL_CIPHER_IN_DEFAULT
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.

5 participants