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

Side by Side Diff: net/base/ev_root_ca_metadata_unittest.cc

Issue 10836150: Revert 150375 - Implement SHA-256 fingerprint support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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/base/ev_root_ca_metadata.cc ('k') | net/base/multi_threaded_cert_verifier.h » ('j') | 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/base/ev_root_ca_metadata.h" 5 #include "net/base/ev_root_ca_metadata.h"
6 6
7 #include "net/base/cert_test_util.h" 7 #include "net/base/cert_test_util.h"
8 #include "net/base/x509_cert_types.h" 8 #include "net/base/x509_cert_types.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 static const char kVerisignPolicy[] = "2.16.840.1.113733.1.7.23.6"; 13 static const char kVerisignPolicy[] = "2.16.840.1.113733.1.7.23.6";
14 static const char kThawtePolicy[] = "2.16.840.1.113733.1.7.48.1"; 14 static const char kThawtePolicy[] = "2.16.840.1.113733.1.7.48.1";
15 static const char kFakePolicy[] = "2.16.840.1.42"; 15 static const char kFakePolicy[] = "2.16.840.1.42";
16 static const SHA1HashValue kVerisignFingerprint = 16 static const SHA1Fingerprint kVerisignFingerprint =
17 { { 0x74, 0x2c, 0x31, 0x92, 0xe6, 0x07, 0xe4, 0x24, 0xeb, 0x45, 17 { { 0x74, 0x2c, 0x31, 0x92, 0xe6, 0x07, 0xe4, 0x24, 0xeb, 0x45,
18 0x49, 0x54, 0x2b, 0xe1, 0xbb, 0xc5, 0x3e, 0x61, 0x74, 0xe2 } }; 18 0x49, 0x54, 0x2b, 0xe1, 0xbb, 0xc5, 0x3e, 0x61, 0x74, 0xe2 } };
19 static const SHA1HashValue kFakeFingerprint = 19 static const SHA1Fingerprint kFakeFingerprint =
20 { { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 20 { { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99,
21 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 } }; 21 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99 } };
22 22
23 #if defined(USE_NSS) 23 #if defined(USE_NSS)
24 24
25 TEST(EVRootCAMetadataTest, Basic) { 25 TEST(EVRootCAMetadataTest, Basic) {
26 EVRootCAMetadata* ev_metadata(EVRootCAMetadata::GetInstance()); 26 EVRootCAMetadata* ev_metadata(EVRootCAMetadata::GetInstance());
27 std::vector<EVRootCAMetadata::PolicyOID> oids; 27 std::vector<EVRootCAMetadata::PolicyOID> oids;
28 28
29 EXPECT_TRUE(ev_metadata->GetPolicyOIDsForCA(kVerisignFingerprint, &oids)); 29 EXPECT_TRUE(ev_metadata->GetPolicyOIDsForCA(kVerisignFingerprint, &oids));
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 EXPECT_TRUE(ev_metadata->IsEVPolicyOID(kFakePolicy)); 82 EXPECT_TRUE(ev_metadata->IsEVPolicyOID(kFakePolicy));
83 EXPECT_TRUE(ev_metadata->HasEVPolicyOID(kFakeFingerprint, 83 EXPECT_TRUE(ev_metadata->HasEVPolicyOID(kFakeFingerprint,
84 kFakePolicy)); 84 kFakePolicy));
85 } 85 }
86 86
87 EXPECT_FALSE(ev_metadata->IsEVPolicyOID(kFakePolicy)); 87 EXPECT_FALSE(ev_metadata->IsEVPolicyOID(kFakePolicy));
88 EXPECT_FALSE(ev_metadata->HasEVPolicyOID(kFakeFingerprint, 88 EXPECT_FALSE(ev_metadata->HasEVPolicyOID(kFakeFingerprint,
89 kFakePolicy)); 89 kFakePolicy));
90 } 90 }
91 91
92 #endif // defined(OS_WIN) 92 #endif // defined(OS_WIN)
93 93
94 } // namespace net 94 } // namespace net
OLDNEW
« no previous file with comments | « net/base/ev_root_ca_metadata.cc ('k') | net/base/multi_threaded_cert_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698