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

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

Issue 228293012: Detect user-installed roots more efficiently on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rsleevi comments Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/android/java/src/org/chromium/net/X509Util.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 // http://crbug.com/361166 100 // Before API level 17, Android does not expose the APIs necessary to get at
101 return false; 101 // the verified certificate chain and detect known roots.
102 if (base::android::BuildInfo::GetInstance()->sdk_int() < 17)
103 return false;
102 #endif 104 #endif
103 return true; 105 return true;
104 } 106 }
105 107
106 } // namespace 108 } // namespace
107 109
108 class CertVerifyProcTest : public testing::Test { 110 class CertVerifyProcTest : public testing::Test {
109 public: 111 public:
110 CertVerifyProcTest() 112 CertVerifyProcTest()
111 : verify_proc_(CertVerifyProc::CreateDefault()) { 113 : verify_proc_(CertVerifyProc::CreateDefault()) {
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_COMMON_NAME_INVALID); 1598 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_COMMON_NAME_INVALID);
1597 } 1599 }
1598 } 1600 }
1599 1601
1600 WRAPPED_INSTANTIATE_TEST_CASE_P( 1602 WRAPPED_INSTANTIATE_TEST_CASE_P(
1601 VerifyName, 1603 VerifyName,
1602 CertVerifyProcNameTest, 1604 CertVerifyProcNameTest,
1603 testing::ValuesIn(kVerifyNameData)); 1605 testing::ValuesIn(kVerifyNameData));
1604 1606
1605 } // namespace net 1607 } // namespace net
OLDNEW
« no previous file with comments | « net/android/java/src/org/chromium/net/X509Util.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698