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

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

Issue 1882433002: Removing NSS files and USE_OPENSSL flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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
« no previous file with comments | « net/cert/x509_util_nss_certs.cc ('k') | net/http/des.cc » ('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/cert/x509_util.h" 5 #include "net/cert/x509_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 &der_cert)); 181 &der_cert));
182 182
183 scoped_refptr<X509Certificate> cert = 183 scoped_refptr<X509Certificate> cert =
184 X509Certificate::CreateFromBytes(der_cert.data(), der_cert.size()); 184 X509Certificate::CreateFromBytes(der_cert.data(), der_cert.size());
185 ASSERT_TRUE(cert.get()); 185 ASSERT_TRUE(cert.get());
186 186
187 EXPECT_EQ("subject", cert->subject().GetDisplayName()); 187 EXPECT_EQ("subject", cert->subject().GetDisplayName());
188 EXPECT_FALSE(cert->HasExpired()); 188 EXPECT_FALSE(cert->HasExpired());
189 } 189 }
190 190
191 #if defined(USE_OPENSSL)
192 // This is a test case based on 191 // This is a test case based on
193 // http://blogs.msdn.com/b/openspecification/archive/2013/03/26/ntlm-and-channel -binding-hash-aka-exteneded-protection-for-authentication.aspx 192 // http://blogs.msdn.com/b/openspecification/archive/2013/03/26/ntlm-and-channel -binding-hash-aka-exteneded-protection-for-authentication.aspx
194 // There doesn't seem to be too many public test vectors for channel bindings. 193 // There doesn't seem to be too many public test vectors for channel bindings.
195 TEST(X509UtilTest, CreateChannelBindings_SHA1) { 194 TEST(X509UtilTest, CreateChannelBindings_SHA1) {
196 // Certificate: 195 // Certificate:
197 // Data: 196 // Data:
198 // Version: 3 (0x2) 197 // Version: 3 (0x2)
199 // Serial Number: 198 // Serial Number:
200 // (Negative)34:96:86:32:ae:8a:3a:48:b4:98:cf:7c:93:87:bb:d9 199 // (Negative)34:96:86:32:ae:8a:3a:48:b4:98:cf:7c:93:87:bb:d9
201 // Signature Algorithm: sha1WithRSA 200 // Signature Algorithm: sha1WithRSA
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 690
692 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromBytes( 691 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromBytes(
693 reinterpret_cast<const char*>(kCertificateDataDER), 692 reinterpret_cast<const char*>(kCertificateDataDER),
694 sizeof(kCertificateDataDER)); 693 sizeof(kCertificateDataDER));
695 694
696 std::string channel_bindings; 695 std::string channel_bindings;
697 ASSERT_FALSE( 696 ASSERT_FALSE(
698 x509_util::GetTLSServerEndPointChannelBinding(*cert, &channel_bindings)); 697 x509_util::GetTLSServerEndPointChannelBinding(*cert, &channel_bindings));
699 EXPECT_TRUE(channel_bindings.empty()); 698 EXPECT_TRUE(channel_bindings.empty());
700 } 699 }
701 #endif
702 700
703 } // namespace x509_util 701 } // namespace x509_util
704 702
705 } // namespace net 703 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/x509_util_nss_certs.cc ('k') | net/http/des.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698