certificatePolicies fixes - #11221
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens X.509 certificatePolicies extension parsing to better match RFC 5280 requirements and adds regression coverage to prevent acceptance of malformed inputs.
Changes:
- Reject empty
certificatePoliciessequences (RFC 5280 §4.2.1.4:SEQUENCE SIZE (1..MAX)). - Ensure trailing bytes after the final
PolicyInformationare rejected (not silently ignored). - Add/adjust regression tests exercising both conditions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
wolfcrypt/src/asn.c |
Enforces non-empty certificatePolicies and iterates through the full decoded sequence to catch trailing junk. |
tests/unit-mcdc/test_asn_ext_whitebox.c |
Updates whitebox expectation for empty certificatePolicies to require failure. |
tests/api/test_asn.h |
Adds declarations/registration for new ASN extension regression tests. |
tests/api/test_asn.c |
Adds regression tests for empty certificatePolicies and trailing-junk rejection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dae7c7c to
0653ac9
Compare
0653ac9 to
952c579
Compare
|
retest this please |
|
a222443 to
e0d985d
Compare
|
Jenkins retest this please. (TIMEOUT) |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11221
Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
Findings: 3
3 finding(s) posted as inline comments (see file-level comments below)
This review was generated automatically by Fenrir. Reported findings require changes before merge.
…er RFC 5280 4.2.1.4; - asn: reject trailing bytes after the last PolicyInformation in certificatePolicies; - minor edit updating the whitebox notes to match these new changes;
e0d985d to
83594b9
Compare
Description
Two simple and small fixes on how certificatePolicies are handled:
And a minor edit updating the whitebox notes to match with these changes.
Testing
Added two regression tests, one for each test.
Checklist