| Index: webrtc/p2p/base/dtlstransportchannel_unittest.cc
|
| diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
|
| index 95696e222c500f54cd44b23df3a218b52cf19ad2..38b4311f76171e2a76e256fce8659d169f268056 100644
|
| --- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc
|
| +++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
|
| @@ -52,7 +52,7 @@ class DtlsTestClient : public sigslot::has_slots<> {
|
| negotiated_dtls_(false),
|
| received_dtls_client_hello_(false),
|
| received_dtls_server_hello_(false) {}
|
| - void CreateCertificate(rtc::KeyType key_type) {
|
| + void CreateCertificate(rtc::KeyTypeFull key_type) {
|
| certificate_ = rtc::RTCCertificate::Create(
|
| rtc::scoped_ptr<rtc::SSLIdentity>(
|
| rtc::SSLIdentity::Generate(name_, key_type)).Pass());
|
| @@ -399,7 +399,7 @@ class DtlsTransportChannelTest : public testing::Test {
|
| client2_.SetupMaxProtocolVersion(c2);
|
| ssl_expected_version_ = std::min(c1, c2);
|
| }
|
| - void PrepareDtls(bool c1, bool c2, rtc::KeyType key_type) {
|
| + void PrepareDtls(bool c1, bool c2, rtc::KeyTypeFull key_type) {
|
| if (c1) {
|
| client1_.CreateCertificate(key_type);
|
| }
|
| @@ -582,7 +582,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferSrtpTwoChannels) {
|
| // Connect with DTLS, and transfer some data.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtls) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, false);
|
| }
|
| @@ -591,7 +591,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtls) {
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsTwoChannels) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, false);
|
| TestTransfer(1, 1000, 100, false);
|
| @@ -599,14 +599,14 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsTwoChannels) {
|
|
|
| // Connect with A doing DTLS and B not, and transfer some data.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsRejected) {
|
| - PrepareDtls(true, false, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, false, rtc::KeyTypeFull());
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, false);
|
| }
|
|
|
| // Connect with B doing DTLS and A not, and transfer some data.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) {
|
| - PrepareDtls(false, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(false, true, rtc::KeyTypeFull());
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, false);
|
| }
|
| @@ -615,7 +615,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsNotOffered) {
|
| TEST_F(DtlsTransportChannelTest, TestDtls12None) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| SetMaxProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_10);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -624,7 +624,7 @@ TEST_F(DtlsTransportChannelTest, TestDtls12None) {
|
| TEST_F(DtlsTransportChannelTest, TestDtls12Both) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| SetMaxProtocolVersions(rtc::SSL_PROTOCOL_DTLS_12, rtc::SSL_PROTOCOL_DTLS_12);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -633,7 +633,7 @@ TEST_F(DtlsTransportChannelTest, TestDtls12Both) {
|
| TEST_F(DtlsTransportChannelTest, TestDtls12Client1) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| SetMaxProtocolVersions(rtc::SSL_PROTOCOL_DTLS_12, rtc::SSL_PROTOCOL_DTLS_10);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -642,7 +642,7 @@ TEST_F(DtlsTransportChannelTest, TestDtls12Client1) {
|
| TEST_F(DtlsTransportChannelTest, TestDtls12Client2) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| SetMaxProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_12);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -650,7 +650,7 @@ TEST_F(DtlsTransportChannelTest, TestDtls12Client2) {
|
| // Connect with DTLS, negotiate DTLS-SRTP, and transfer SRTP using bypass.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtp) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, true);
|
| @@ -660,7 +660,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtp) {
|
| // returned.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsInvalidSrtpPacket) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect());
|
| int result = client1_.SendInvalidSrtpPacket(0, 100);
|
| @@ -670,7 +670,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsInvalidSrtpPacket) {
|
| // Connect with DTLS. A does DTLS-SRTP but B does not.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpRejected) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, false);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -678,7 +678,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpRejected) {
|
| // Connect with DTLS. B does DTLS-SRTP but A does not.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpNotOffered) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(false, true);
|
| ASSERT_TRUE(Connect());
|
| }
|
| @@ -687,7 +687,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpNotOffered) {
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpTwoChannels) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, true);
|
| @@ -697,7 +697,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpTwoChannels) {
|
| // Create a single channel with DTLS, and send normal data and SRTP data on it.
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpDemux) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect());
|
| TestTransfer(0, 1000, 100, false);
|
| @@ -708,7 +708,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsSrtpDemux) {
|
| TEST_F(DtlsTransportChannelTest, TestTransferDtlsAnswererIsPassive) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
|
| cricket::CONNECTIONROLE_PASSIVE));
|
| @@ -720,7 +720,7 @@ TEST_F(DtlsTransportChannelTest, TestTransferDtlsAnswererIsPassive) {
|
| // In this case legacy is the answerer.
|
| TEST_F(DtlsTransportChannelTest, TestDtlsSetupWithLegacyAsAnswerer) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| NegotiateWithLegacy();
|
| rtc::SSLRole channel1_role;
|
| rtc::SSLRole channel2_role;
|
| @@ -735,7 +735,7 @@ TEST_F(DtlsTransportChannelTest, TestDtlsSetupWithLegacyAsAnswerer) {
|
| TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromOfferer) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| // Initial role for client1 is ACTPASS and client2 is ACTIVE.
|
| ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
|
| @@ -752,7 +752,7 @@ TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromOfferer) {
|
| TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromAnswerer) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| // Initial role for client1 is ACTPASS and client2 is ACTIVE.
|
| ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
|
| @@ -770,7 +770,7 @@ TEST_F(DtlsTransportChannelTest, TestDtlsReOfferFromAnswerer) {
|
| TEST_F(DtlsTransportChannelTest, TestDtlsRoleReversal) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
|
| cricket::CONNECTIONROLE_PASSIVE));
|
| @@ -786,7 +786,7 @@ TEST_F(DtlsTransportChannelTest, TestDtlsRoleReversal) {
|
| TEST_F(DtlsTransportChannelTest, TestDtlsReOfferWithDifferentSetupAttr) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| ASSERT_TRUE(Connect(cricket::CONNECTIONROLE_ACTPASS,
|
| cricket::CONNECTIONROLE_PASSIVE));
|
| @@ -802,7 +802,7 @@ TEST_F(DtlsTransportChannelTest, TestDtlsReOfferWithDifferentSetupAttr) {
|
| TEST_F(DtlsTransportChannelTest, TestRenegotiateBeforeConnect) {
|
| MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| SetChannelCount(2);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| PrepareDtlsSrtp(true, true);
|
| Negotiate();
|
|
|
| @@ -821,7 +821,7 @@ TEST_F(DtlsTransportChannelTest, TestRenegotiateBeforeConnect) {
|
| // Test Certificates state after negotiation but before connection.
|
| TEST_F(DtlsTransportChannelTest, TestCertificatesBeforeConnect) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| Negotiate();
|
|
|
| rtc::scoped_refptr<rtc::RTCCertificate> certificate1;
|
| @@ -846,7 +846,7 @@ TEST_F(DtlsTransportChannelTest, TestCertificatesBeforeConnect) {
|
| // Test Certificates state after connection.
|
| TEST_F(DtlsTransportChannelTest, TestCertificatesAfterConnect) {
|
| MAYBE_SKIP_TEST(HaveDtls);
|
| - PrepareDtls(true, true, rtc::KT_DEFAULT);
|
| + PrepareDtls(true, true, rtc::KeyTypeFull());
|
| ASSERT_TRUE(Connect());
|
|
|
| rtc::scoped_refptr<rtc::RTCCertificate> certificate1;
|
|
|