summaryrefslogtreecommitdiff
path: root/src/lib/libssl/bs_cbb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* This commit was manufactured by cvs2git to create tag 'OPENBSD_5_8_BASE'.OPENBSD_5_8_BASEcvs2svn2015-08-021-436/+0
|
* Extend the input types for CBB_add_*() to help catch bugs.doug2015-06-181-8/+20
| | | | | | | | | 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@
* Split up the logic in CBB_flush to separately handle the lengths.doug2015-06-131-21/+32
| | | | | | Also, add comments about assuming short-form. ok miod@, tweak + ok jsing@
* Explain the ASN.1 restriction that requires extra logic for encoding.doug2015-06-131-2/+18
| | | | ok miod@ jsing@
* When initial capacity is 0, always use NULL buffer.doug2015-06-131-7/+8
| | | | | | | malloc(0) is implementation defined and there's no reason to introduce that ambiguity here. Added a few cosmetic changes in sizeof and free. ok miod@ jsing@
* Call CBB_add_space() rather than reimplementing it.doug2015-04-291-2/+2
| | | | ok jsing@
* Rename cbb_buffer_add_u to cbb_add_u and remove redundant code.doug2015-04-291-15/+6
| | | | | | | All of cbb_buffer_add_u's callers first call CBB_flush and send cbb->base. cbb_add_u() now has that common code in one place. ok jsing@
* Added len_len error checking for internal cbb_buffer_add_u().doug2015-04-291-1/+4
| | | | ok jsing@
* Don't allow tag number 31 in CBB_add_asn1().doug2015-02-071-10/+23
| | | | | | | | | Tag 31 is invalid for a short form identifier octet (single byte). KNF a little more. Based on BoringSSL commit 5ba305643f55d37a3e45e8388a36d50c1b2d4ff5 ok miod@
* Only call free in CBB_init().doug2015-02-071-3/+6
| | | | | | | | | | | CBB_init_fixed() should not call free because it can lead to use after free or double free bugs. The caller should be responsible for creating and destroying the buffer. From BoringSSL commit a84f06fc1eee6ea25ce040675fbad72c532afece miod agrees with the reasoning ok jsing@, beck@
* KNF bytestring files.doug2015-02-061-301/+310
| | | | | | | | I checked that this doesn't change anything. Compiled with clang using -Wno-pointer-sign -g0 to reduce the differences. Only difference in the asm is due to assert(0) line number changes in bs_cbs.c and bs_cbb.c. miod is ok with the general process.
* Remove accidental, commented out code.doug2015-02-061-11/+1
| | | | This was to test a patch for upstream.
* Import BoringSSL's crypto bytestring and crypto bytebuilder APIs.doug2015-02-061-0/+387
This is imported with as few changes as possible for the initial commit. I removed OPENSSL_EXPORT, replaced OPENSSL_malloc() etc with malloc() and changed a few header includes. BoringSSL has this as part of their public API. We're leaving it internal to libssl for now. Based on BoringSSL's CBB/CBS API as of commit c5cc15b4f5b1d6e9b9112cb8d30205a638aa2c54. input + ok jsing@, miod@