| Index: webrtc/base/sslstreamadapter_unittest.cc
|
| diff --git a/webrtc/base/sslstreamadapter_unittest.cc b/webrtc/base/sslstreamadapter_unittest.cc
|
| index 9e156c0b3c1df82c0c3791edd6888080c31e4516..4d247bd068c68c8d39be786e595a05f35b90c133 100644
|
| --- a/webrtc/base/sslstreamadapter_unittest.cc
|
| +++ b/webrtc/base/sslstreamadapter_unittest.cc
|
| @@ -18,7 +18,6 @@
|
| #include "webrtc/base/gunit.h"
|
| #include "webrtc/base/helpers.h"
|
| #include "webrtc/base/ssladapter.h"
|
| -#include "webrtc/base/sslconfig.h"
|
| #include "webrtc/base/sslidentity.h"
|
| #include "webrtc/base/sslstreamadapter.h"
|
| #include "webrtc/base/stream.h"
|
| @@ -64,12 +63,6 @@ static const char kCERT_PEM[] =
|
| "UD0A8qfhfDM+LK6rPAnCsVN0NRDY3jvd6rzix9M=\n"
|
| "-----END CERTIFICATE-----\n";
|
|
|
| -#define MAYBE_SKIP_TEST(feature) \
|
| - if (!(rtc::SSLStreamAdapter::feature())) { \
|
| - LOG(LS_INFO) << "Feature disabled... skipping"; \
|
| - return; \
|
| - }
|
| -
|
| class SSLStreamAdapterTestBase;
|
|
|
| class SSLDummyStreamBase : public rtc::StreamInterface,
|
| @@ -962,7 +955,6 @@ TEST_P(SSLStreamAdapterTestTLS, TestSetPeerCertificateDigestWithInvalidLength) {
|
| // Basic tests: DTLS
|
| // Test that we can make a handshake work
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnect) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| TestHandshake();
|
| };
|
|
|
| @@ -970,14 +962,12 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnect) {
|
| // each direction is lost. This gives us predictable loss
|
| // rather than having to tune random
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacket) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetLoseFirstPacket(true);
|
| TestHandshake();
|
| };
|
|
|
| // Test a handshake with loss and delay
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacketDelay2s) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetLoseFirstPacket(true);
|
| SetDelay(2000);
|
| SetHandshakeWait(20000);
|
| @@ -987,7 +977,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSConnectWithLostFirstPacketDelay2s) {
|
| // Test a handshake with small MTU
|
| // Disabled due to https://code.google.com/p/webrtc/issues/detail?id=3910
|
| TEST_P(SSLStreamAdapterTestDTLS, DISABLED_TestDTLSConnectWithSmallMtu) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetMtu(700);
|
| SetHandshakeWait(20000);
|
| TestHandshake();
|
| @@ -995,20 +984,17 @@ TEST_P(SSLStreamAdapterTestDTLS, DISABLED_TestDTLSConnectWithSmallMtu) {
|
|
|
| // Test transfer -- trivial
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransfer) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| TestHandshake();
|
| TestTransfer(100);
|
| };
|
|
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithLoss) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| TestHandshake();
|
| SetLoss(10);
|
| TestTransfer(100);
|
| };
|
|
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSTransferWithDamage) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetDamage(); // Must be called first because first packet
|
| // write happens at end of handshake.
|
| TestHandshake();
|
| @@ -1025,7 +1011,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentityWithBogusDigest) {
|
|
|
| // Test DTLS-SRTP with all high ciphers
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> high;
|
| high.push_back(rtc::SRTP_AES128_CM_SHA1_80);
|
| SetDtlsSrtpCryptoSuites(high, true);
|
| @@ -1043,7 +1028,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) {
|
|
|
| // Test DTLS-SRTP with all low ciphers
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> low;
|
| low.push_back(rtc::SRTP_AES128_CM_SHA1_32);
|
| SetDtlsSrtpCryptoSuites(low, true);
|
| @@ -1061,7 +1045,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) {
|
|
|
| // Test DTLS-SRTP with a mismatch -- should not converge
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> high;
|
| high.push_back(rtc::SRTP_AES128_CM_SHA1_80);
|
| std::vector<int> low;
|
| @@ -1078,7 +1061,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) {
|
|
|
| // Test DTLS-SRTP with each side being mixed -- should select high
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> mixed;
|
| mixed.push_back(rtc::SRTP_AES128_CM_SHA1_80);
|
| mixed.push_back(rtc::SRTP_AES128_CM_SHA1_32);
|
| @@ -1097,7 +1079,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) {
|
|
|
| // Test DTLS-SRTP with all GCM-128 ciphers.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> gcm128;
|
| gcm128.push_back(rtc::SRTP_AEAD_AES_128_GCM);
|
| SetDtlsSrtpCryptoSuites(gcm128, true);
|
| @@ -1115,7 +1096,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) {
|
|
|
| // Test DTLS-SRTP with all GCM-256 ciphers.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> gcm256;
|
| gcm256.push_back(rtc::SRTP_AEAD_AES_256_GCM);
|
| SetDtlsSrtpCryptoSuites(gcm256, true);
|
| @@ -1133,7 +1113,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) {
|
|
|
| // Test DTLS-SRTP with mixed GCM-128/-256 ciphers -- should not converge.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> gcm128;
|
| gcm128.push_back(rtc::SRTP_AEAD_AES_128_GCM);
|
| std::vector<int> gcm256;
|
| @@ -1150,7 +1129,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) {
|
|
|
| // Test DTLS-SRTP with both GCM-128/-256 ciphers -- should select GCM-256.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) {
|
| - MAYBE_SKIP_TEST(HaveDtlsSrtp);
|
| std::vector<int> gcmBoth;
|
| gcmBoth.push_back(rtc::SRTP_AEAD_AES_256_GCM);
|
| gcmBoth.push_back(rtc::SRTP_AEAD_AES_128_GCM);
|
| @@ -1198,7 +1176,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpKeyAndSaltLengths) {
|
|
|
| // Test an exporter
|
| TEST_P(SSLStreamAdapterTestDTLS, TestDTLSExporter) {
|
| - MAYBE_SKIP_TEST(HaveExporter);
|
| TestHandshake();
|
| unsigned char client_out[20];
|
| unsigned char server_out[20];
|
| @@ -1221,7 +1198,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSExporter) {
|
|
|
| // Test not yet valid certificates are not rejected.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestCertNotYetValid) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| long one_day = 60 * 60 * 24;
|
| // Make the certificates not valid until one day later.
|
| ResetIdentitiesWithValidity(one_day, one_day);
|
| @@ -1230,7 +1206,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestCertNotYetValid) {
|
|
|
| // Test expired certificates are not rejected.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestCertExpired) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| long one_day = 60 * 60 * 24;
|
| // Make the certificates already expired.
|
| ResetIdentitiesWithValidity(-one_day, -one_day);
|
| @@ -1239,15 +1214,12 @@ TEST_P(SSLStreamAdapterTestDTLS, TestCertExpired) {
|
|
|
| // Test data transfer using certs created from strings.
|
| TEST_F(SSLStreamAdapterTestDTLSFromPEMStrings, TestTransfer) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| TestHandshake();
|
| TestTransfer(100);
|
| }
|
|
|
| // Test getting the remote certificate.
|
| TEST_F(SSLStreamAdapterTestDTLSFromPEMStrings, TestDTLSGetPeerCertificate) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| -
|
| // Peer certificates haven't been received yet.
|
| ASSERT_FALSE(GetPeerCertificate(true));
|
| ASSERT_FALSE(GetPeerCertificate(false));
|
| @@ -1281,7 +1253,6 @@ TEST_F(SSLStreamAdapterTestDTLSFromPEMStrings, TestDTLSGetPeerCertificate) {
|
| // Test getting the used DTLS ciphers.
|
| // DTLS 1.2 enabled for neither client nor server -> DTLS 1.0 will be used.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuite) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_10);
|
| TestHandshake();
|
|
|
| @@ -1301,7 +1272,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuite) {
|
| // Test getting the used DTLS 1.2 ciphers.
|
| // DTLS 1.2 enabled for client and server -> DTLS 1.2 will be used.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuiteDtls12Both) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_12, rtc::SSL_PROTOCOL_DTLS_12);
|
| TestHandshake();
|
|
|
| @@ -1320,7 +1290,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuiteDtls12Both) {
|
|
|
| // DTLS 1.2 enabled for client only -> DTLS 1.0 will be used.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuiteDtls12Client) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_10, rtc::SSL_PROTOCOL_DTLS_12);
|
| TestHandshake();
|
|
|
| @@ -1339,7 +1308,6 @@ TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuiteDtls12Client) {
|
|
|
| // DTLS 1.2 enabled for server only -> DTLS 1.0 will be used.
|
| TEST_P(SSLStreamAdapterTestDTLS, TestGetSslCipherSuiteDtls12Server) {
|
| - MAYBE_SKIP_TEST(HaveDtls);
|
| SetupProtocolVersions(rtc::SSL_PROTOCOL_DTLS_12, rtc::SSL_PROTOCOL_DTLS_10);
|
| TestHandshake();
|
|
|
|
|