| OLD | NEW |
| 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 Loading... |
| 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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 741 |
| 742 void CertPathBuilder::AddResultPath(std::unique_ptr<ResultPath> result_path) { | 742 void CertPathBuilder::AddResultPath(std::unique_ptr<ResultPath> result_path) { |
| 743 // TODO(mattm): set best_result_index based on number or severity of errors. | 743 // TODO(mattm): set best_result_index based on number or severity of errors. |
| 744 if (result_path->valid) | 744 if (result_path->valid) |
| 745 out_result_->best_result_index = out_result_->paths.size(); | 745 out_result_->best_result_index = out_result_->paths.size(); |
| 746 // TODO(mattm): add flag to only return a single path or all attempted paths? | 746 // TODO(mattm): add flag to only return a single path or all attempted paths? |
| 747 out_result_->paths.push_back(std::move(result_path)); | 747 out_result_->paths.push_back(std::move(result_path)); |
| 748 } | 748 } |
| 749 | 749 |
| 750 } // namespace net | 750 } // namespace net |
| OLD | NEW |