dtls: disable tests which fail with OpenSSL

mostly due to OpenSSL not implementing a fake clock and not supporting
DTLS 1.3 yet.

The following tests failed since OpenSSL does not have an API to trigger a DTLS alert when the certificate validation of the fingerprint which arrives after the handshake fails:
[  FAILED  ] TestEventOrdering/DtlsEventOrderingTest.TestEventOrdering/6, where GetParam() = ({ 1, 2, 3, 0 }, false)
[  FAILED  ] TestEventOrdering/DtlsEventOrderingTest.TestEventOrdering/14, where GetParam() = ({ 2, 1, 3, 0 }, false)

These tests now accept that the other client will not get notified about the failure.

The following tests were disabled in OpenSSL mode:
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/0, where GetParam() = (false, false, 2, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/1, where GetParam() = (false, false, 2, false, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/2, where GetParam() = (false, false, 2, false, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/3, where GetParam() = (false, false, 2, false, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/4, where GetParam() = (false, false, 2, true, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/5, where GetParam() = (false, false, 2, true, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/6, where GetParam() = (false, false, 2, true, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/7, where GetParam() = (false, false, 2, true, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/8, where GetParam() = (false, false, 3, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/12, where GetParam() = (false, false, 3, true, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/16, where GetParam() = (false, true, 2, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/17, where GetParam() = (false, true, 2, false, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/18, where GetParam() = (false, true, 2, false, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/19, where GetParam() = (false, true, 2, false, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/20, where GetParam() = (false, true, 2, true, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/21, where GetParam() = (false, true, 2, true, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/22, where GetParam() = (false, true, 2, true, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/23, where GetParam() = (false, true, 2, true, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/24, where GetParam() = (false, true, 3, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/28, where GetParam() = (false, true, 3, true, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/32, where GetParam() = (true, false, 2, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/33, where GetParam() = (true, false, 2, false, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/34, where GetParam() = (true, false, 2, false, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/35, where GetParam() = (true, false, 2, false, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/36, where GetParam() = (true, false, 2, true, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/37, where GetParam() = (true, false, 2, true, false, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/38, where GetParam() = (true, false, 2, true, true, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/39, where GetParam() = (true, false, 2, true, true, true)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/40, where GetParam() = (true, false, 3, false, false, false)
[  FAILED  ] DtlsStunPiggybackingIntegrationTest/DtlsIceIntegrationTest.TestWithPacketLoss/44, where GetParam() = (true, false, 3, true, false, false)
[  FAILED  ] DtlsInStunTest/DtlsInStunTest.OptimalDtls13Handshake/0, where GetParam() = ([ dtls: client/1.3 dtls_in_stun: 1 ice: controlling pqc: 0 ], [ dtls: server/1.3 dtls_in_stun: 1 ice: controlled pqc: 0 ])
[  FAILED  ] DtlsInStunTest/DtlsInStunTest.OptimalDtls13Handshake/1, where GetParam() = ([ dtls: client/1.3 dtls_in_stun: 1 ice: controlling pqc: 1 ], [ dtls: server/1.3 dtls_in_stun: 1 ice: controlled pqc: 0 ])
[  FAILED  ] DtlsInStunTest/DtlsInStunTest.OptimalDtls13Handshake/2, where GetParam() = ([ dtls: client/1.3 dtls_in_stun: 1 ice: controlling pqc: 0 ], [ dtls: server/1.3 dtls_in_stun: 1 ice: controlled pqc: 1 ])
[  FAILED  ] DtlsInStunTest/DtlsInStunTest.OptimalDtls13Handshake/3, where GetParam() = ([ dtls: client/1.3 dtls_in_stun: 1 ice: controlling pqc: 1 ], [ dtls: server/1.3 dtls_in_stun: 1 ice: controlled pqc: 1 ])

BUG=None

Change-Id: I50f7a5caa6c2243ae6f4c06ad1b58a5d90983b80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/385840
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44376}
diff --git a/p2p/dtls/dtls_ice_integrationtest.cc b/p2p/dtls/dtls_ice_integrationtest.cc
index 5d0ec92..7e13ab7 100644
--- a/p2p/dtls/dtls_ice_integrationtest.cc
+++ b/p2p/dtls/dtls_ice_integrationtest.cc
@@ -441,7 +441,12 @@
   }
 }
 
-TEST_P(DtlsIceIntegrationTest, TestWithPacketLoss) {
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_TestWithPacketLoss TestWithPacketLoss
+#else
+#define MAYBE_TestWithPacketLoss DISABLED_TestWithPacketLoss
+#endif
+TEST_P(DtlsIceIntegrationTest, MAYBE_TestWithPacketLoss) {
   ConfigureEmulatedNetwork();
   Prepare();
 
diff --git a/p2p/dtls/dtls_transport_unittest.cc b/p2p/dtls/dtls_transport_unittest.cc
index d26e40f..855912a 100644
--- a/p2p/dtls/dtls_transport_unittest.cc
+++ b/p2p/dtls/dtls_transport_unittest.cc
@@ -965,7 +965,12 @@
   ASSERT_TRUE(Connect());
 }
 
-TEST_P(DtlsTransportInternalImplVersionTest, HandshakeFlights) {
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_HandshakeFlights
+#else
+#define MAYBE_HandshakeFlights DISABLED_HandshakeFlights
+#endif
+TEST_P(DtlsTransportInternalImplVersionTest, MAYBE_HandshakeFlights) {
   if (std::get<0>(GetParam()).dtls_in_stun ||
       (std::get<0>(GetParam()).dtls_in_stun &&
        std::get<1>(GetParam()).dtls_in_stun)) {
@@ -992,8 +997,14 @@
   EXPECT_EQ(events, expect);
 }
 
-TEST_P(DtlsTransportInternalImplVersionTest, HandshakeLoseFirstClientPacket) {
-  MAYBE_SKIP_TEST(IsBoringSsl);
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_HandshakeLoseFirstClientPacket HandshakeLoseFirstClientPacket
+#else
+#define MAYBE_HandshakeLoseFirstClientPacket \
+  DISABLED_HandshakeLoseFirstClientPacket
+#endif
+TEST_P(DtlsTransportInternalImplVersionTest,
+       MAYBE_HandshakeLoseFirstClientPacket) {
   if (std::get<0>(GetParam()).dtls_in_stun ||
       (std::get<0>(GetParam()).dtls_in_stun &&
        std::get<1>(GetParam()).dtls_in_stun)) {
@@ -1015,9 +1026,15 @@
   EXPECT_EQ(events, expect);
 }
 
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_PqcHandshakeLoseFirstClientPacket \
+  PqcHandshakeLoseFirstClientPacket
+#else
+#define MAYBE_PqcHandshakeLoseFirstClientPacket \
+  DISABLED_PqcHandshakeLoseFirstClientPacket
+#endif
 TEST_P(DtlsTransportInternalImplVersionTest,
-       PqcHandshakeLoseFirstClientPacket) {
-  MAYBE_SKIP_TEST(IsBoringSsl);
+       MAYBE_PqcHandshakeLoseFirstClientPacket) {
   if (std::get<0>(GetParam()).dtls_in_stun ||
       std::get<1>(GetParam()).dtls_in_stun) {
     GTEST_SKIP() << "This test does not support dtls in stun";
@@ -1056,9 +1073,15 @@
   EXPECT_EQ(events, expect);
 }
 
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_PqcHandshakeLoseSecondClientPacket \
+  PqcHandshakeLoseSecondClientPacket
+#else
+#define MAYBE_PqcHandshakeLoseSecondClientPacket \
+  DISABLED_PqcHandshakeLoseSecondClientPacket
+#endif
 TEST_P(DtlsTransportInternalImplVersionTest,
-       PqcHandshakeLoseSecondClientPacket) {
-  MAYBE_SKIP_TEST(IsBoringSsl);
+       MAYBE_PqcHandshakeLoseSecondClientPacket) {
   if (std::get<0>(GetParam()).dtls_in_stun ||
       std::get<1>(GetParam()).dtls_in_stun) {
     GTEST_SKIP() << "This test does not support dtls in stun";
@@ -1098,8 +1121,14 @@
   EXPECT_EQ(events, expect);
 }
 
-TEST_P(DtlsTransportInternalImplVersionTest, HandshakeLoseSecondClientPacket) {
-  MAYBE_SKIP_TEST(IsBoringSsl);
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_HandshakeLoseSecondClientPacket HandshakeLoseSecondClientPacket
+#else
+#define MAYBE_HandshakeLoseSecondClientPacket \
+  DISABLED_HandshakeLoseSecondClientPacket
+#endif
+TEST_P(DtlsTransportInternalImplVersionTest,
+       MAYBE_HandshakeLoseSecondClientPacket) {
   if (std::get<0>(GetParam()).dtls_in_stun ||
       (std::get<0>(GetParam()).dtls_in_stun &&
        std::get<1>(GetParam()).dtls_in_stun)) {
@@ -1264,11 +1293,14 @@
 // Each time a timeout occurs, the retransmission timer should be doubled up to
 // 60 seconds. The timer defaults to 1 second, but for WebRTC we should be
 // initializing it to 50ms.
-TEST_F(DtlsTransportInternalImplTest, TestRetransmissionSchedule) {
   // We can only change the retransmission schedule with a recently-added
   // BoringSSL API. Skip the test if not built with BoringSSL.
-  MAYBE_SKIP_TEST(IsBoringSsl);
-
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_TestRetransmissionSchedule TestRetransmissionSchedule
+#else
+#define MAYBE_TestRetransmissionSchedule DISABLED_TestRetransmissionSchedule
+#endif
+TEST_F(DtlsTransportInternalImplTest, MAYBE_TestRetransmissionSchedule) {
   PrepareDtls(KT_DEFAULT);
 
   // This test is written with assumption of 0 delay
@@ -1400,7 +1432,13 @@
       return client1_.dtls_transport()->dtls_state() == expected_final_state;
     }));
     EXPECT_TRUE(WaitUntil([&] {
-      return client2_.dtls_transport()->dtls_state() == expected_final_state;
+      return client2_.dtls_transport()->dtls_state() == expected_final_state ||
+             // Unlike BoringSSL, OpenSSL can not send a fatal alert to the peer
+             // so the peer will be stuck in kConnecting.
+             (!rtc::SSLStreamAdapter::IsBoringSsl() &&
+              expected_final_state == DtlsTransportState::kFailed &&
+              client2_.dtls_transport()->dtls_state() ==
+                  DtlsTransportState::kConnecting);
     }));
 
     // Transports should be writable iff there was a valid fingerprint.
@@ -1797,7 +1835,12 @@
                          DtlsInStunTest,
                          testing::ValuesIn(Dtls13WithDtlsInStun()));
 
-TEST_P(DtlsInStunTest, OptimalDtls13Handshake) {
+#if defined(OPENSSL_IS_BORINGSSL)
+#define MAYBE_OptimalDtls13Handshake
+#else
+#define MAYBE_OptimalDtls13Handshake DISABLED_OptimalDtls13Handshake
+#endif
+TEST_P(DtlsInStunTest, MAYBE_OptimalDtls13Handshake) {
   RTC_LOG(LS_INFO) << "client1: " << std::get<0>(GetParam());
   RTC_LOG(LS_INFO) << "client2: " << std::get<1>(GetParam());