Skip to content

Commit

Permalink
Pass Through Disable AIA Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks committed Dec 3, 2024
1 parent 698c028 commit ceed310
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/api/QUIC_CREDENTIAL_CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ Obtain the peer certificate using a faster in-process API call. Only available o

Enable CA certificate file provided in the `CaCertificateFile` member.

`QUIC_CREDENTIAL_FLAG_DISABLE_AIA`

The following flag can be set to explicitly disable AIA retrievals. Only valid on Windows.

#### `CertificateHash`

Must **only** use with `QUIC_CREDENTIAL_TYPE_CERTIFICATE_HASH` type.
Expand Down
1 change: 1 addition & 0 deletions src/inc/msquic.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ typedef enum QUIC_CREDENTIAL_FLAGS {
QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY = 0x00040000, // Windows only currently
QUIC_CREDENTIAL_FLAG_INPROC_PEER_CERTIFICATE = 0x00080000, // Schannel only
QUIC_CREDENTIAL_FLAG_SET_CA_CERTIFICATE_FILE = 0x00100000, // OpenSSL only currently
QUIC_CREDENTIAL_FLAG_DISABLE_AIA = 0x00200000, // Schannel only currently
} QUIC_CREDENTIAL_FLAGS;

DEFINE_ENUM_FLAG_OPERATORS(QUIC_CREDENTIAL_FLAGS)
Expand Down
3 changes: 3 additions & 0 deletions src/platform/certificates_capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ CxPlatCertVerifyRawCertificate(
if (CredFlags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY) {
CertFlags |= CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY;
}
if (CredFlags & QUIC_CREDENTIAL_FLAG_DISABLE_AIA) {
CertFlags |= CERT_CHAIN_DISABLE_AIA;
}

Result =
CxPlatCertValidateChain(
Expand Down
6 changes: 4 additions & 2 deletions src/platform/tls_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,8 @@ CxPlatTlsSecConfigCreate(
CredConfigFlags & QUIC_CREDENTIAL_FLAG_IGNORE_NO_REVOCATION_CHECK ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_IGNORE_REVOCATION_OFFLINE ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_CACHE_ONLY_URL_RETRIEVAL ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY)) {
CredConfigFlags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_DISABLE_AIA)) {
return QUIC_STATUS_INVALID_PARAMETER;
}

Expand All @@ -992,7 +993,8 @@ CxPlatTlsSecConfigCreate(
CredConfigFlags & QUIC_CREDENTIAL_FLAG_IGNORE_NO_REVOCATION_CHECK ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_IGNORE_REVOCATION_OFFLINE ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_CACHE_ONLY_URL_RETRIEVAL ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY)) {
CredConfigFlags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY ||
CredConfigFlags & QUIC_CREDENTIAL_FLAG_DISABLE_AIA)) {
return QUIC_STATUS_INVALID_PARAMETER;
}
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/platform/tls_schannel.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,9 @@ CxPlatTlsSetClientCertPolicy(
if (SecConfig->Flags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY) {
ClientCertPolicy.dwCertFlags |= CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY;
}
if (SecConfig->Flags & QUIC_CREDENTIAL_FLAG_DISABLE_AIA) {
ClientCertPolicy.dwCertFlags |= CERT_CHAIN_DISABLE_AIA;
}

SecStatus =
SetCredentialsAttributesW(
Expand Down Expand Up @@ -1110,6 +1113,9 @@ CxPlatTlsSecConfigCreate(
if (CredConfig->Flags & QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY) {
Credentials->dwFlags |= SCH_CRED_REVOCATION_CHECK_CACHE_ONLY;
}
if (CredConfig->Flags & QUIC_CREDENTIAL_FLAG_DISABLE_AIA) {
Credentials->dwFlags |= CERT_CHAIN_DISABLE_AIA;
}
if (IsClient) {
Credentials->dwFlags |= SCH_CRED_NO_DEFAULT_CREDS;
Credentials->pTlsParameters->grbitDisabledProtocols = (DWORD)~SP_PROT_TLS1_3_CLIENT;
Expand Down
1 change: 1 addition & 0 deletions src/platform/unittest/TlsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2222,6 +2222,7 @@ TEST_F(TlsTest, PlatformSpecificFlagsSchannel)
QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_END_CERT, QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT,
QUIC_CREDENTIAL_FLAG_IGNORE_NO_REVOCATION_CHECK, QUIC_CREDENTIAL_FLAG_IGNORE_REVOCATION_OFFLINE,
QUIC_CREDENTIAL_FLAG_CACHE_ONLY_URL_RETRIEVAL, QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CACHE_ONLY,
QUIC_CREDENTIAL_FLAG_DISABLE_AIA,
#ifndef __APPLE__
QUIC_CREDENTIAL_FLAG_REVOCATION_CHECK_CHAIN,
#endif
Expand Down

0 comments on commit ceed310

Please sign in to comment.