| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cert_verify_proc_android.h" | 5 #include "net/cert/cert_verify_proc_android.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 base::StringPiece uri, | 99 base::StringPiece uri, |
| 100 ParsedCertificateList* cert_list) { | 100 ParsedCertificateList* cert_list) { |
| 101 GURL url(uri); | 101 GURL url(uri); |
| 102 if (!url.is_valid()) | 102 if (!url.is_valid()) |
| 103 return false; | 103 return false; |
| 104 std::unique_ptr<CertNetFetcher::Request> request(fetcher->FetchCaIssuers( | 104 std::unique_ptr<CertNetFetcher::Request> request(fetcher->FetchCaIssuers( |
| 105 url, CertNetFetcher::DEFAULT, CertNetFetcher::DEFAULT)); | 105 url, CertNetFetcher::DEFAULT, CertNetFetcher::DEFAULT)); |
| 106 Error error; | 106 Error error; |
| 107 std::vector<uint8_t> aia_fetch_bytes; | 107 std::vector<uint8_t> aia_fetch_bytes; |
| 108 request->WaitForResult(&error, &aia_fetch_bytes); | 108 request->WaitForResult(&error, &aia_fetch_bytes); |
| 109 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.Certificate.AndroidAIAFetchError", |
| 110 std::abs(error)); |
| 109 if (error != OK) | 111 if (error != OK) |
| 110 return false; | 112 return false; |
| 111 CertErrors errors; | 113 CertErrors errors; |
| 112 return ParsedCertificate::CreateAndAddToVector( | 114 return ParsedCertificate::CreateAndAddToVector( |
| 113 aia_fetch_bytes.data(), aia_fetch_bytes.size(), {}, cert_list, &errors); | 115 aia_fetch_bytes.data(), aia_fetch_bytes.size(), {}, cert_list, &errors); |
| 114 } | 116 } |
| 115 | 117 |
| 116 // Uses android::VerifyX509CertChain() to verify the certificates in |certs| for | 118 // Uses android::VerifyX509CertChain() to verify the certificates in |certs| for |
| 117 // |hostname| and returns the verification status. If the verification was | 119 // |hostname| and returns the verification status. If the verification was |
| 118 // successful, this function populates |verify_result| and |verified_chain|; | 120 // successful, this function populates |verify_result| and |verified_chain|; |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 NOTREACHED(); | 399 NOTREACHED(); |
| 398 return ERR_FAILED; | 400 return ERR_FAILED; |
| 399 } | 401 } |
| 400 if (IsCertStatusError(verify_result->cert_status)) | 402 if (IsCertStatusError(verify_result->cert_status)) |
| 401 return MapCertStatusToNetError(verify_result->cert_status); | 403 return MapCertStatusToNetError(verify_result->cert_status); |
| 402 | 404 |
| 403 return OK; | 405 return OK; |
| 404 } | 406 } |
| 405 | 407 |
| 406 } // namespace net | 408 } // namespace net |
| OLD | NEW |