-
Notifications
You must be signed in to change notification settings - Fork 922
Extend AIA interface #9728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Extend AIA interface #9728
Conversation
784b100 to
db8e53a
Compare
db8e53a to
1895762
Compare
1895762 to
7470d91
Compare
7470d91 to
3968669
Compare
|
jenkins retest this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extends Authority Information Access (AIA) handling to support multiple AIA entries per certificate and to expose CA Issuers URLs in addition to OCSP, with associated test certificates and API surface.
Changes:
- Introduces a shared
WOLFSSL_AIA_ENTRYrepresentation and stores multiple AIA locations (method + URI) inDecodedCertandWOLFSSL_X509, with overflow tracking and copying from decoded certs into X.509 objects. - Refactors AIA decoding in
wolfcrypt/src/asn.cand X.509 AIA accessors insrc/x509.cto build stacks of URIs for both OCSP and CA Issuers, while preserving legacy single-entry behavior as a fallback. - Adds tests, OpenSSL config, renewal script steps, and test certificates for CA Issuers AIA, multiple AIA entries, and overflow handling, and wires the new tests into the existing API test suite.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/wolfcrypt/asn.h | Defines WOLFSSL_AIA_ENTRY and adds extAuthInfoList, size, and overflow tracking to DecodedCert to represent multiple AIA entries per certificate. |
| wolfssl/ssl.h | Declares new public APIs wolfSSL_X509_get_aia_overflow and wolfSSL_X509_get1_ca_issuers alongside the existing OCSP AIA accessor. |
| wolfssl/internal.h | Mirrors the WOLFSSL_AIA_ENTRY struct and adds authInfoList, size, and overflow flags to WOLFSSL_X509 for runtime AIA storage. |
| wolfcrypt/src/asn.c | Extends DecodeAuthInfo (both template and non-template paths) to populate the AIA list, set the first OCSP and CA Issuer URIs, and flag overflows. |
| src/x509.c | Replaces the single-URI OCSP accessor with a generic AIA helper that returns stacks of URIs per method, adds an overflow query API, and adds a CA Issuers getter built on the same helper. |
| src/internal.c | Copies the decoded AIA list and overflow flag from DecodedCert into WOLFSSL_X509, rebasing URI pointers into the certificate’s DER buffer and enforcing WOLFSSL_MAX_AIA_ENTRIES. |
| tests/api.c | Adds tests for wolfSSL_X509_get1_ca_issuers, multi-entry OCSP/CA Issuers AIA URLs, and overflow behavior when the AIA list exceeds WOLFSSL_MAX_AIA_ENTRIES, and registers them in the test table. |
| certs/renewcerts/wolfssl.cnf | Adds OpenSSL config sections to generate AIA test certificates for CA Issuers, multiple AIA entries, and overflow cases. |
| certs/renewcerts.sh | Extends the renewal script to generate and refresh the new AIA test certificates used by the added tests. |
| certs/include.am | Ships the new AIA test certificates with the build/test distribution. |
| certs/crl/include.am | Adds additional CRL test files (large CRL number cases) to the distribution list. |
| certs/aia/*.pem | Provides concrete CA Issuers, multi-AIA, and overflow AIA certificates for exercising the new behavior in tests. |
| .gitignore | Ignores compile_commands.json to avoid checking in local code-navigation metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| static int test_wolfSSL_X509_get1_aia_overflow(void) | ||
| { | ||
| EXPECT_DECLS; | ||
| #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \ | ||
| defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)) && \ | ||
| !defined(NO_FILESYSTEM) && !defined(NO_RSA) | ||
| X509* cert = NULL; | ||
| STACK_OF(WOLFSSL_STRING) *ocsp = NULL; | ||
| int count; | ||
|
|
||
| ExpectNotNull(cert = wolfSSL_X509_load_certificate_file( | ||
| "certs/aia/overflow-aia-cert.pem", WOLFSSL_FILETYPE_PEM)); | ||
|
|
||
| ExpectNotNull(ocsp = wolfSSL_X509_get1_ocsp(cert)); | ||
| count = wolfSSL_sk_WOLFSSL_STRING_num(ocsp); | ||
| ExpectIntEQ(count, 8); | ||
|
|
||
| wolfSSL_X509_email_free(ocsp); | ||
| wolfSSL_X509_free(cert); | ||
| #endif |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new wolfSSL_X509_get_aia_overflow accessor introduced just above is not exercised in this overflow test, even though this test is specifically validating behavior when the AIA list exceeds WOLFSSL_MAX_AIA_ENTRIES. To protect against regressions in how overflow is tracked, consider also asserting that wolfSSL_X509_get_aia_overflow(cert) returns 1 for this certificate, and that it returns 0 for non-overflowing certificates (e.g., in test_wolfSSL_X509_get1_aia_multi).
Description
Testing
New unit tests
Checklist