#include "net/cert/cert_verify_proc.h"
#include <memory>
#include <string_view>
#include <vector>
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/rand_util.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "crypto/sha2.h"
#include "net/base/cronet_buildflags.h"
#include "net/base/net_errors.h"
#include "net/cert/asn1_util.h"
#include "net/cert/cert_net_fetcher.h"
#include "net/cert/cert_status_flags.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/cert_verify_proc_builtin.h"
#include "net/cert/cert_verify_result.h"
#include "net/cert/crl_set.h"
#include "net/cert/ct_policy_enforcer.h"
#include "net/cert/do_nothing_ct_verifier.h"
#include "net/cert/ev_root_ca_metadata.h"
#include "net/cert/internal/system_trust_store.h"
#include "net/cert/test_root_certs.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "net/cert_net/cert_net_fetcher_url_request.h"
#include "net/log/test_net_log.h"
#include "net/proxy_resolution/proxy_config.h"
#include "net/proxy_resolution/proxy_config_service_fixed.h"
#include "net/test/cert_builder.h"
#include "net/test/cert_test_util.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/gtest_util.h"
#include "net/test/revocation_builder.h"
#include "net/test/test_certificate_data.h"
#include "net/test/test_data_directory.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_context_getter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/mem.h"
#include "third_party/boringssl/src/include/openssl/pool.h"
#include "third_party/boringssl/src/pki/extended_key_usage.h"
#include "third_party/boringssl/src/pki/input.h"
#include "third_party/boringssl/src/pki/ocsp_revocation_status.h"
#include "third_party/boringssl/src/pki/parse_certificate.h"
#include "third_party/boringssl/src/pki/parser.h"
#include "third_party/boringssl/src/pki/pem.h"
#include "third_party/boringssl/src/pki/signature_algorithm.h"
#include "third_party/boringssl/src/pki/trust_store.h"
#if BUILDFLAG(IS_ANDROID)
#include "net/cert/cert_verify_proc_android.h"
#elif BUILDFLAG(IS_IOS)
#include "base/ios/ios_util.h"
#include "net/cert/cert_verify_proc_ios.h"
#elif BUILDFLAG(IS_MAC)
#include "base/mac/mac_util.h"
#endif
#if BUILDFLAG(CHROME_ROOT_STORE_SUPPORTED)
#include "net/cert/internal/trust_store_chrome.h"
#endif
IsError;
IsOk;
HexEncode;
namespace net {
namespace {
const char kTrustAnchorVerifyHistogram[] = …;
const char kTrustAnchorVerifyOutOfDateHistogram[] = …;
std::string TestOid0SignatureAlgorithmTLV() { … }
bssl::der::Input TestOid0() { … }
class MockCertVerifyProc : public CertVerifyProc { … };
int MockCertVerifyProc::VerifyInternal(X509Certificate* cert,
const std::string& hostname,
const std::string& ocsp_response,
const std::string& sct_list,
int flags,
CertVerifyResult* verify_result,
const NetLogWithSource& net_log) { … }
enum CertVerifyProcType { … };
std::string VerifyProcTypeToName(
const testing::TestParamInfo<CertVerifyProcType>& params) { … }
scoped_refptr<CertVerifyProc> CreateCertVerifyProc(
CertVerifyProcType type,
scoped_refptr<CertNetFetcher> cert_net_fetcher,
scoped_refptr<CRLSet> crl_set,
CertificateList additional_trust_anchors,
CertificateList additional_untrusted_authorities) { … }
constexpr CertVerifyProcType kAllCertVerifiers[] = …;
static_assert …;
bool ScopedTestRootCanTrustTargetCert(CertVerifyProcType verify_proc_type) { … }
bool ScopedTestRootCanTrustIntermediateCert(
CertVerifyProcType verify_proc_type) { … }
std::string MakeRandomHexString(size_t num_bytes) { … }
}
class CertVerifyProcInternalTest
: public testing::TestWithParam<CertVerifyProcType> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CertVerifyProcInternalTest, DistrustedIntermediate) { … }
TEST_P(CertVerifyProcInternalTest, EVVerificationMultipleOID) { … }
TEST_P(CertVerifyProcInternalTest, TrustedTargetCertWithEVPolicy) { … }
TEST_P(CertVerifyProcInternalTest,
TrustedTargetCertWithEVPolicyAndEVFingerprint) { … }
TEST_P(CertVerifyProcInternalTest, TrustedIntermediateCertWithEVPolicy) { … }
TEST_P(CertVerifyProcInternalTest, CertWithNullInCommonNameAndNoSAN) { … }
TEST_P(CertVerifyProcInternalTest, CertWithNullInCommonNameAndValidSAN) { … }
TEST_P(CertVerifyProcInternalTest, CertWithNullInSAN) { … }
TEST_P(CertVerifyProcInternalTest, InvalidTarget) { … }
TEST_P(CertVerifyProcInternalTest, UnnecessaryInvalidIntermediate) { … }
TEST_P(CertVerifyProcInternalTest, RejectExpiredCert) { … }
TEST_P(CertVerifyProcInternalTest, RejectWeakKeys) { … }
TEST_P(CertVerifyProcInternalTest, ExtraneousRootCert) { … }
TEST_P(CertVerifyProcInternalTest, GoogleDigiNotarTest) { … }
TEST_P(CertVerifyProcInternalTest, NameConstraintsOk) { … }
TEST_P(CertVerifyProcInternalTest, NameConstraintsFailure) { … }
class CertVerifyProcInspectSignatureAlgorithmsTest : public ::testing::Test { … };
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafSha1Sha1) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafSha256Sha256) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafSha1Sha256) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafSha256Sha1) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafSha256Unknown) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, LeafUnknownSha256) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, IntermediateSha1Sha256) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, IntermediateSha256Sha1) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, RootSha256Sha1) { … }
TEST_F(CertVerifyProcInspectSignatureAlgorithmsTest, RootUnknownSha256) { … }
TEST(CertVerifyProcTest, TestHasTooLongValidity) { … }
TEST(CertVerifyProcTest, VerifyCertValidityTooLong) { … }
TEST_P(CertVerifyProcInternalTest, TestKnownRoot) { … }
TEST_P(CertVerifyProcInternalTest, PublicKeyHashes) { … }
TEST_P(CertVerifyProcInternalTest, VerifyReturnChainBasic) { … }
TEST(CertVerifyProcTest, IntranetHostsRejected) { … }
TEST(CertVerifyProcTest, SymantecCertsRejected) { … }
TEST_P(CertVerifyProcInternalTest, VerifyReturnChainProperlyOrdered) { … }
TEST_P(CertVerifyProcInternalTest, VerifyReturnChainFiltersUnrelatedCerts) { … }
TEST_P(CertVerifyProcInternalTest, AdditionalTrustAnchors) { … }
TEST_P(CertVerifyProcInternalTest, AdditionalIntermediates) { … }
TEST_P(CertVerifyProcInternalTest, AdditionalIntermediateDuplicatesRoot) { … }
TEST_P(CertVerifyProcInternalTest, AdditionalTrustAnchorDuplicateIntermediate) { … }
TEST_P(CertVerifyProcInternalTest, IsIssuedByKnownRootIgnoresTestRoots) { … }
TEST_P(CertVerifyProcInternalTest, CRLSet) { … }
TEST_P(CertVerifyProcInternalTest, CRLSetLeafSerial) { … }
TEST_P(CertVerifyProcInternalTest, CRLSetRootReturnsChain) { … }
TEST_P(CertVerifyProcInternalTest, CRLSetRevokedBySubject) { … }
TEST_P(CertVerifyProcInternalTest, BlockedInterceptionByRoot) { … }
TEST_P(CertVerifyProcInternalTest, BlockedInterceptionByIntermediate) { … }
TEST_P(CertVerifyProcInternalTest, DetectsInterceptionByRoot) { … }
TEST_P(CertVerifyProcInternalTest, CRLSetDuringPathBuilding) { … }
TEST_P(CertVerifyProcInternalTest, ValidityDayPlus5MinutesBeforeNotBefore) { … }
TEST_P(CertVerifyProcInternalTest, ValidityDayBeforeNotBefore) { … }
TEST_P(CertVerifyProcInternalTest, ValidityJustBeforeNotBefore) { … }
TEST_P(CertVerifyProcInternalTest, ValidityJustAfterNotBefore) { … }
TEST_P(CertVerifyProcInternalTest, ValidityJustBeforeNotAfter) { … }
TEST_P(CertVerifyProcInternalTest, ValidityJustAfterNotAfter) { … }
TEST_P(CertVerifyProcInternalTest, FailedIntermediateSignatureValidation) { … }
TEST_P(CertVerifyProcInternalTest, FailedTargetSignatureValidation) { … }
class CertVerifyProcNameNormalizationTest : public CertVerifyProcInternalTest { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CertVerifyProcNameNormalizationTest, StringType) { … }
TEST_P(CertVerifyProcNameNormalizationTest, CaseFolding) { … }
TEST_P(CertVerifyProcNameNormalizationTest, ByteEqual) { … }
std::string Md5WithRSAEncryption() { … }
class CertVerifyProcInternalWithNetFetchingTest
: public CertVerifyProcInternalTest { … };
INSTANTIATE_TEST_SUITE_P(…);
#if BUILDFLAG(IS_IOS)
#define MAYBE_IntermediateFromAia404 …
#else
#define MAYBE_IntermediateFromAia404 …
#endif
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
MAYBE_IntermediateFromAia404) { … }
#undef MAYBE_IntermediateFromAia404
#if BUILDFLAG(IS_IOS)
#define MAYBE_IntermediateFromAia200Der …
#else
#define MAYBE_IntermediateFromAia200Der …
#endif
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
MAYBE_IntermediateFromAia200Der) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_IntermediateFromAia200Pem …
#else
#define MAYBE_IntermediateFromAia200Pem …
#endif
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
MAYBE_IntermediateFromAia200Pem) { … }
#if BUILDFLAG(IS_IOS)
#define MAYBE_IntermediateFromAia200Pem2 …
#else
#define MAYBE_IntermediateFromAia200Pem2 …
#endif
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
MAYBE_IntermediateFromAia200Pem2) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
Sha1IntermediateButAIAHasSha256) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest, RevocationHardFailNoCrls) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailNoCrlsDisableNetworkFetches) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailCrlGoodNoRevokedCertificates) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailCrlGoodIrrelevantSerialsRevoked) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailLeafRevokedByCrl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailIntermediateRevokedByCrl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailLeafCrlDpHttpError) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationHardFailIntermediateCrlDpHttpError) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest, RevocationSoftFailNoCrls) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailCrlGoodNoRevokedCertificates) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailCrlGoodIrrelevantSerialsRevoked) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailLeafRevokedByCrl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailLeafRevokedByCrlDisableNetworkFetches) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailIntermediateRevokedByCrl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailLeafRevokedBySha1Crl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailLeafRevokedByMd5Crl) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailLeafCrlDpHttpError) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
RevocationSoftFailIntermediateCrlDpHttpError) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
EVOnlineOCSPRevocationCheckingGood) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
EVOnlineOCSPRevocationCheckingSoftFail) { … }
TEST_P(CertVerifyProcInternalWithNetFetchingTest,
EVOnlineOCSPRevocationCheckingRevoked) { … }
class CertVerifyProcConstraintsTest : public CertVerifyProcInternalTest { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CertVerifyProcConstraintsTest, BaseCase) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotCaRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotCaIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsIsCaLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsPathlen0Root) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsPathlen1Root) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsPathlen2Root) { … }
TEST_P(CertVerifyProcConstraintsTest,
BasicConstraintsPathlen0IntermediateParent) { … }
TEST_P(CertVerifyProcConstraintsTest,
BasicConstraintsPathlen1IntermediateParent) { … }
TEST_P(CertVerifyProcConstraintsTest,
BasicConstraintsPathlen0IntermediateChild) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotPresentRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotPresentRootX509V1) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotPresentIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, BasicConstraintsNotPresentLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, NameConstraintsNotMatchingRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, NameConstraintsNotMatchingIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, NameConstraintsMatchingRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, NameConstraintsMatchingIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, NameConstraintsOnLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, ValidityExpiredRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, ValidityNotYetValidRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, ValidityExpiredIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, ValidityNotYetValidIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints0Root) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints4Root) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints3Root) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints2Root) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints0Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints3Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints2Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints1Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyConstraints0Leaf) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitPolicyMapping0Root) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitPolicyMapping1Root) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitAnyPolicy0Root) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitAnyPolicy1Root) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitAnyPolicy0Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, InhibitAnyPolicy1Intermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, PoliciesRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, PolicyMappingsRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNoCertSignRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNotPresentRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNoCertSignIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNotPresentIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNoDigitalSignatureLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageNotPresentLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, KeyUsageCertSignLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, ExtendedKeyUsageNoServerAuthRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, ExtendedKeyUsageServerAuthRoot) { … }
TEST_P(CertVerifyProcConstraintsTest,
ExtendedKeyUsageNoServerAuthIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, ExtendedKeyUsageServerAuthIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, ExtendedKeyUsageNoServerAuthLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownSignatureAlgorithmRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownSignatureAlgorithmIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownSignatureAlgorithmLeaf) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownExtensionRoot) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownExtensionIntermediate) { … }
TEST_P(CertVerifyProcConstraintsTest, UnknownExtensionLeaf) { … }
class CertVerifyProcConstraintsTrustedLeafTest
: public CertVerifyProcInternalTest { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, BaseCase) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, RootAlsoTrusted) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, BasicConstraintsIsCa) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, BasicConstraintsPathlen) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, BasicConstraintsMissing) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, NameConstraintsNotMatching) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, ValidityExpired) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, PolicyConstraints) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, InhibitAnyPolicy) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, KeyUsageNoDigitalSignature) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, KeyUsageCertSignLeaf) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, ExtendedKeyUsageNoServerAuth) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, UnknownSignatureAlgorithm) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, WeakSignatureAlgorithm) { … }
TEST_P(CertVerifyProcConstraintsTrustedLeafTest, UnknownExtension) { … }
class CertVerifyProcConstraintsTrustedSelfSignedTest
: public CertVerifyProcInternalTest { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, BaseCase) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, BasicConstraintsIsCa) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
BasicConstraintsNotCaPathlen) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
BasicConstraintsIsCaPathlen) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
BasicConstraintsMissing) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
NameConstraintsNotMatching) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, ValidityExpired) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, PolicyConstraints) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, InhibitAnyPolicy) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
KeyUsageNoDigitalSignature) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, KeyUsageCertSignLeaf) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
ExtendedKeyUsageNoServerAuth) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest,
UnknownSignatureAlgorithm) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, WeakSignatureAlgorithm) { … }
TEST_P(CertVerifyProcConstraintsTrustedSelfSignedTest, UnknownExtension) { … }
TEST(CertVerifyProcTest, RejectsPublicSHA1) { … }
TEST(CertVerifyProcTest, RejectsPrivateSHA1UnlessFlag) { … }
enum ExpectedAlgorithms { … };
struct WeakDigestTestData { … };
const char* StringOrDefault(const char* str, const char* default_value) { … }
void PrintTo(const WeakDigestTestData& data, std::ostream* os) { … }
class CertVerifyProcWeakDigestTest
: public testing::TestWithParam<WeakDigestTestData> { … };
TEST_P(CertVerifyProcWeakDigestTest, VerifyDetectsAlgorithm) { … }
const WeakDigestTestData kVerifyRootCATestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyIntermediateCATestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyEndEntityTestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyIncompleteIntermediateTestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyIncompleteEETestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyMixedTestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
const WeakDigestTestData kVerifyTrustedEETestData[] = …;
INSTANTIATE_TEST_SUITE_P(…);
class CertVerifyProcNameTest : public ::testing::Test { … };
TEST_F(CertVerifyProcNameTest, DontMatchCommonName) { … }
TEST_F(CertVerifyProcNameTest, MatchesIpSanIpv4) { … }
TEST_F(CertVerifyProcNameTest, MatchesIpSanIpv6) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchIpSanIpv6) { … }
TEST_F(CertVerifyProcNameTest, MatchesIpSanCompressedIpv6) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchIpSanIPv6Mapped) { … }
TEST_F(CertVerifyProcNameTest, MatchesDnsSan) { … }
TEST_F(CertVerifyProcNameTest, MatchesDnsSanTrailingDot) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchDnsSan) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchDnsSanInvalid) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchDnsSanTwoTrailingDots) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchDnsSanLeadingAndTrailingDot) { … }
TEST_F(CertVerifyProcNameTest, DoesntMatchDnsSanTrailingDot) { … }
TEST(CertVerifyProcTest, HasTrustAnchorVerifyUMA) { … }
TEST(CertVerifyProcTest, LogsOnlyMostSpecificTrustAnchorUMA) { … }
TEST(CertVerifyProcTest, HasTrustAnchorVerifyOutOfDateUMA) { … }
TEST(CertVerifyProcTest, DoesNotRecalculateStapledOCSPResult) { … }
TEST(CertVerifyProcTest, CalculateStapledOCSPResultIfNotAlreadyDone) { … }
}