/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdefined(_MSC_VER) # pragma warning(push) // Silence "RootingAPI.h(718): warning C4324: 'js::DispatchWrapper<T>': // structure was padded due to alignment specifier with [ T=void * ]" # pragma warning(disable : 4324) #endif/* defined(_MSC_VER) */ #include"mozilla/BasePrincipal.h" #ifdefined(_MSC_VER) # pragma warning(pop) /* popping the pragma in this file */ #endif/* defined(_MSC_VER) */
namespace mozilla { namespace ct {
// Including the headers of the classes below would bring along all of their // dependent headers and force us to export them in moz.build. // Just forward-declare the classes here instead. class MultiLogCTVerifier;
// Describes the source of the associated issuer. enumclass IssuerSource {
TLSHandshake, // included by the peer in the TLS handshake
PreloadedIntermediates, // a preloaded intermediate (via remote settings)
ThirdPartyCertificates, // a third-party certificate gleaned from the OS
NSSCertDB, // a certificate found in the profile's NSS certificate DB
BuiltInRootsModule, // a root from the built-in roots module
};
// Should we accumulate pinning telemetry for the result? bool accumulateResult;
Maybe<Telemetry::HistogramID> certPinningResultHistogram;
int32_t certPinningResultBucket; // Should we accumulate telemetry for the root? bool accumulateForRoot;
int32_t rootBucket;
// Was CT enabled? bool enabled; // Verification result of the processed SCTs.
mozilla::ct::CTVerifyResult verifyResult; // Connection compliance to the CT Policy.
Maybe<mozilla::ct::CTPolicyCompliance> policyCompliance;
// The signature scheme to be used in CertVerify. This tells us // whether to interpret |authKeyBits| in an RSA or ECDSA context.
SSLSignatureScheme scheme;
// The size of the key, in bits.
uint32_t authKeyBits;
};
class SkipInvalidSANsForNonBuiltInRootsPolicy
: public pkix::NameMatchingPolicy { public: explicit SkipInvalidSANsForNonBuiltInRootsPolicy(bool rootIsBuiltIn)
: mRootIsBuiltIn(rootIsBuiltIn) {}
class CertVerifier { public: typedefunsignedint Flags; // XXX: FLAG_LOCAL_ONLY is ignored in the classic verification case staticconst Flags FLAG_LOCAL_ONLY; // Don't perform fallback DV validation on EV validation failure. staticconst Flags FLAG_MUST_BE_EV; // TLS feature request_status should be ignored staticconst Flags FLAG_TLS_IGNORE_STATUS_REQUEST;
// These values correspond to the SSL_OCSP_STAPLING telemetry. enum OCSPStaplingStatus {
OCSP_STAPLING_NEVER_CHECKED = 0,
OCSP_STAPLING_GOOD = 1,
OCSP_STAPLING_NONE = 2,
OCSP_STAPLING_EXPIRED = 3,
OCSP_STAPLING_INVALID = 4,
};
private:
OCSPCache mOCSPCache; // We keep a copy of the bytes of each third party root to own.
nsTArray<EnterpriseCert> mThirdPartyCerts; // This is a reusable, precomputed list of Inputs corresponding to each root // in mThirdPartyCerts that wasn't too long to make an Input out of.
nsTArray<mozilla::pkix::Input> mThirdPartyRootInputs; // Similarly, but with intermediates.
nsTArray<mozilla::pkix::Input> mThirdPartyIntermediateInputs;
// We only have a forward declarations of these classes (see above) // so we must allocate dynamically.
UniquePtr<mozilla::ct::MultiLogCTVerifier> mCTVerifier;
// If many connections are made to a site using a particular certificate, // this cache will speed up verifications after the first one by saving the // results of signature verification. // This will also be beneficial in situations where different sites use // different certificates that happen to be issued by the same intermediate.
UniquePtr<SignatureCache, decltype(&signature_cache_free)> mSignatureCache; // Similarly, this caches the results of looking up the trust of a // certificate in NSS, which is slow.
UniquePtr<TrustCache, decltype(&trust_cache_free)> mTrustCache;
// Verify signed data, making use of the given SignatureCache. That is, if the // (data, digestAlgorithm, signature, subjectPublicKeyInfo) tuple has already // been verified and is in the cache, this skips the work of verifying the // signature (which is slow) and returns the already-known result.
mozilla::pkix::Result VerifySignedDataWithCache(
mozilla::pkix::der::PublicKeyAlgorithm publicKeyAlg,
mozilla::glean::impl::DenominatorMetric telemetryDenominator,
mozilla::glean::impl::NumeratorMetric telemetryNumerator,
mozilla::pkix::Input data, mozilla::pkix::DigestAlgorithm digestAlgorithm,
mozilla::pkix::Input signature, mozilla::pkix::Input subjectPublicKeyInfo,
SignatureCache* signatureCache, void* pinArg);
} // namespace psm
} // namespace mozilla
#endif// CertVerifier_h
¤ Dauer der Verarbeitung: 0.30 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.