Support renegotiation in TLSProxy
authorMatt Caswell <matt@openssl.org>
Tue, 22 Nov 2016 13:43:50 +0000 (13:43 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 23 Jan 2017 14:09:10 +0000 (14:09 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1983)

util/TLSProxy/Proxy.pm

index 49fc15d60f20274bca878582aa5b53120a0c1015..d025075b5ad743382c97496ee07a86a56f220f27 100644 (file)
@@ -42,6 +42,7 @@ sub new
         clientflags => "",
         serverconnects => 1,
         serverpid => 0,
+        reneg => 0,
 
         #Public read
         execute => $execute,
@@ -117,6 +118,7 @@ sub clear
     $self->{serverflags} = "";
     $self->{serverconnects} = 1;
     $self->{serverpid} = 0;
+    $self->{reneg} = 0;
 }
 
 sub restart
@@ -200,7 +202,13 @@ sub clientstart
                     or die "Failed to redirect stdout: $!";
                 open(STDERR, ">&STDOUT");
             }
-            my $execcmd = "echo test | ".$self->execute
+            my $echostr;
+            if ($self->reneg()) {
+                $echostr = "R";
+            } else {
+                $echostr = "test";
+            }
+            my $execcmd = "echo ".$echostr." | ".$self->execute
                  ." s_client -engine ossltest -connect "
                  .($self->proxy_addr).":".($self->proxy_port);
             if ($self->cipherc ne "") {
@@ -505,4 +513,13 @@ sub fill_known_data
     return $ret;
 }
 
+sub reneg
+{
+    my $self = shift;
+    if (@_) {
+      $self->{reneg} = shift;
+    }
+    return $self->{reneg};
+}
+
 1;