Check ctx extensions before rejecting a TLS1.3 certificate message extension#10936
Open
aidangarske wants to merge 1 commit into
Open
Check ctx extensions before rejecting a TLS1.3 certificate message extension#10936aidangarske wants to merge 1 commit into
aidangarske wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a TLS 1.3 interoperability bug where Certificate message extensions (notably OCSP stapling’s status_request) were incorrectly rejected when the client enabled them via the CTX-level API (ctx->extensions) instead of the SSL-level list (ssl->extensions). This aligns the RFC 8446 §4.4.2 “only accept what was offered” check with existing behavior elsewhere (e.g., TLSX_CheckUnsupportedExtension()), allowing TLS 1.3 OCSP stapling to work for clients using wolfSSL_CTX_UseOCSPStapling().
Changes:
- Extend the TLS 1.3 Certificate-message extension “was it offered?” check to look in
ssl->ctx->extensionswhen not found inssl->extensions. - Add a defensive
ssl->ctx == NULLguard before dereferencingssl->ctx->extensions. - Update the inline comment to document why CTX-level lookup is necessary at this call site.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Member
Author
|
Jenkins retest this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wolfSSL_CTX_UseOCSPStapling()stores status_request onctx->extensions, and nothing copies it tossl->extensions. The ClientHello is written from the CTX, so the extension is offered, but the RFC 8446 4.4.2 check inTLSX_Parse()only searchedssl->extensionsand killed the server's staple:So OCSP stapling over TLS 1.3 fails for any client that uses the CTX-level API. TLS 1.2 takes a different path and is unaffected.
TLSX_CheckUnsupportedExtension()already does this ssl-then-ctx lookup; this call site now matches it.Found by wolfssl-examples
ocsp/stapling, which uses the documented CTX API. Currently pointing OCSP testing here till merged