Add a test for the TLSv1.3 downgrade mechanism
[openssl.git] / test / recipes / 70-test_sslversions.t
index ff4eac836e79a37ebbcf1b7fb3b6d2441adb5f2c..1f3db22478bfaf4bcf21d6b3a5c771e170fba3e5 100644 (file)
@@ -115,6 +115,17 @@ sub modify_supported_versions_filter
 {
     my $proxy = shift;
 
+    if ($proxy->flight == 1) {
+        # Change the ServerRandom so that the downgrade sentinel doesn't cause
+        # the connection to fail
+        my $message = ${$proxy->message_list}[1];
+        return if (!defined $message);
+
+        $message->random("\0"x32);
+        $message->repack();
+        return;
+    }
+
     # We're only interested in the initial ClientHello
     if ($proxy->flight != 0) {
         return;