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

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

Issue 2327973002: Add CertErrors* parameter to the main Certificate parsing functions. (Closed)
Patch Set: nullptr Created 4 years, 3 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/x509_util.h" 5 #include "net/cert/x509_util.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "crypto/ec_private_key.h" 10 #include "crypto/ec_private_key.h"
11 #include "crypto/rsa_private_key.h" 11 #include "crypto/rsa_private_key.h"
12 #include "net/base/hash_value.h" 12 #include "net/base/hash_value.h"
13 #include "net/cert/internal/cert_errors.h"
mattm 2016/09/13 22:27:38 unused
eroman 2016/09/13 22:47:30 Done.
13 #include "net/cert/internal/name_constraints.h" 14 #include "net/cert/internal/name_constraints.h"
14 #include "net/cert/internal/parse_certificate.h" 15 #include "net/cert/internal/parse_certificate.h"
15 #include "net/cert/internal/parse_name.h" 16 #include "net/cert/internal/parse_name.h"
16 #include "net/cert/internal/signature_algorithm.h" 17 #include "net/cert/internal/signature_algorithm.h"
17 #include "net/cert/x509_certificate.h" 18 #include "net/cert/x509_certificate.h"
18 #include "net/der/input.h" 19 #include "net/der/input.h"
19 #include "net/der/parse_values.h" 20 #include "net/der/parse_values.h"
20 21
21 namespace net { 22 namespace net {
22 23
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 bool ParseCertificateSandboxed(const base::StringPiece& certificate, 121 bool ParseCertificateSandboxed(const base::StringPiece& certificate,
121 std::string* subject, 122 std::string* subject,
122 std::string* issuer, 123 std::string* issuer,
123 base::Time* not_before, 124 base::Time* not_before,
124 base::Time* not_after, 125 base::Time* not_after,
125 std::vector<std::string>* dns_names, 126 std::vector<std::string>* dns_names,
126 std::vector<std::string>* ip_addresses) { 127 std::vector<std::string>* ip_addresses) {
127 der::Input cert_data(certificate); 128 der::Input cert_data(certificate);
128 der::Input tbs_cert, signature_alg; 129 der::Input tbs_cert, signature_alg;
129 der::BitString signature_value; 130 der::BitString signature_value;
130 if (!ParseCertificate(cert_data, &tbs_cert, &signature_alg, &signature_value)) 131 CertErrors errors;
mattm 2016/09/13 22:27:38 unused
eroman 2016/09/13 22:47:30 Done.
132 if (!ParseCertificate(cert_data, &tbs_cert, &signature_alg, &signature_value,
133 nullptr))
131 return false; 134 return false;
132 135
133 ParsedTbsCertificate parsed_tbs_cert; 136 ParsedTbsCertificate parsed_tbs_cert;
134 if (!ParseTbsCertificate(tbs_cert, ParseCertificateOptions(), 137 if (!ParseTbsCertificate(tbs_cert, ParseCertificateOptions(),
135 &parsed_tbs_cert)) 138 &parsed_tbs_cert))
136 return false; 139 return false;
137 140
138 if (!GetCommonName(parsed_tbs_cert.subject_tlv, subject)) 141 if (!GetCommonName(parsed_tbs_cert.subject_tlv, subject))
139 return false; 142 return false;
140 143
(...skipping 24 matching lines...) Expand all
165 ip_addresses->push_back(ip.ToString()); 168 ip_addresses->push_back(ip.ToString());
166 } 169 }
167 } 170 }
168 171
169 return true; 172 return true;
170 } 173 }
171 174
172 } // namespace x509_util 175 } // namespace x509_util
173 176
174 } // namespace net 177 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/verify_certificate_chain_pkits_unittest.cc ('k') | net/cert/x509_util_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698