From: Bernd Edlinger Date: Fri, 13 Apr 2018 16:48:06 +0000 (+0200) Subject: Rework partial packet handling once more X-Git-Tag: OpenSSL_1_1_1-pre5~14 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0e3ecaec3ebf2ed0dfbcff07b7fa1cfdd8240d5c;p=oweals%2Fopenssl.git Rework partial packet handling once more 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 Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/5923) --- diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm index 45d88bffaa..752b572b8c 100644 --- a/util/perl/TLSProxy/Proxy.pm +++ b/util/perl/TLSProxy/Proxy.pm @@ -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 ""; } diff --git a/util/perl/TLSProxy/Record.pm b/util/perl/TLSProxy/Record.pm index acace3651a..49a0084d36 100644 --- a/util/perl/TLSProxy/Record.pm +++ b/util/perl/TLSProxy/Record.pm @@ -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;