Repository navigation
Skip the redundant signature verification for normal CAs. - #11892
Conversation
|
b64333d to
b147ee5
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11892
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs
Coverage: 1 of 1 in-scope changed file(s) opened by the reviewer
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
b147ee5 to
b23f009
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11892
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c, wolfssl/wolfcrypt/asn.h
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
b23f009 to
ef7749a
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11892
Scan targets checked: wolfssl-src, wolfssl-bugs
Unchanged since last review (not re-run): wolfcrypt-src, wolfcrypt-bugs
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: tests/api.c
Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
Review tier: Lite
ef7749a to
15797c4
Compare
Frauschi
left a comment
There was a problem hiding this comment.
Thanks for chasing down the memory cost from #11334. Skipping the self-signature check for AKID == SKID roots looks sound for the common case. A few comments: the VERIFY_NAME change sets selfSigned from a key that isn't guaranteed to be the one that verified the signature, the skip is a bit broader than the root case it targets, and the new tests don't exercise the changed path yet.
15797c4 to
300fce8
Compare
300fce8 to
89a2464
Compare
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11892
Scan targets checked: wolfcrypt-src, wolfcrypt-bugs, wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): doc/dox_comments/header_files/asn.h
Coverage: 5 of 5 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: Lite
Fenrir's latest completed scan found no issues; clearing the prior automated change request.
|
Hi @Frauschi , |
- a CA_TYPE cert now skips ConfirmSelfSignature() only when its AKID is set and equals its SKID, and Key Usage allows keyCertSign - wc_CheckCertSignature_ex() reports the key of the CA that verified the signature; wc_CheckCertSignature() calls it without one. - CheckCertSignature_ex() in asn.c and asn_orig.c fills that key. - ProcessPeerCertParse() sets selfSigned on the small-cert path when the signature verified with the certificate's own key.
89a2464 to
5532670
Compare
|
tests good with multi-test with |
Problem
PR #11334 introduced selfSigned and its verifier ConfirmSelfSignature.
It increased the memory usage for CA loads unconditionally.
The PR recognized the runtime cost only.
Fix
a CA_TYPE cert now skips ConfirmSelfSignature() only when its AKID is set and equals its SKID, and Key Usage allows keyCertSign.
Also, ProcessPeerCertParse() sets selfSigned on the small-cert path when the signature verified with the certificate's own key. wc_CheckCertSignature_ex() is added for the purpose.
Test
make check with --enable-all: pass.
Verification (peak heap)
Configs are the
low_eccandlow_rsa2048lines from nightly-memusage-v2,plus
--enable-trackmemory(printspeak Byteson exit) and--disable-shared:One mutual-auth TLS 1.2 handshake between
examples/server/serverandexamples/client/client; numbers are each process'speak Bytes(wholeprocess, CA load included). Repeated runs gave identical numbers.
-c certs/server-ecc.pem -k certs/ecc-key.pem -A certs/client-ecc-cert.pem,client
-A certs/ca-ecc-cert.pem -c certs/client-ecc-cert.pem -k certs/ecc-client-key.pem1625c65a1e)