| 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/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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // certificates MUST be able to accept individual DER encoded | 82 // certificates MUST be able to accept individual DER encoded |
| 83 // certificates and SHOULD be able to accept "certs-only" CMS messages. | 83 // certificates and SHOULD be able to accept "certs-only" CMS messages. |
| 84 // | 84 // |
| 85 // TODO(mattm): Is supporting CMS message format important? | 85 // TODO(mattm): Is supporting CMS message format important? |
| 86 // | 86 // |
| 87 // TODO(mattm): Avoid copying bytes. Change the CertNetFetcher and | 87 // TODO(mattm): Avoid copying bytes. Change the CertNetFetcher and |
| 88 // ParsedCertificate interface to allow passing through ownership of the | 88 // ParsedCertificate interface to allow passing through ownership of the |
| 89 // bytes. | 89 // bytes. |
| 90 if (!ParsedCertificate::CreateAndAddToVector( | 90 if (!ParsedCertificate::CreateAndAddToVector( |
| 91 fetched_bytes.data(), fetched_bytes.size(), | 91 fetched_bytes.data(), fetched_bytes.size(), |
| 92 ParsedCertificate::DataSource::INTERNAL_COPY, &results_)) { | 92 ParsedCertificate::DataSource::INTERNAL_COPY, {}, &results_)) { |
| 93 // TODO(mattm): propagate error info. | 93 // TODO(mattm): propagate error info. |
| 94 LOG(ERROR) << "Error parsing AIA data"; | 94 LOG(ERROR) << "Error parsing AIA data"; |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 // If the client is waiting for results, need to run callback if: | 97 // If the client is waiting for results, need to run callback if: |
| 98 // * Some are available now. | 98 // * Some are available now. |
| 99 // * The last fetch finished, even with no results. (Client needs to know to | 99 // * The last fetch finished, even with no results. (Client needs to know to |
| 100 // stop waiting.) | 100 // stop waiting.) |
| 101 if (client_waiting_for_callback && (HasNext() || pending_requests_ == 0)) | 101 if (client_waiting_for_callback && (HasNext() || pending_requests_ == 0)) |
| 102 issuers_callback_.Run(this); | 102 issuers_callback_.Run(this); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 aia_request->AddCertFetcherRequest(cert_fetcher_->FetchCaIssuers( | 160 aia_request->AddCertFetcherRequest(cert_fetcher_->FetchCaIssuers( |
| 161 url, kTimeoutMilliseconds, kMaxResponseBytes, | 161 url, kTimeoutMilliseconds, kMaxResponseBytes, |
| 162 base::Bind(&AiaRequest::OnFetchCompleted, | 162 base::Bind(&AiaRequest::OnFetchCompleted, |
| 163 base::Unretained(aia_request.get())))); | 163 base::Unretained(aia_request.get())))); |
| 164 } | 164 } |
| 165 | 165 |
| 166 *out_req = std::move(aia_request); | 166 *out_req = std::move(aia_request); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace net | 169 } // namespace net |
| OLD | NEW |