summaryrefslogtreecommitdiff
path: root/src/lib/libssl/bytestring.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide CBB_add_u32(), as needed for an upcoming conversion.jsing2018-08-161-1/+7
| | | | ok tb@
* Add CBB_discard_child(), which allows for a child CBB to be discarded.jsing2017-11-281-1/+7
| | | | Based on BoringSSL.
* Add an explict list of exported symbols with just the functionsguenther2016-11-041-8/+4
| | | | | | | declared in the public headers, and use __{BEGIN,END}_HIDDEN_DECLS in the internal headers to optimize internal functions ok jsing@
* Add CBS_dup() to initialize a new CBS with the same values.doug2015-06-191-1/+7
| | | | | | | This is useful for when you need to check the data ahead and then continue on from the same spot. input + ok jsing@ miod@
* Extend the input types for CBB_add_*() to help catch bugs.doug2015-06-181-5/+5
| | | | | | | | | 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@
* Use explicit int in bs_cbs.c.doug2015-06-171-10/+11
| | | | ok miod@ jsing@
* Add CBS_write_bytes() to copy the remaining CBS bytes to the caller.doug2015-06-171-1/+9
| | | | | | This is a common operation when dealing with CBS. ok miod@ jsing@
* Add a new function CBS_offset() to report the current offset in the data.doug2015-06-171-1/+7
| | | | "why not" miod@, sure jsing@
* Be more strict about BER and DER terminology.doug2015-06-161-9/+10
| | | | | | | | bs_ber.c does not convert BER to DER. It's a hack to convert a DER-like encoding with one violation (indefinite form) to strict DER. Rename the functions to reflect this. ok miod@ jsing@
* Simplify cbs_get_any_asn1_element_internal based on comments from jsing@doug2015-06-161-2/+2
|
* Make CBS_get_any_asn1_element() more compliant with DER encoding.doug2015-06-151-4/+16
| | | | | | | | | | | | | | | | | CBS_get_any_asn1_element violates DER encoding by allowing indefinite form. All callers except bs_ber.c expect DER encoding. The callers must check to see if it was indefinite or not. Rather than exposing all callers to this behavior, cbs_get_any_asn1_element_internal() allows specifying whether you want to allow the normally forbidden indefinite form. This is used by CBS_get_any_asn1_element() for strict DER encoding and by a new static function in bs_ber.c for the relaxed version. While I was here, I added comments to differentiate between ASN.1 restrictions and CBS limitations. ok miod@
* Add comments about how the CBS constants are constructed.doug2015-06-131-12/+43
| | | | | | Also, introduce a few more #defines to make it obvious. ok miod@ jsing@
* Add whitespace and replace OPENSSL_free with free in documentation.doug2015-04-291-6/+6
| | | | ok jsing@
* Don't allow tag number 31 in CBB_add_asn1().doug2015-02-071-2/+4
| | | | | | | | | Tag 31 is invalid for a short form identifier octet (single byte). KNF a little more. Based on BoringSSL commit 5ba305643f55d37a3e45e8388a36d50c1b2d4ff5 ok miod@
* Fix typo and ASN.1 tag number range comment in bytestring.h.doug2015-02-071-4/+4
| | | | | | | | | | CBS_get_asn1() and CBS_get_any_asn1_element() only support the single byte ASN.1 identifier octets (aka short form tags). Tag number 31 is the start of the multi-byte long form per X.690 section 8.1.2.4. From BoringSSL commit 2683af70e73f116e14db2bca6290fa4a010a2ee4 ok miod@
* KNF bytestring files.doug2015-02-061-121/+219
| | | | | | | | 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.
* Import BoringSSL's crypto bytestring and crypto bytebuilder APIs.doug2015-02-061-0/+346
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@