Check expiry for trusted certs - #11465
Open
padelsbach wants to merge 1 commit into
Open
padelsbach wants to merge 1 commit into
padelsbach wants to merge 1 commit into
Conversation
padelsbach
force-pushed
the
ossl-compat-issue-31
branch
from
September 16, 2026 00:59
bc9c428 to
26e1274
Compare
padelsbach
force-pushed
the
ossl-compat-issue-31
branch
from
September 17, 2026 05:19
26e1274 to
1951a8b
Compare
padelsbach
force-pushed
the
ossl-compat-issue-31
branch
3 times, most recently
from
September 29, 2026 17:11
ded7ffd to
bc689eb
Compare
Contributor
Author
|
jenkins retest this please |
padelsbach
force-pushed
the
ossl-compat-issue-31
branch
from
October 1, 2026 00:15
bc689eb to
006d6cb
Compare
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Date-validation configuration and verification callback semantics regress, while the default test path does not exercise the new behavior.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Adds validity-period checks for trusted peer certificates while preserving RTC-less behavior.
Changes:
- Validates trusted peers’
notBeforeandnotAfterdates. - Maps failures to OpenSSL-compatible verification errors.
- Adds an expired-certificate API test.
| File | Description |
|---|---|
src/internal.c |
Adds trusted-peer date validation. |
tests/api/test_certman.c |
Tests expired trusted-peer handling. |
tests/api/test_certman.h |
Registers the new test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+16839
to
+16840
| (wc_ValidateDate(&cert->beforeDate[2], cert->beforeDate[0], | ||
| ASN_BEFORE, cert->beforeDate[1]) == 0)) { |
Comment on lines
+18546
to
+18547
| WOLFSSL_ERROR_VERBOSE(ret); | ||
| goto exit_ppc; |
Comment on lines
+4242
to
+4254
| ret = wolfSSL_CTX_trust_peer_cert(client_cb.ctx, | ||
| "certs/test/expired/expired-cert.pem", WOLFSSL_FILETYPE_PEM); | ||
| if (ret == WOLFSSL_SUCCESS) { | ||
| wolfSSL_CTX_set_verify(client_cb.ctx, WOLFSSL_VERIFY_PEER, NULL); | ||
|
|
||
| /* the pin must not revive an expired certificate */ | ||
| ExpectIntNE(test_wolfSSL_client_server_nofail_memio(&client_cb, | ||
| &server_cb, NULL), TEST_SUCCESS); | ||
| ExpectIntEQ(client_cb.last_err, WC_NO_ERR_TRACE(ASN_AFTER_DATE_E)); | ||
| } | ||
| else { | ||
| ExpectIntEQ(ret, WC_NO_ERR_TRACE(ASN_AFTER_DATE_E)); | ||
| } |
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.


Description
This change adds checks on the before and after dates for certs in the trust store to match OpenSSL behavior. Note that the RTC-less mode is still respected and date checks are skipped.
Testing
Added unit tests
Checklist