Add the WPACKET_reserve_bytes() function
authorMatt Caswell <matt@openssl.org>
Thu, 29 Sep 2016 10:43:37 +0000 (11:43 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 29 Sep 2016 14:09:02 +0000 (15:09 +0100)
commit1ff8434040b35f35c27f77ef064481622490bba9
tree32a48d1ef1a6bacb4311e2e6a7e2073cb53fac88
parentac8cc3efb26fa91c4f29463044cfe9e7070ebc14
Add the WPACKET_reserve_bytes() function

WPACKET_allocate_bytes() requires you to know the size of the data you
are allocating for, before you create it. Sometimes this isn't the case,
for example we know the maximum size that a signature will be before we
create it, but not the actual size. WPACKET_reserve_bytes() enables us to
reserve bytes in the WPACKET, but not count them as written yet. We then
subsequently need to acall WPACKET_allocate_bytes to actually count them as
written.

Reviewed-by: Rich Salz <rsalz@openssl.org>
ssl/packet.c
ssl/packet_locl.h