From 1e4884f615b20946411a74e41eb9c6aa65e2d5f3 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Thu, 24 Sep 2015 10:57:52 -0700 Subject: external/boringssl: sync with upstream. This change imports the current version of BoringSSL. The only local change now is that |BORINGSSL_201509| is defined in base.h. This allows this change to be made without (hopefully) breaking the build. This change will need https://android-review.googlesource.com/172744 to be landed afterwards to update a test. Change-Id: I6d1f463f7785a2423bd846305af91c973c326104 --- src/crypto/bytestring/cbb.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/crypto/bytestring/cbb.c') diff --git a/src/crypto/bytestring/cbb.c b/src/crypto/bytestring/cbb.c index f1e09a2..1da6a21 100644 --- a/src/crypto/bytestring/cbb.c +++ b/src/crypto/bytestring/cbb.c @@ -20,6 +20,10 @@ #include +void CBB_zero(CBB *cbb) { + memset(cbb, 0, sizeof(CBB)); +} + static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { struct cbb_buffer_st *base; @@ -243,6 +247,11 @@ int CBB_flush(CBB *cbb) { return 1; } +size_t CBB_len(const CBB *cbb) { + assert(cbb->child == NULL); + + return cbb->base->len; +} static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, size_t len_len) { -- cgit v1.1