Repository navigation
Drop redundant certificate and key checks from the standard handshake - #76
Merged
Merged
Conversation
aidangarske
requested review from
wolfSSL-Fenrir-bot
and
a balanced review from Copilot
November 11, 2026 20:44
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #76
Scan targets checked: wolfspdm-src, wolfspdm-bugs
Not reviewed (no scan target covers them): test/unit_test.c
Coverage: 4 of 4 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
aidangarske
force-pushed
the
faster-standard-handshake
branch
from
November 11, 2026 23:04
d4f553a to
18f0b0b
Compare
dgarske
approved these changes
Nov 11, 2026
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.
Duplicate chain validation, commit aidangarske@d4f553a - wolfSPDM_ConnectStandard validated the certificate chain after GET_CERTIFICATE and again inside wolfSPDM_KeyExchange, doubling the ECDSA verifies. Connect now calls an internal key exchange that skips the second pass, while the public wolfSPDM_KeyExchange still revalidates, so the F-14806 protection for direct callers is unchanged. Set B library and crypto CPU per handshake went from 1.86 ms to 0.99 ms on x86_64 together with the changes below.
Trust anchor self-signature - when the chain's root is byte-identical to the configured trusted CA, its own signature is no longer verified, since the anchor is trusted by configuration and RootHash already matches it. A root copy that differs from the anchor is still verified, and a new test passes only with this change.
Public key validation - wc_ecc_check_key did a full n*Q scalar multiplication on the ECDHE and responder keys. P-384 has cofactor 1, so the range and on-curve check from wc_ecc_point_is_on_curve is sufficient. wolfSSL builds before v5.9.1 without USE_ECC_B_PARAM fall back to wc_ecc_check_key.
Certificate reads - GET_CERTIFICATE asked for a fixed 1 KB per message and used a stack buffer. Each request now asks for up to the negotiated transfer size, and the reply is received directly into the chain buffer, so there is no stack buffer and the context grows by 8 bytes. The 16.8 KB ML-DSA-65 chain went from 26 messages to 19, and SPDM 1.4 PQ total CPU went from 3.20 ms to 2.36 ms.