#include "verify_certificate_chain.h"
#include <algorithm>
#include <cassert>
#include <openssl/base.h>
#include "cert_error_params.h"
#include "cert_errors.h"
#include "common_cert_errors.h"
#include "extended_key_usage.h"
#include "input.h"
#include "name_constraints.h"
#include "parse_certificate.h"
#include "signature_algorithm.h"
#include "trust_store.h"
#include "verify_signed_data.h"
BSSL_NAMESPACE_BEGIN
namespace {
bool IsHandledCriticalExtension(const ParsedExtension &extension,
const ParsedCertificate &cert) { … }
void VerifyNoUnconsumedCriticalExtensions(const ParsedCertificate &cert,
CertErrors *errors,
bool allow_precertificate) { … }
[[nodiscard]] bool IsSelfIssued(const ParsedCertificate &cert) { … }
void VerifyTimeValidity(const ParsedCertificate &cert,
const der::GeneralizedTime &time, CertErrors *errors) { … }
bool VerifySignatureAlgorithmsMatch(const ParsedCertificate &cert,
CertErrors *errors) { … }
void VerifyExtendedKeyUsage(const ParsedCertificate &cert,
KeyPurpose required_key_purpose, CertErrors *errors,
bool is_target_cert, bool is_target_cert_issuer) { … }
class ValidPolicyGraph { … };
class PathVerifier { … };
void PathVerifier::VerifyPolicies(const ParsedCertificate &cert,
bool is_target_cert, CertErrors *errors) { … }
void PathVerifier::VerifyPolicyMappings(const ParsedCertificate &cert,
CertErrors *errors) { … }
void PathVerifier::ApplyPolicyConstraints(const ParsedCertificate &cert) { … }
void PathVerifier::BasicCertificateProcessing(
const ParsedCertificate &cert, bool is_target_cert,
bool is_target_cert_issuer, const der::GeneralizedTime &time,
KeyPurpose required_key_purpose, CertErrors *errors,
bool *shortcircuit_chain_validation) { … }
void PathVerifier::PrepareForNextCertificate(const ParsedCertificate &cert,
CertErrors *errors) { … }
void VerifyTargetCertIsNotCA(const ParsedCertificate &cert,
KeyPurpose required_key_purpose,
CertErrors *errors) { … }
void PathVerifier::WrapUp(const ParsedCertificate &cert,
KeyPurpose required_key_purpose,
const std::set<der::Input> &user_initial_policy_set,
bool allow_precertificate,
CertErrors * errors) { … }
void PathVerifier::ApplyTrustAnchorConstraints(const ParsedCertificate &cert,
KeyPurpose required_key_purpose,
CertErrors *errors) { … }
void PathVerifier::ProcessRootCertificate(const ParsedCertificate &cert,
const CertificateTrust &trust,
const der::GeneralizedTime &time,
KeyPurpose required_key_purpose,
CertErrors *errors,
bool *shortcircuit_chain_validation) { … }
void PathVerifier::ProcessSingleCertChain(const ParsedCertificate &cert,
const CertificateTrust &trust,
const der::GeneralizedTime &time,
KeyPurpose required_key_purpose,
CertErrors *errors) { … }
bssl::UniquePtr<EVP_PKEY> PathVerifier::ParseAndCheckPublicKey(
der::Input spki, CertErrors *errors) { … }
void PathVerifier::Run(
const ParsedCertificateList &certs, const CertificateTrust &last_cert_trust,
VerifyCertificateChainDelegate *delegate, const der::GeneralizedTime &time,
KeyPurpose required_key_purpose,
InitialExplicitPolicy initial_explicit_policy,
const std::set<der::Input> &user_initial_policy_set,
InitialPolicyMappingInhibit initial_policy_mapping_inhibit,
InitialAnyPolicyInhibit initial_any_policy_inhibit,
std::set<der::Input> *user_constrained_policy_set, CertPathErrors *errors) { … }
}
VerifyCertificateChainDelegate::~VerifyCertificateChainDelegate() = default;
void VerifyCertificateChain(
const ParsedCertificateList &certs, const CertificateTrust &last_cert_trust,
VerifyCertificateChainDelegate *delegate, const der::GeneralizedTime &time,
KeyPurpose required_key_purpose,
InitialExplicitPolicy initial_explicit_policy,
const std::set<der::Input> &user_initial_policy_set,
InitialPolicyMappingInhibit initial_policy_mapping_inhibit,
InitialAnyPolicyInhibit initial_any_policy_inhibit,
std::set<der::Input> *user_constrained_policy_set, CertPathErrors *errors) { … }
bool VerifyCertificateIsSelfSigned(const ParsedCertificate &cert,
SignatureVerifyCache *cache,
CertErrors *errors) { … }
BSSL_NAMESPACE_END