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

Side by Side Diff: net/cert/internal/path_builder.cc

Issue 2272493002: Add TrustStoreNSS and TrustStoreCollection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-trust-store-interface3-nss
Patch Set: review changes Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/cert/internal/path_builder.h" 5 #include "net/cert/internal/path_builder.h"
6 6
7 #include <set> 7 #include <set>
8 #include <unordered_set> 8 #include <unordered_set>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 CompletionStatus CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out, 148 CompletionStatus CertIssuersIter::GetNextIssuer(CertificateOrTrustAnchor* out,
149 const base::Closure& callback) { 149 const base::Closure& callback) {
150 // Should not be called again while already waiting for an async result. 150 // Should not be called again while already waiting for an async result.
151 DCHECK(callback_.is_null()); 151 DCHECK(callback_.is_null());
152 152
153 if (!did_initial_query_) { 153 if (!did_initial_query_) {
154 did_initial_query_ = true; 154 did_initial_query_ = true;
155 trust_store_->FindTrustAnchorsForCert( 155 trust_store_->FindTrustAnchorsForCert(
156 cert_.get(), 156 cert_,
157 callback.is_null() ? TrustStore::TrustAnchorsCallback() 157 callback.is_null() ? TrustStore::TrustAnchorsCallback()
158 : base::Bind(&CertIssuersIter::GotAsyncAnchors, 158 : base::Bind(&CertIssuersIter::GotAsyncAnchors,
159 base::Unretained(this)), 159 base::Unretained(this)),
160 &anchors_, &pending_anchor_request_); 160 &anchors_, &pending_anchor_request_);
161 161
162 for (auto* cert_issuer_source : *cert_issuer_sources_) { 162 for (auto* cert_issuer_source : *cert_issuer_sources_) {
163 ParsedCertificateList new_issuers; 163 ParsedCertificateList new_issuers;
164 cert_issuer_source->SyncGetIssuersOf(cert(), &new_issuers); 164 cert_issuer_source->SyncGetIssuersOf(cert(), &new_issuers);
165 for (scoped_refptr<ParsedCertificate>& issuer : new_issuers) { 165 for (scoped_refptr<ParsedCertificate>& issuer : new_issuers) {
166 if (present_issuers_.find(issuer->der_cert().AsStringPiece()) != 166 if (present_issuers_.find(issuer->der_cert().AsStringPiece()) !=
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 result_path->error = is_success ? OK : ERR_CERT_AUTHORITY_INVALID; 723 result_path->error = is_success ? OK : ERR_CERT_AUTHORITY_INVALID;
724 // TODO(mattm): set best_result_index based on number or severity of errors. 724 // TODO(mattm): set best_result_index based on number or severity of errors.
725 if (result_path->error == OK) 725 if (result_path->error == OK)
726 out_result_->best_result_index = out_result_->paths.size(); 726 out_result_->best_result_index = out_result_->paths.size();
727 // TODO(mattm): add flag to only return a single path or all attempted paths? 727 // TODO(mattm): add flag to only return a single path or all attempted paths?
728 result_path->path = path; 728 result_path->path = path;
729 out_result_->paths.push_back(std::move(result_path)); 729 out_result_->paths.push_back(std::move(result_path));
730 } 730 }
731 731
732 } // namespace net 732 } // namespace net
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/cert/internal/trust_store.h » ('j') | net/cert/internal/trust_store.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698