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

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

Issue 2923903002: Reject certificates that contain unknown policy qualifiers if the (Closed)
Patch Set: update ios files Created 3 years, 6 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/parsed_certificate.h" 5 #include "net/cert/internal/parsed_certificate.h"
6 6
7 #include "net/cert/internal/certificate_policies.h" 7 #include "net/cert/internal/certificate_policies.h"
8 #include "net/cert/internal/extended_key_usage.h" 8 #include "net/cert/internal/extended_key_usage.h"
9 #include "net/cert/internal/name_constraints.h" 9 #include "net/cert/internal/name_constraints.h"
10 #include "net/cert/internal/signature_algorithm.h" 10 #include "net/cert/internal/signature_algorithm.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 result->has_authority_info_access_ = true; 182 result->has_authority_info_access_ = true;
183 if (!ParseAuthorityInfoAccess( 183 if (!ParseAuthorityInfoAccess(
184 result->authority_info_access_extension_.value, 184 result->authority_info_access_extension_.value,
185 &result->ca_issuers_uris_, &result->ocsp_uris_)) 185 &result->ca_issuers_uris_, &result->ocsp_uris_))
186 return nullptr; 186 return nullptr;
187 } 187 }
188 188
189 // Policies. 189 // Policies.
190 if (result->GetExtension(CertificatePoliciesOid(), &extension)) { 190 if (result->GetExtension(CertificatePoliciesOid(), &extension)) {
191 result->has_policy_oids_ = true; 191 result->has_policy_oids_ = true;
192 if (!ParseCertificatePoliciesExtension(extension.value, 192 if (!ParseCertificatePoliciesExtension(
193 &result->policy_oids_)) { 193 extension.value, false /*fail_parsing_unknown_qualifier_oids*/,
194 &result->policy_oids_)) {
194 return nullptr; 195 return nullptr;
195 } 196 }
196 } 197 }
197 198
198 // Policy constraints. 199 // Policy constraints.
199 if (result->GetExtension(PolicyConstraintsOid(), &extension)) { 200 if (result->GetExtension(PolicyConstraintsOid(), &extension)) {
200 result->has_policy_constraints_ = true; 201 result->has_policy_constraints_ = true;
201 if (!ParsePolicyConstraints(extension.value, 202 if (!ParsePolicyConstraints(extension.value,
202 &result->policy_constraints_)) { 203 &result->policy_constraints_)) {
203 return nullptr; 204 return nullptr;
(...skipping 15 matching lines...) Expand all
219 &result->inhibit_any_policy_)) { 220 &result->inhibit_any_policy_)) {
220 return nullptr; 221 return nullptr;
221 } 222 }
222 } 223 }
223 } 224 }
224 225
225 return result; 226 return result;
226 } 227 }
227 228
228 } // namespace net 229 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/certificate_policies_unittest.cc ('k') | net/cert/internal/verify_certificate_chain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698