Go to the documentation of this file.
23 #include "../internal.h"
64 if (*out_ptr == NULL) {
72 if (*out_ptr != NULL) {
76 return (*out_ptr != NULL);
97 for (
size_t i = 0;
i <
len;
i++) {
203 assert(len_len <= 3);
237 if ((
v >> (64 - 7)) != 0) {
241 if (
v == 0 &&
b == 0x80) {
245 v = (
v << 7) | (
b & 0x7f);
267 unsigned tag_number = tag_byte & 0x1f;
268 if (tag_number == 0x1f) {
277 tag_number = (unsigned)
v;
287 size_t *out_header_len,
int *out_ber_found,
303 if (out_tag != NULL) {
317 if ((length_byte & 0x80) == 0) {
319 len = ((size_t) length_byte) + header_len;
320 if (out_header_len != NULL) {
321 *out_header_len = header_len;
327 const size_t num_bytes = length_byte & 0x7f;
332 if (out_header_len != NULL) {
333 *out_header_len = header_len;
342 if (num_bytes == 0 || num_bytes > 4) {
360 if ((len64 >> ((num_bytes - 1) * 8)) == 0) {
369 if (
len + header_len + num_bytes <
len) {
373 len += header_len + num_bytes;
374 if (out_header_len != NULL) {
375 *out_header_len = header_len + num_bytes;
397 size_t *out_header_len) {
403 size_t *out_header_len,
int *out_ber_found) {
406 cbs,
out, out_tag, out_header_len,
407 out_ber_found ? out_ber_found : &ber_found_temp, 1 );
461 for (
size_t i = 0;
i <
len;
i++) {
462 if ((*
out >> 56) != 0) {
489 memset(
u.bytes, is_negative ? 0xff : 0,
sizeof(
u.bytes));
490 for (
size_t i = 0;
i <
len;
i++) {
523 if (out_present != NULL) {
524 *out_present = present;
547 *out_present = present;
565 *
out = default_value;
589 }
else if (
boolean == 0xff) {
595 *
out = default_value;
604 num_unused_bits > 7) {
608 if (num_unused_bits == 0) {
615 (last & ((1 << num_unused_bits) - 1)) != 0) {
627 const unsigned byte_num = (bit >> 3) + 1;
628 const unsigned bit_num = 7 - (bit & 7);
639 uint8_t first_byte, second_byte;
643 if (out_is_negative != NULL) {
644 *out_is_negative = (first_byte & 0x80) != 0;
649 if ((first_byte == 0x00 && (second_byte & 0x80) == 0) ||
650 (first_byte == 0xff && (second_byte & 0x80) != 0)) {
int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value)
const uint8_t * CBS_data(const CBS *cbs)
static int add_decimal(CBB *out, uint64_t v)
return memset(p, 0, total)
int CBS_get_last_u8(CBS *cbs, uint8_t *out)
int CBS_get_u64le(CBS *cbs, uint64_t *out)
static uint16_t CRYPTO_bswap2(uint16_t x)
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
#define CBS_ASN1_OCTETSTRING
int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, int default_value)
static uint64_t CRYPTO_bswap8(uint64_t x)
int CBS_get_u16le(CBS *cbs, uint16_t *out)
static int cbs_get(CBS *cbs, const uint8_t **p, size_t n)
int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out)
static void * OPENSSL_memchr(const void *s, int c, size_t n)
OPENSSL_EXPORT pem_password_cb void * u
static int cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header)
int CBS_contains_zero_byte(const CBS *cbs)
int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len)
#define CBS_ASN1_TAG_SHIFT
int CBS_get_bytes(CBS *cbs, CBS *out, size_t len)
int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out)
static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len)
int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, uint64_t default_value)
int CBS_strdup(const CBS *cbs, char **out_ptr)
int CBS_get_u64(CBS *cbs, uint64_t *out)
int CBS_get_u8(CBS *cbs, uint8_t *out)
static uint32_t CRYPTO_bswap4(uint32_t x)
static void * tag(intptr_t t)
char * CBS_asn1_oid_to_text(const CBS *cbs)
int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len)
unsigned __int64 uint64_t
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
struct absl::base_internal::@2940::AllocList::Header header
int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag)
int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, unsigned tag)
int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit)
static int parse_base128_integer(CBS *cbs, uint64_t *out)
#define CBS_ASN1_CONSTRUCTED
int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value)
static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len, int *out_ber_found, int ber_ok)
size_t CBS_len(const CBS *cbs)
int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out)
int CBS_is_valid_asn1_bitstring(const CBS *cbs)
void CBS_init(CBS *cbs, const uint8_t *data, size_t len)
int CBS_get_u24(CBS *cbs, uint32_t *out)
static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len)
int CBS_skip(CBS *cbs, size_t len)
static int parse_asn1_tag(CBS *cbs, unsigned *out)
int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len)
int CBS_get_u16(CBS *cbs, uint16_t *out)
int CBS_get_asn1_bool(CBS *cbs, int *out)
int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len)
int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len, int *out_ber_found)
int CBS_get_asn1_int64(CBS *cbs, int64_t *out)
#define DECIMAL_SIZE(type)
int CBS_get_u32(CBS *cbs, uint32_t *out)
#define CBS_ASN1_TAG_NUMBER_MASK
int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value)
int CBS_get_u32le(CBS *cbs, uint32_t *out)
static void split(const char *s, char ***ss, size_t *ns)
int CBS_is_valid_asn1_integer(const CBS *cbs, int *out_is_negative)
int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag)
int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out)
int CBS_get_until_first(CBS *cbs, CBS *out, uint8_t c)
int CBS_is_unsigned_asn1_integer(const CBS *cbs)
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:43