Rework partial packet handling once more
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 13 Apr 2018 16:48:06 +0000 (18:48 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 13 Apr 2018 16:48:06 +0000 (18:48 +0200)
Address the concern that commit c53c2fec raised differently.

The original direction of the traffic is encoded in bit 0
of the flight number.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5923)

util/perl/TLSProxy/Proxy.pm
util/perl/TLSProxy/Record.pm

index 45d88bffaa97c91bc91ead6c2492a251571ec7e3..752b572b8c49e4ac507636485c41868ede9ff468 100644 (file)
@@ -479,7 +479,7 @@ sub process_packet
 
     print "\n";
 
-    if (scalar(@{$ret[0]}) == 0) {
+    if (scalar(@{$ret[0]}) == 0 or length($ret[2]) != 0) {
         return "";
     }
 
index acace3651adff01a6f5bbc86938878f8bb90af30..49a0084d36a83774bca3eceb4168b59f5e347abe 100644 (file)
@@ -279,7 +279,8 @@ sub reconstruct_record
     my $server = shift;
     my $data;
 
-    if ($self->{sent}) {
+    #We only replay the records in the same direction
+    if ($self->{sent} || ($self->flight & 1) != $server) {
         return "";
     }
     $self->{sent} = 1;