Skip to content

Commit

Permalink
TLSProxy/Proxy.pm: refine partial packet handling.
Browse files Browse the repository at this point in the history
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 <[email protected]>
(Merged from openssl#5887)
  • Loading branch information
Andy Polyakov committed Apr 8, 2018
1 parent f69d050 commit c53c2fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/perl/TLSProxy/Proxy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 "";
}

Expand Down

0 comments on commit c53c2fe

Please sign in to comment.