chromium/third_party/boringssl/src/crypto/bytestring/cbs.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/asn1.h>
#include <openssl/bytestring.h>
#include <openssl/mem.h>

#include <assert.h>
#include <ctype.h>
#include <inttypes.h>
#include <string.h>

#include "../asn1/internal.h"
#include "../internal.h"
#include "internal.h"


static int cbs_get(CBS *cbs, const uint8_t **p, size_t n) {}

int CBS_skip(CBS *cbs, size_t len) {}

int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) {}

int CBS_strdup(const CBS *cbs, char **out_ptr) {}

int CBS_contains_zero_byte(const CBS *cbs) {}

int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) {}

static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len) {}

int CBS_get_u8(CBS *cbs, uint8_t *out) {}

int CBS_get_u16(CBS *cbs, uint16_t *out) {}

int CBS_get_u16le(CBS *cbs, uint16_t *out) {}

int CBS_get_u24(CBS *cbs, uint32_t *out) {}

int CBS_get_u32(CBS *cbs, uint32_t *out) {}

int CBS_get_u32le(CBS *cbs, uint32_t *out) {}

int CBS_get_u64(CBS *cbs, uint64_t *out) {}

int CBS_get_u64le(CBS *cbs, uint64_t *out) {}

int CBS_get_last_u8(CBS *cbs, uint8_t *out) {}

int CBS_get_bytes(CBS *cbs, CBS *out, size_t len) {}

int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) {}

static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len) {}

int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out) {}

int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out) {}

int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out) {}

int CBS_get_until_first(CBS *cbs, CBS *out, uint8_t c) {}

int CBS_get_u64_decimal(CBS *cbs, uint64_t *out) {}

// parse_base128_integer reads a big-endian base-128 integer from |cbs| and sets
// |*out| to the result. This is the encoding used in DER for both high tag
// number form and OID components.
static int parse_base128_integer(CBS *cbs, uint64_t *out) {}

static int parse_asn1_tag(CBS *cbs, CBS_ASN1_TAG *out) {}

static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, CBS_ASN1_TAG *out_tag,
                                    size_t *out_header_len, int *out_ber_found,
                                    int *out_indefinite, int ber_ok) {}

int CBS_get_any_asn1(CBS *cbs, CBS *out, CBS_ASN1_TAG *out_tag) {}

int CBS_get_any_asn1_element(CBS *cbs, CBS *out, CBS_ASN1_TAG *out_tag,
                                    size_t *out_header_len) {}

int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, CBS_ASN1_TAG *out_tag,
                                 size_t *out_header_len, int *out_ber_found,
                                 int *out_indefinite) {}

static int cbs_get_asn1(CBS *cbs, CBS *out, CBS_ASN1_TAG tag_value,
                        int skip_header) {}

int CBS_get_asn1(CBS *cbs, CBS *out, CBS_ASN1_TAG tag_value) {}

int CBS_get_asn1_element(CBS *cbs, CBS *out, CBS_ASN1_TAG tag_value) {}

int CBS_peek_asn1_tag(const CBS *cbs, CBS_ASN1_TAG tag_value) {}

int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) {}

int CBS_get_asn1_int64(CBS *cbs, int64_t *out) {}

int CBS_get_asn1_bool(CBS *cbs, int *out) {}

int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, CBS_ASN1_TAG tag) {}

int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present,
                                       CBS_ASN1_TAG tag) {}

int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, CBS_ASN1_TAG tag,
                                 uint64_t default_value) {}

int CBS_get_optional_asn1_bool(CBS *cbs, int *out, CBS_ASN1_TAG tag,
                               int default_value) {}

int CBS_is_valid_asn1_bitstring(const CBS *cbs) {}

int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit) {}

int CBS_is_valid_asn1_integer(const CBS *cbs, int *out_is_negative) {}

int CBS_is_unsigned_asn1_integer(const CBS *cbs) {}

static int add_decimal(CBB *out, uint64_t v) {}

int CBS_is_valid_asn1_oid(const CBS *cbs) {}

char *CBS_asn1_oid_to_text(const CBS *cbs) {}

static int cbs_get_two_digits(CBS *cbs, int *out) {}

static int is_valid_day(int year, int month, int day) {}

static int CBS_parse_rfc5280_time_internal(const CBS *cbs, int is_gentime,
                                           int allow_timezone_offset,
                                           struct tm *out_tm) {}

int CBS_parse_generalized_time(const CBS *cbs, struct tm *out_tm,
                               int allow_timezone_offset) {}

int CBS_parse_utc_time(const CBS *cbs, struct tm *out_tm,
                       int allow_timezone_offset) {}