Extend the input types for CBB_add_*() to help catch bugs.
authordoug <doug@openbsd.org>
Thu, 18 Jun 2015 23:25:07 +0000 (23:25 +0000)
committerdoug <doug@openbsd.org>
Thu, 18 Jun 2015 23:25:07 +0000 (23:25 +0000)
commit9d4b5ca74c88ec79c48a23a2626fb296b06d1e70
treeb1ca48b1108b371d44fe088afaed033a8af04463
parentb61b6f46711cf71d9da65c3508277c3dc74c08a7
Extend the input types for CBB_add_*() to help catch bugs.

While the previous types were correct, they can silently accept bad data
via truncation or signed conversion.  We now take size_t as input for
CBB_add_u*() and do a range check.

discussed with deraadt@
input + ok jsing@ miod@
lib/libssl/bs_cbb.c
lib/libssl/bytestring.h
lib/libssl/src/ssl/bs_cbb.c
lib/libssl/src/ssl/bytestring.h