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.h" | 5 #include "net/cert/cert_verify_proc.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Before API level 17, Android does not expose the APIs necessary to get at | 90 // Before API level 17, Android does not expose the APIs necessary to get at |
91 // the verified certificate chain. | 91 // the verified certificate chain. |
92 if (base::android::BuildInfo::GetInstance()->sdk_int() < 17) | 92 if (base::android::BuildInfo::GetInstance()->sdk_int() < 17) |
93 return false; | 93 return false; |
94 #endif | 94 #endif |
95 return true; | 95 return true; |
96 } | 96 } |
97 | 97 |
98 bool SupportsDetectingKnownRoots() { | 98 bool SupportsDetectingKnownRoots() { |
99 #if defined(OS_ANDROID) | 99 #if defined(OS_ANDROID) |
100 // Before API level 17, Android does not expose the APIs necessary to get at | 100 // http://crbug.com/361166 |
101 // the verified certificate chain and detect known roots. | 101 return false; |
102 if (base::android::BuildInfo::GetInstance()->sdk_int() < 17) | |
103 return false; | |
104 #endif | 102 #endif |
105 return true; | 103 return true; |
106 } | 104 } |
107 | 105 |
108 } // namespace | 106 } // namespace |
109 | 107 |
110 class CertVerifyProcTest : public testing::Test { | 108 class CertVerifyProcTest : public testing::Test { |
111 public: | 109 public: |
112 CertVerifyProcTest() | 110 CertVerifyProcTest() |
113 : verify_proc_(CertVerifyProc::CreateDefault()) { | 111 : verify_proc_(CertVerifyProc::CreateDefault()) { |
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_COMMON_NAME_INVALID); | 1596 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_COMMON_NAME_INVALID); |
1599 } | 1597 } |
1600 } | 1598 } |
1601 | 1599 |
1602 WRAPPED_INSTANTIATE_TEST_CASE_P( | 1600 WRAPPED_INSTANTIATE_TEST_CASE_P( |
1603 VerifyName, | 1601 VerifyName, |
1604 CertVerifyProcNameTest, | 1602 CertVerifyProcNameTest, |
1605 testing::ValuesIn(kVerifyNameData)); | 1603 testing::ValuesIn(kVerifyNameData)); |
1606 | 1604 |
1607 } // namespace net | 1605 } // namespace net |
OLD | NEW |