Repository navigation
X509 fix: CRL static and Fetching X509 object - #12071
aidankeefe2022 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the certificate/CRL lookup and static revoked-list changes.
No open issues 🎉
What changed in this PR
This PR improves wolfSSL’s OpenSSL compatibility by distinguishing certificates from CRLs during subject lookup and supporting static revoked-certificate arrays across CRL operations.
Changes:
- Match X509 objects by certificate subject or CRL issuer, using the correct union member.
- Support static revoked arrays in accessors, printing, insertion, and signing.
- Add regression tests and a Linux CI configuration for static revoked lists.
| File | Description |
|---|---|
tests/api/test_ossl_x509_str.h |
Registers the mixed certificate/CRL lookup test. |
tests/api/test_ossl_x509_str.c |
Tests type-aware lookup and head-CRL issuer matching. |
tests/api/test_certman.h |
Registers the static revoked-list addition test. |
tests/api/test_certman.c |
Tests static-array access, signing, lookup, capacity, and empty CRLs. |
tests/api.c |
Excludes linked-list-specific generation tests from static-array builds. |
src/x509.c |
Fixes type-aware object lookup and static-array iteration. |
src/crl.c |
Adds sorted, capacity-checked insertion and links static entries for signing. |
.github/configs/os-check-linux.json |
Adds CI coverage for CRL_STATIC_REVOKED_LIST. |
Review effort: Balanced
3b320bb to
eaffe99
Compare
|
retest this please |
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #12071
Scan targets checked: wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): .github/configs/os-check-linux.json, tests/api/test_certman.h, tests/api/test_ossl_x509_str.h
Coverage: 5 of 5 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: Max
| } | ||
| } | ||
| #ifdef HAVE_CRL | ||
| else if (obj->data.crl != NULL && wolfSSL_X509_NAME_cmp( |
There was a problem hiding this comment.
CRL lookup only matches the first CRL entry's issuer in the aggregated store CRL · Logic errors
The new X509_LU_CRL branch compares name only to wolfSSL_X509_CRL_get_issuer_name(), which returns the first crlList entry's issuer. The store's single CRL object holds every loaded CRL, so lookups for any other issuer return NULL. The new test asserts that miss for caEccCrl.pem.
Suggested fix: Making the CRL lookup match every CRL_Entry issuer in the aggregated store CRL needs a design decision; consult OpenSSL's X509_STORE/X509_OBJECT API documentation.
Related known findings (similar but distinct; listed for context, not part of this finding)
Description
F-15885
Made it so CRL and X509 are distinguished in the union in wolfSSL_X509_OBJECT_retrieve_by_subject
OpenSSL compatibility change
F-12742
Made wolfSSL_X509_CRL_get_REVOKED work for CRL_STATIC_REVOKED_LIST
Added new tests and a conversion helper to turn an array into a linked list. The array is a list of the CRL node objects, so we just link them when we cannot use just the array. This is only used when wc_MakeCRL_ex needs the CRL list because it is public and expects the linked list.
Testing
Added regression tests for changes.
regression to make sure that CRL list operations work when static-crl is enabled
Checklist