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

Side by Side Diff: webrtc/base/sslidentity_unittest.cc

Issue 1329493005: Provide RSA2048 as per RFC (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Allow full parameterization of RSA, curve id for ECDSA. Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 0xce, 0x26, 0x58, 0x4a, 0x33, 0x6d, 0xbc, 0xb6}; 62 0xce, 0x26, 0x58, 0x4a, 0x33, 0x6d, 0xbc, 0xb6};
63 63
64 class SSLIdentityTest : public testing::Test { 64 class SSLIdentityTest : public testing::Test {
65 public: 65 public:
66 SSLIdentityTest() {} 66 SSLIdentityTest() {}
67 67
68 ~SSLIdentityTest() { 68 ~SSLIdentityTest() {
69 } 69 }
70 70
71 virtual void SetUp() { 71 virtual void SetUp() {
72 identity_rsa1_.reset(SSLIdentity::Generate("test1", rtc::KT_RSA)); 72 identity_rsa1_.reset(
73 identity_rsa2_.reset(SSLIdentity::Generate("test2", rtc::KT_RSA)); 73 SSLIdentity::Generate("test1", rtc::KeyTypeFull::RSA()));
74 identity_ecdsa1_.reset(SSLIdentity::Generate("test3", rtc::KT_ECDSA)); 74 identity_rsa2_.reset(
75 identity_ecdsa2_.reset(SSLIdentity::Generate("test4", rtc::KT_ECDSA)); 75 SSLIdentity::Generate("test2", rtc::KeyTypeFull::RSA()));
76 identity_ecdsa1_.reset(
77 SSLIdentity::Generate("test3", rtc::KeyTypeFull::ECDSA()));
78 identity_ecdsa2_.reset(
79 SSLIdentity::Generate("test4", rtc::KeyTypeFull::ECDSA()));
76 80
77 ASSERT_TRUE(identity_rsa1_); 81 ASSERT_TRUE(identity_rsa1_);
78 ASSERT_TRUE(identity_rsa2_); 82 ASSERT_TRUE(identity_rsa2_);
79 ASSERT_TRUE(identity_ecdsa1_); 83 ASSERT_TRUE(identity_ecdsa1_);
80 ASSERT_TRUE(identity_ecdsa2_); 84 ASSERT_TRUE(identity_ecdsa2_);
81 85
82 test_cert_.reset(rtc::SSLCertificate::FromPEMString(kTestCertificate)); 86 test_cert_.reset(rtc::SSLCertificate::FromPEMString(kTestCertificate));
83 ASSERT_TRUE(test_cert_); 87 ASSERT_TRUE(test_cert_);
84 } 88 }
85 89
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 EXPECT_TRUE(SSLIdentity::PemToDer("CERTIFICATE", kTestCertificate, &der)); 292 EXPECT_TRUE(SSLIdentity::PemToDer("CERTIFICATE", kTestCertificate, &der));
289 293
290 EXPECT_EQ(kTestCertificate, SSLIdentity::DerToPem( 294 EXPECT_EQ(kTestCertificate, SSLIdentity::DerToPem(
291 "CERTIFICATE", 295 "CERTIFICATE",
292 reinterpret_cast<const unsigned char*>(der.data()), der.length())); 296 reinterpret_cast<const unsigned char*>(der.data()), der.length()));
293 } 297 }
294 298
295 TEST_F(SSLIdentityTest, GetSignatureDigestAlgorithm) { 299 TEST_F(SSLIdentityTest, GetSignatureDigestAlgorithm) {
296 TestGetSignatureDigestAlgorithm(); 300 TestGetSignatureDigestAlgorithm();
297 } 301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698