Skip to content

Conversation

@padelsbach
Copy link
Contributor

@padelsbach padelsbach commented Jan 30, 2026

Description

  • Add support for multiple AIA's
  • Add support for CA issuer URL in addition to OCSP in AIA

Testing

New unit tests

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@padelsbach
Copy link
Contributor Author

jenkins retest this please

@padelsbach padelsbach marked this pull request as ready for review February 3, 2026 17:31
@padelsbach padelsbach requested a review from cconlon February 3, 2026 17:31
@cconlon cconlon requested a review from Copilot February 3, 2026 22:51
Copy link
Contributor

Copilot AI left a 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_ENTRY representation and stores multiple AIA locations (method + URI) in DecodedCert and WOLFSSL_X509, with overflow tracking and copying from decoded certs into X.509 objects.
  • Refactors AIA decoding in wolfcrypt/src/asn.c and X.509 AIA accessors in src/x509.c to 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.

Comment on lines +19280 to +19299
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
Copy link

Copilot AI Feb 3, 2026

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants