Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Langley <alangley@gmail.com>2015-06-13 01:26:58 +0300
committerAdam Langley <agl@google.com>2015-07-01 21:25:28 +0300
commit614c66a2f85007b08fc0ec9b83b896cbc0965af7 (patch)
tree7dd576e64a2dd5e65e4cfb3861de0390809124e6 /crypto/bytestring
parentbe9eda4a8849757dc48741e8f9aca179d8488846 (diff)
Add infrastructure for better extension handling.
Rather than four massive functions that handle every extension, organise the code by extension with four smaller functions for each. Change-Id: I876b31dacb05aca9884ed3ae7c48462e6ffe3b49 Reviewed-on: https://boringssl-review.googlesource.com/5142 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bytestring')
-rw-r--r--crypto/bytestring/cbb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/crypto/bytestring/cbb.c b/crypto/bytestring/cbb.c
index f1e09a2a..290d16fa 100644
--- a/crypto/bytestring/cbb.c
+++ b/crypto/bytestring/cbb.c
@@ -243,6 +243,12 @@ int CBB_flush(CBB *cbb) {
return 1;
}
+size_t CBB_len(const CBB *cbb) {
+ assert(cbb->child == NULL);
+ assert(!cbb->base->can_resize);
+
+ return cbb->base->cap - cbb->base->len;
+}
static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents,
size_t len_len) {