| 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_mac.h" | 5 #include "net/cert/cert_verify_proc_mac.h" |
| 6 | 6 |
| 7 #include <CommonCrypto/CommonDigest.h> | 7 #include <CommonCrypto/CommonDigest.h> |
| 8 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 } | 331 } |
| 332 | 332 |
| 333 std::vector<der::Input> policies; | 333 std::vector<der::Input> policies; |
| 334 if (!ParseCertificatePoliciesExtension(extension_value, &policies)) | 334 if (!ParseCertificatePoliciesExtension(extension_value, &policies)) |
| 335 return; | 335 return; |
| 336 | 336 |
| 337 EVRootCAMetadata* metadata = EVRootCAMetadata::GetInstance(); | 337 EVRootCAMetadata* metadata = EVRootCAMetadata::GetInstance(); |
| 338 for (const der::Input& policy_oid : policies) { | 338 for (const der::Input& policy_oid : policies) { |
| 339 if (metadata->IsEVPolicyOID(policy_oid)) { | 339 if (metadata->IsEVPolicyOID(policy_oid)) { |
| 340 *ev_policy_oid = policy_oid.AsString(); | 340 *ev_policy_oid = policy_oid.AsString(); |
| 341 return; | 341 |
| 342 // De-prioritize the CA/Browser forum Extended Validation policy |
| 343 // (2.23.140.1.1). See crbug.com/705285. |
| 344 if (!EVRootCAMetadata::IsCaBrowserForumEvOid(policy_oid)) |
| 345 break; |
| 342 } | 346 } |
| 343 } | 347 } |
| 344 } | 348 } |
| 345 | 349 |
| 346 // Checks that the certificate chain of |cert| has policies consistent with | 350 // Checks that the certificate chain of |cert| has policies consistent with |
| 347 // |ev_policy_oid_string|. The leaf is not checked, as it is assumed that is | 351 // |ev_policy_oid_string|. The leaf is not checked, as it is assumed that is |
| 348 // where the policy came from. | 352 // where the policy came from. |
| 349 bool CheckCertChainEV(const X509Certificate* cert, | 353 bool CheckCertChainEV(const X509Certificate* cert, |
| 350 const std::string& ev_policy_oid_string) { | 354 const std::string& ev_policy_oid_string) { |
| 351 der::Input ev_policy_oid(&ev_policy_oid_string); | 355 der::Input ev_policy_oid(&ev_policy_oid_string); |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 // EV cert and it was covered by CRLSets or revocation checking passed. | 1100 // EV cert and it was covered by CRLSets or revocation checking passed. |
| 1097 verify_result->cert_status |= CERT_STATUS_IS_EV; | 1101 verify_result->cert_status |= CERT_STATUS_IS_EV; |
| 1098 } | 1102 } |
| 1099 | 1103 |
| 1100 return OK; | 1104 return OK; |
| 1101 } | 1105 } |
| 1102 | 1106 |
| 1103 } // namespace net | 1107 } // namespace net |
| 1104 | 1108 |
| 1105 #pragma clang diagnostic pop // "-Wdeprecated-declarations" | 1109 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| OLD | NEW |