Commit 7d9e1edb authored by Niels Möller's avatar Niels Möller
Browse files

Fixed bug in the computation of the padding amount.

Rev: src/pad.c:1.13
parent 79fce608
......@@ -47,8 +47,10 @@ static int do_pad(struct abstract_write **w,
UINT32 block_size = connection->send_crypto
? connection->send_crypto->block_size : 8;
new_size = 1 + block_size
* ( (8 + packet->length) / block_size);
/* new_size is (packet->length + 9) rounded up to a multiple of
* block_size */
new_size = block_size
* (1 + (8 + packet->length) / block_size);
padding = new_size - packet->length - 5;
assert(padding >= 4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment