From c53c2fec82b6026331c98642ce4ad32ff7fe4fef Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Fri, 6 Apr 2018 11:33:16 +0200 Subject: [PATCH] TLSProxy/Proxy.pm: refine partial packet handling. Original logic was "if no records found *or* last one is truncated, then leave complete records in queue." Trouble is that if we don't pass on complete records and get complete packet in opposite direction, then queued records will go back to sender. In other words complete records should always be passed on. [Possible alternative would be to match direction in reconstruct_record.] Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/5887) --- util/perl/TLSProxy/Proxy.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/perl/TLSProxy/Proxy.pm b/util/perl/TLSProxy/Proxy.pm index 8f7f983ebc..b3b2fec090 100644 --- a/util/perl/TLSProxy/Proxy.pm +++ b/util/perl/TLSProxy/Proxy.pm @@ -456,14 +456,15 @@ sub process_packet #Return contains the list of record found in the packet followed by the #list of messages in those records and any partial message - my @ret = TLSProxy::Record->get_records($server, $self->flight, $self->{partial}[$server].$packet); + my @ret = TLSProxy::Record->get_records($server, $self->flight, + $self->{partial}[$server].$packet); $self->{partial}[$server] = $ret[2]; push @{$self->{record_list}}, @{$ret[0]}; push @{$self->{message_list}}, @{$ret[1]}; print "\n"; - if (scalar(@{$ret[0]}) == 0 or length($ret[2]) != 0) { + if (scalar(@{$ret[0]}) == 0) { return ""; } -- 2.25.1