Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(935)

Unified Diff: net/cert/internal/trust_store.cc

Issue 2126803004: WIP: NSS trust store integration for path builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-command-line-path-builder-add_certpathbuilder
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/trust_store.h ('k') | net/cert/internal/trust_store_collection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/trust_store.cc
diff --git a/net/cert/internal/trust_store.cc b/net/cert/internal/trust_store.cc
deleted file mode 100644
index d46933b14e4c33dbd905788beb3fde7f2c137c89..0000000000000000000000000000000000000000
--- a/net/cert/internal/trust_store.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/cert/internal/trust_store.h"
-
-namespace net {
-
-TrustStore::TrustStore() {}
-TrustStore::~TrustStore() {}
-
-void TrustStore::Clear() {
- anchors_.clear();
-}
-
-void TrustStore::AddTrustedCertificate(
- scoped_refptr<ParsedCertificate> anchor) {
- // TODO(mattm): should this check for duplicate certs?
- anchors_.insert(std::make_pair(anchor->normalized_subject().AsStringPiece(),
- std::move(anchor)));
-}
-
-void TrustStore::FindTrustAnchorsByNormalizedName(
- const der::Input& normalized_name,
- ParsedCertificateList* matches) const {
- auto range = anchors_.equal_range(normalized_name.AsStringPiece());
- for (auto it = range.first; it != range.second; ++it)
- matches->push_back(it->second);
-}
-
-bool TrustStore::IsTrustedCertificate(const ParsedCertificate* cert) const {
- auto range = anchors_.equal_range(cert->normalized_subject().AsStringPiece());
- for (auto it = range.first; it != range.second; ++it) {
- // First compare the ParsedCertificate pointers as an optimization.
- if (it->second == cert ||
- // Trust check is based on Name+SPKI match. This could match the same
- // certificate stored in a different ParsedCertificate object, or a
- // different cert that has the same Name+SPKI.
- (it->second->normalized_subject() == cert->normalized_subject() &&
- it->second->tbs().spki_tlv == cert->tbs().spki_tlv))
- return true;
- }
- return false;
-}
-
-} // namespace net
« no previous file with comments | « net/cert/internal/trust_store.h ('k') | net/cert/internal/trust_store_collection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698