Skip to content

Commit

Permalink
fix reading encrypted frames that don't line up with network frames
Browse files Browse the repository at this point in the history
we want to call step again if there's remaining data. pos + toWrite
is what we consumed from this network frame to complete the encrypted
frame. so if it's less than the total network frame (data.length),
then call step again.
  • Loading branch information
ccutrer committed Feb 9, 2019
1 parent dfc2d57 commit be99e88
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private void step(byte[] data, int pos, Collection<byte[]> results) {
results.add(buffer.toByteArray());
buffer.reset();
targetLength = 0;
if (pos + toWrite > data.length) {
if (pos + toWrite < data.length) {
step(data, pos + toWrite, results);
}
} else {
Expand Down

0 comments on commit be99e88

Please sign in to comment.