| Index: net/cert/internal/verify_certificate_chain.cc
|
| diff --git a/net/cert/internal/verify_certificate_chain.cc b/net/cert/internal/verify_certificate_chain.cc
|
| index f6a45b2435cc41cb96bcbd3da6b3aba91b758a79..3ace2bf4d4c7e792e552d9c475add9117806b783 100644
|
| --- a/net/cert/internal/verify_certificate_chain.cc
|
| +++ b/net/cert/internal/verify_certificate_chain.cc
|
| @@ -336,9 +336,6 @@ WARN_UNUSED_RESULT bool WrapUp(const ParsedCertificate& cert) {
|
|
|
| } // namespace
|
|
|
| -// TODO(eroman): Move this into existing anonymous namespace.
|
| -namespace {
|
| -
|
| // This implementation is structured to mimic the description of certificate
|
| // path verification given by RFC 5280 section 6.1.
|
| //
|
| @@ -450,52 +447,4 @@ bool VerifyCertificateChainAssumingTrustedRoot(
|
| return true;
|
| }
|
|
|
| -// TODO(eroman): This function is a temporary hack in the absence of full
|
| -// path building. It may insert 1 certificate at the root of the
|
| -// chain to ensure that the path's root certificate is a trust anchor.
|
| -//
|
| -// Beyond this no other verification is done on the chain. The caller is
|
| -// responsible for verifying the subsequent chain's correctness.
|
| -WARN_UNUSED_RESULT bool BuildSimplePathToTrustAnchor(
|
| - const TrustStore& trust_store,
|
| - std::vector<scoped_refptr<ParsedCertificate>>* certs) {
|
| - if (certs->empty())
|
| - return false;
|
| -
|
| - // Check if the current root certificate is trusted. If it is then no
|
| - // extra work is needed.
|
| - if (trust_store.IsTrustedCertificate(certs->back().get()))
|
| - return true;
|
| -
|
| - std::vector<scoped_refptr<ParsedCertificate>> trust_anchors;
|
| - trust_store.FindTrustAnchorsByNormalizedName(
|
| - certs->back()->normalized_issuer(), &trust_anchors);
|
| - if (trust_anchors.empty())
|
| - return false;
|
| - // TODO(mattm): this only tries the first match, even if there are multiple.
|
| - certs->push_back(std::move(trust_anchors[0]));
|
| - return true;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -bool VerifyCertificateChain(
|
| - const std::vector<scoped_refptr<ParsedCertificate>>& cert_chain,
|
| - const TrustStore& trust_store,
|
| - const SignaturePolicy* signature_policy,
|
| - const der::GeneralizedTime& time) {
|
| - if (cert_chain.empty())
|
| - return false;
|
| -
|
| - std::vector<scoped_refptr<ParsedCertificate>> full_chain = cert_chain;
|
| -
|
| - // Modify the certificate chain so that its root is a trusted certificate.
|
| - if (!BuildSimplePathToTrustAnchor(trust_store, &full_chain))
|
| - return false;
|
| -
|
| - // Verify the chain.
|
| - return VerifyCertificateChainAssumingTrustedRoot(full_chain, trust_store,
|
| - signature_policy, time);
|
| -}
|
| -
|
| } // namespace net
|
|
|