Trusted cert cache and verify callbacks#353
Draft
bigbrett wants to merge 11 commits intowolfSSL:mainfrom
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #353
Scan targets checked: wolfhsm-core-bugs, wolfhsm-src
Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Findings are non-blocking.
bigbrett
commented
May 5, 2026
bigbrett
commented
May 5, 2026
bigbrett
commented
May 5, 2026
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #353
Scan targets checked: wolfhsm-core-bugs, wolfhsm-src
No new issues found in the changed files. ✅
The trusted cert verify cache was designed against single-root verify; the multi-root verify that landed on main has no single anchoring root to bind cache entries to. This commit unifies the two so multi-root callers can still benefit from the cache without introducing false-positive verifies. - _verifyChainAgainstCmStore now takes the array of trusted root IDs and dispatches between bound mode (numRoots == 1) and unbound mode (numRoots > 1). - New wh_Server_CertVerifyCache_LookupAnyRoot OR's lookups across the supplied roots; multi-root callers use this so a hit means the cert was previously verified under a root they currently trust. - Multi-root verifies do not insert into the cache. The anchoring root cannot be identified post-verify, and inserting under any non-anchoring root from the supplied set could be matched by a future single-root verify under that wrong root. - Only CA certs are cached. Caching a leaf would let a future "leaf alone" verify falsely succeed via cache hit, because the cache hit short-circuits the wolfSSL signature check that would otherwise fail (the leaf's issuer is not in the cert manager for an isolated verify). CA caching is sound because the chain walk loads each verified CA into the cert manager before the next cert is processed. Tests updated: the verify-callback tests previously expected zero callback invocations on a cache-hit re-verify; with leaves no longer cached they assert the count drops below the cold path but stays above zero.
fe5cdfe to
5d341c4
Compare
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.
Introduces two new features: