| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 5 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 6 | 6 |
| 7 #include "crypto/nss_util_internal.h" | 7 #include "crypto/nss_util_internal.h" |
| 8 #include "crypto/scoped_test_nss_chromeos_user.h" | 8 #include "crypto/scoped_test_nss_chromeos_user.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/base/test_data_directory.h" | 10 #include "net/base/test_data_directory.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 ASSERT_EQ("E Root CA", root_2_[0]->subject().common_name); | 73 ASSERT_EQ("E Root CA", root_2_[0]->subject().common_name); |
| 74 } | 74 } |
| 75 | 75 |
| 76 int VerifyWithAdditionalTrustAnchors( | 76 int VerifyWithAdditionalTrustAnchors( |
| 77 net::CertVerifyProc* verify_proc, | 77 net::CertVerifyProc* verify_proc, |
| 78 const net::CertificateList& additional_trust_anchors, | 78 const net::CertificateList& additional_trust_anchors, |
| 79 net::X509Certificate* cert, | 79 net::X509Certificate* cert, |
| 80 std::string* root_subject_name) { | 80 std::string* root_subject_name) { |
| 81 int flags = 0; | 81 int flags = 0; |
| 82 net::CertVerifyResult verify_result; | 82 net::CertVerifyResult verify_result; |
| 83 int error = verify_proc->Verify(cert, | 83 int error = |
| 84 "127.0.0.1", | 84 verify_proc->Verify(cert, "127.0.0.1", std::string(), flags, NULL, |
| 85 flags, | 85 additional_trust_anchors, &verify_result); |
| 86 NULL, | |
| 87 additional_trust_anchors, | |
| 88 &verify_result); | |
| 89 if (verify_result.verified_cert.get() && | 86 if (verify_result.verified_cert.get() && |
| 90 !verify_result.verified_cert->GetIntermediateCertificates().empty()) { | 87 !verify_result.verified_cert->GetIntermediateCertificates().empty()) { |
| 91 net::X509Certificate::OSCertHandle root = | 88 net::X509Certificate::OSCertHandle root = |
| 92 verify_result.verified_cert->GetIntermediateCertificates().back(); | 89 verify_result.verified_cert->GetIntermediateCertificates().back(); |
| 93 root_subject_name->assign(root->subjectName); | 90 root_subject_name->assign(root->subjectName); |
| 94 } else { | 91 } else { |
| 95 root_subject_name->clear(); | 92 root_subject_name->clear(); |
| 96 } | 93 } |
| 97 return error; | 94 return error; |
| 98 } | 95 } |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 370 |
| 374 INSTANTIATE_TEST_CASE_P( | 371 INSTANTIATE_TEST_CASE_P( |
| 375 Variations, | 372 Variations, |
| 376 CertVerifyProcChromeOSOrderingTest, | 373 CertVerifyProcChromeOSOrderingTest, |
| 377 ::testing::Combine( | 374 ::testing::Combine( |
| 378 ::testing::Bool(), | 375 ::testing::Bool(), |
| 379 ::testing::Range(0, 1 << 2), | 376 ::testing::Range(0, 1 << 2), |
| 380 ::testing::Values("d12", "d21", "1d2", "12d", "2d1", "21d"))); | 377 ::testing::Values("d12", "d21", "1d2", "12d", "2d1", "21d"))); |
| 381 | 378 |
| 382 } // namespace chromeos | 379 } // namespace chromeos |
| OLD | NEW |