Speaking of which: Why wasn't it JUST a memset() call?
The encrypted version of packet_write fills in this data with OpenSSL
RAND_bytes() data, and as far as the unencrypted version goes?
Well, it's unencrypted, randomness doesn't help at that point.
alloc and free calls.
Since the cipher and mac layers aren't runtime extensible (yet)
and we know neither of these works in sizes greater than 32,
we can safely set aside a 64 byte block of data on the stack
for crypting and hashing.
This will make a big difference during quasi-non-blocking reads
where libssh2_packet_read() is polled repeatedly.
block of memory to be allocated leading to indeterminate results.
SSH-TRANS only requires implementations to handle about about 32k
compressed length per packet. Allow 40k to be safe, but no more.