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

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

Issue 1923433002: Certificate path builder for new certificate verification library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes for comment #16 Created 4 years, 5 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/cert_issuer_source_aia.h" 5 #include "net/cert/internal/cert_issuer_source_aia.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "net/cert/cert_net_fetcher.h" 8 #include "net/cert/cert_net_fetcher.h"
9 #include "net/cert/internal/parsed_certificate.h" 9 #include "net/cert/internal/parsed_certificate.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 19 matching lines...) Expand all
30 std::unique_ptr<CertNetFetcher::Request> cert_fetcher_request); 30 std::unique_ptr<CertNetFetcher::Request> cert_fetcher_request);
31 31
32 void OnFetchCompleted(Error error, const std::vector<uint8_t>& fetched_bytes); 32 void OnFetchCompleted(Error error, const std::vector<uint8_t>& fetched_bytes);
33 33
34 private: 34 private:
35 bool HasNext() const { return current_result_ < results_.size(); } 35 bool HasNext() const { return current_result_ < results_.size(); }
36 36
37 CertIssuerSource::IssuerCallback issuers_callback_; 37 CertIssuerSource::IssuerCallback issuers_callback_;
38 std::vector<std::unique_ptr<CertNetFetcher::Request>> cert_fetcher_requests_; 38 std::vector<std::unique_ptr<CertNetFetcher::Request>> cert_fetcher_requests_;
39 size_t pending_requests_ = 0; 39 size_t pending_requests_ = 0;
40 std::vector<scoped_refptr<ParsedCertificate>> results_; 40 ParsedCertificateList results_;
41 size_t current_result_ = 0; 41 size_t current_result_ = 0;
42 42
43 DISALLOW_COPY_AND_ASSIGN(AiaRequest); 43 DISALLOW_COPY_AND_ASSIGN(AiaRequest);
44 }; 44 };
45 45
46 AiaRequest::AiaRequest(const CertIssuerSource::IssuerCallback& issuers_callback) 46 AiaRequest::AiaRequest(const CertIssuerSource::IssuerCallback& issuers_callback)
47 : issuers_callback_(issuers_callback) {} 47 : issuers_callback_(issuers_callback) {}
48 48
49 AiaRequest::~AiaRequest() = default; 49 AiaRequest::~AiaRequest() = default;
50 50
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 issuers_callback_.Run(this); 102 issuers_callback_.Run(this);
103 } 103 }
104 104
105 } // namespace 105 } // namespace
106 106
107 CertIssuerSourceAia::CertIssuerSourceAia(CertNetFetcher* cert_fetcher) 107 CertIssuerSourceAia::CertIssuerSourceAia(CertNetFetcher* cert_fetcher)
108 : cert_fetcher_(cert_fetcher) {} 108 : cert_fetcher_(cert_fetcher) {}
109 109
110 CertIssuerSourceAia::~CertIssuerSourceAia() = default; 110 CertIssuerSourceAia::~CertIssuerSourceAia() = default;
111 111
112 void CertIssuerSourceAia::SyncGetIssuersOf( 112 void CertIssuerSourceAia::SyncGetIssuersOf(const ParsedCertificate* cert,
113 const ParsedCertificate* cert, 113 ParsedCertificateList* issuers) {
114 std::vector<scoped_refptr<ParsedCertificate>>* issuers) {
115 // CertIssuerSourceAia never returns synchronous results. 114 // CertIssuerSourceAia never returns synchronous results.
116 } 115 }
117 116
118 void CertIssuerSourceAia::AsyncGetIssuersOf( 117 void CertIssuerSourceAia::AsyncGetIssuersOf(
119 const ParsedCertificate* cert, 118 const ParsedCertificate* cert,
120 const IssuerCallback& issuers_callback, 119 const IssuerCallback& issuers_callback,
121 std::unique_ptr<Request>* out_req) { 120 std::unique_ptr<Request>* out_req) {
122 out_req->reset(); 121 out_req->reset();
123 122
124 if (!cert->has_authority_info_access()) 123 if (!cert->has_authority_info_access())
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 aia_request->AddCertFetcherRequest(cert_fetcher_->FetchCaIssuers( 159 aia_request->AddCertFetcherRequest(cert_fetcher_->FetchCaIssuers(
161 url, kTimeoutMilliseconds, kMaxResponseBytes, 160 url, kTimeoutMilliseconds, kMaxResponseBytes,
162 base::Bind(&AiaRequest::OnFetchCompleted, 161 base::Bind(&AiaRequest::OnFetchCompleted,
163 base::Unretained(aia_request.get())))); 162 base::Unretained(aia_request.get()))));
164 } 163 }
165 164
166 *out_req = std::move(aia_request); 165 *out_req = std::move(aia_request);
167 } 166 }
168 167
169 } // namespace net 168 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698