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

Side by Side Diff: net/cert/cert_verify_proc_android.cc

Issue 2682733003: Add AIA fetching feature info to certificate reports (Closed)
Patch Set: Add UMA statistic for AIA fetches Created 3 years, 10 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 (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
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
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
OLDNEW
« no previous file with comments | « components/certificate_reporting/error_report_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698