chromium/third_party/boringssl/src/crypto/bytestring/cbb.c

/* Copyright (c) 2014, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

#include <openssl/bytestring.h>

#include <assert.h>
#include <limits.h>
#include <string.h>

#include <openssl/mem.h>
#include <openssl/err.h>

#include "../internal.h"


void CBB_zero(CBB *cbb) {}

static void cbb_init(CBB *cbb, uint8_t *buf, size_t cap, int can_resize) {}

int CBB_init(CBB *cbb, size_t initial_capacity) {}

int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) {}

void CBB_cleanup(CBB *cbb) {}

static int cbb_buffer_reserve(struct cbb_buffer_st *base, uint8_t **out,
                              size_t len) {}

static int cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out,
                          size_t len) {}

int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) {}

static struct cbb_buffer_st *cbb_get_base(CBB *cbb) {}

static void cbb_on_error(CBB *cbb) {}

// CBB_flush recurses and then writes out any pending length prefix. The
// current length of the underlying base is taken to be the length of the
// length-prefixed data.
int CBB_flush(CBB *cbb) {}

const uint8_t *CBB_data(const CBB *cbb) {}

size_t CBB_len(const CBB *cbb) {}

static int cbb_add_child(CBB *cbb, CBB *out_child, uint8_t len_len,
                         int is_asn1) {}

static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents,
                                   uint8_t len_len) {}

int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents) {}

int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents) {}

int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents) {}

// add_base128_integer encodes |v| as a big-endian base-128 integer where the
// high bit of each byte indicates where there is more data. This is the
// encoding used in DER for both high tag number form and OID components.
static int add_base128_integer(CBB *cbb, uint64_t v) {}

int CBB_add_asn1(CBB *cbb, CBB *out_contents, CBS_ASN1_TAG tag) {}

int CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len) {}

int CBB_add_zeros(CBB *cbb, size_t len) {}

int CBB_add_space(CBB *cbb, uint8_t **out_data, size_t len) {}

int CBB_reserve(CBB *cbb, uint8_t **out_data, size_t len) {}

int CBB_did_write(CBB *cbb, size_t len) {}

static int cbb_add_u(CBB *cbb, uint64_t v, size_t len_len) {}

int CBB_add_u8(CBB *cbb, uint8_t value) {}

int CBB_add_u16(CBB *cbb, uint16_t value) {}

int CBB_add_u16le(CBB *cbb, uint16_t value) {}

int CBB_add_u24(CBB *cbb, uint32_t value) {}

int CBB_add_u32(CBB *cbb, uint32_t value) {}

int CBB_add_u32le(CBB *cbb, uint32_t value) {}

int CBB_add_u64(CBB *cbb, uint64_t value) {}

int CBB_add_u64le(CBB *cbb, uint64_t value) {}

void CBB_discard_child(CBB *cbb) {}

int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) {}

int CBB_add_asn1_uint64_with_tag(CBB *cbb, uint64_t value, CBS_ASN1_TAG tag) {}

int CBB_add_asn1_int64(CBB *cbb, int64_t value) {}

int CBB_add_asn1_int64_with_tag(CBB *cbb, int64_t value, CBS_ASN1_TAG tag) {}

int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) {}

int CBB_add_asn1_bool(CBB *cbb, int value) {}

// parse_dotted_decimal parses one decimal component from |cbs|, where |cbs| is
// an OID literal, e.g., "1.2.840.113554.4.1.72585". It consumes both the
// component and the dot, so |cbs| may be passed into the function again for the
// next value.
static int parse_dotted_decimal(CBS *cbs, uint64_t *out) {}

int CBB_add_asn1_oid_from_text(CBB *cbb, const char *text, size_t len) {}

static int compare_set_of_element(const void *a_ptr, const void *b_ptr) {}

int CBB_flush_asn1_set_of(CBB *cbb) {}