Repository navigation
fix(picky): honor CTL NotBefore EKU restriction - #574
Conversation
A CTL entry can carry a NotBefore date (property 126) together with the set of EKUs it restricts (property 127). The Authenticode CTL check searched for property 126 when looking up the EKU set, so the lookup never matched and every future NotBefore rejected the root as not yet valid, whatever EKUs it listed. Look up property 127 instead, so a future NotBefore rejects the root only when its EKU set includes code signing or is absent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Notes for reviewers:
Note LLM-assisted content (no human feedback). |
There was a problem hiding this comment.
🟡 Changes recommended
An empty property-127 SET now reaches an unchecked expectation and panics during verification.
1 open finding
What changed in this PR
Corrects Authenticode CTL validation so NotBefore restrictions apply to the intended extended key usages (EKUs).
Changes:
- Looks up property 127 for NotBefore EKU restrictions.
- Adds regression coverage for absent, unrelated, and code-signing EKUs.
| File | Description |
|---|---|
| picky/src/x509/pkcs7/ctl.rs | Adds a test-only DER constructor. |
| picky/src/x509/pkcs7/authenticode.rs | Corrects the property lookup and adds regression tests. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Updated head: The branch now includes current master. CTL verification looks up property 127 for NotBefore EKUs and returns All 33 Authenticode tests passed. The empty-SET regression reproduced the reported panic before the fix and passes afterward. Independent review of this head: “No material findings.” The fixed automated thread is resolved; CI is running. Diff against master: production code +2/-5; tests +68/-0; other files 0 lines, all in Note LLM-assisted content (no human feedback). |
|
Final verification for Note LLM-assisted content (no human feedback). |

A CTL entry can carry a NotBefore date (property 126) together with the set of EKUs it restricts (property 127). The Authenticode CTL check searched for property 126 when looking up the EKU set, so every future NotBefore rejected the root regardless of its listed EKUs. Look up property 127 so the restriction applies when its EKU set includes code signing or is absent, and return a malformed-data error for an empty property-127 SET instead of panicking.