cbs.c
Go to the documentation of this file.
1 /* Copyright (c) 2014, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14 
15 #include <openssl/mem.h>
16 #include <openssl/bytestring.h>
17 
18 #include <assert.h>
19 #include <inttypes.h>
20 #include <string.h>
21 
22 #include "internal.h"
23 #include "../internal.h"
24 
25 
26 void CBS_init(CBS *cbs, const uint8_t *data, size_t len) {
27  cbs->data = data;
28  cbs->len = len;
29 }
30 
31 static int cbs_get(CBS *cbs, const uint8_t **p, size_t n) {
32  if (cbs->len < n) {
33  return 0;
34  }
35 
36  *p = cbs->data;
37  cbs->data += n;
38  cbs->len -= n;
39  return 1;
40 }
41 
42 int CBS_skip(CBS *cbs, size_t len) {
43  const uint8_t *dummy;
44  return cbs_get(cbs, &dummy, len);
45 }
46 
47 const uint8_t *CBS_data(const CBS *cbs) {
48  return cbs->data;
49 }
50 
51 size_t CBS_len(const CBS *cbs) {
52  return cbs->len;
53 }
54 
55 int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) {
56  OPENSSL_free(*out_ptr);
57  *out_ptr = NULL;
58  *out_len = 0;
59 
60  if (cbs->len == 0) {
61  return 1;
62  }
63  *out_ptr = OPENSSL_memdup(cbs->data, cbs->len);
64  if (*out_ptr == NULL) {
65  return 0;
66  }
67  *out_len = cbs->len;
68  return 1;
69 }
70 
71 int CBS_strdup(const CBS *cbs, char **out_ptr) {
72  if (*out_ptr != NULL) {
73  OPENSSL_free(*out_ptr);
74  }
75  *out_ptr = OPENSSL_strndup((const char*)cbs->data, cbs->len);
76  return (*out_ptr != NULL);
77 }
78 
80  return OPENSSL_memchr(cbs->data, 0, cbs->len) != NULL;
81 }
82 
83 int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) {
84  if (len != cbs->len) {
85  return 0;
86  }
87  return CRYPTO_memcmp(cbs->data, data, len) == 0;
88 }
89 
90 static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len) {
91  uint64_t result = 0;
92  const uint8_t *data;
93 
94  if (!cbs_get(cbs, &data, len)) {
95  return 0;
96  }
97  for (size_t i = 0; i < len; i++) {
98  result <<= 8;
99  result |= data[i];
100  }
101  *out = result;
102  return 1;
103 }
104 
106  const uint8_t *v;
107  if (!cbs_get(cbs, &v, 1)) {
108  return 0;
109  }
110  *out = *v;
111  return 1;
112 }
113 
115  uint64_t v;
116  if (!cbs_get_u(cbs, &v, 2)) {
117  return 0;
118  }
119  *out = v;
120  return 1;
121 }
122 
124  if (!CBS_get_u16(cbs, out)) {
125  return 0;
126  }
127  *out = CRYPTO_bswap2(*out);
128  return 1;
129 }
130 
132  uint64_t v;
133  if (!cbs_get_u(cbs, &v, 3)) {
134  return 0;
135  }
136  *out = v;
137  return 1;
138 }
139 
141  uint64_t v;
142  if (!cbs_get_u(cbs, &v, 4)) {
143  return 0;
144  }
145  *out = v;
146  return 1;
147 }
148 
150  if (!CBS_get_u32(cbs, out)) {
151  return 0;
152  }
153  *out = CRYPTO_bswap4(*out);
154  return 1;
155 }
156 
158  return cbs_get_u(cbs, out, 8);
159 }
160 
162  if (!cbs_get_u(cbs, out, 8)) {
163  return 0;
164  }
165  *out = CRYPTO_bswap8(*out);
166  return 1;
167 }
168 
170  if (cbs->len == 0) {
171  return 0;
172  }
173  *out = cbs->data[cbs->len - 1];
174  cbs->len--;
175  return 1;
176 }
177 
178 int CBS_get_bytes(CBS *cbs, CBS *out, size_t len) {
179  const uint8_t *v;
180  if (!cbs_get(cbs, &v, len)) {
181  return 0;
182  }
183  CBS_init(out, v, len);
184  return 1;
185 }
186 
187 int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) {
188  const uint8_t *v;
189  if (!cbs_get(cbs, &v, len)) {
190  return 0;
191  }
192  OPENSSL_memcpy(out, v, len);
193  return 1;
194 }
195 
196 static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len) {
197  uint64_t len;
198  if (!cbs_get_u(cbs, &len, len_len)) {
199  return 0;
200  }
201  // If |len_len| <= 3 then we know that |len| will fit into a |size_t|, even on
202  // 32-bit systems.
203  assert(len_len <= 3);
204  return CBS_get_bytes(cbs, out, len);
205 }
206 
208  return cbs_get_length_prefixed(cbs, out, 1);
209 }
210 
212  return cbs_get_length_prefixed(cbs, out, 2);
213 }
214 
216  return cbs_get_length_prefixed(cbs, out, 3);
217 }
218 
221  if (split == NULL) {
222  return 0;
223  }
224  return CBS_get_bytes(cbs, out, split - CBS_data(cbs));
225 }
226 
227 // parse_base128_integer reads a big-endian base-128 integer from |cbs| and sets
228 // |*out| to the result. This is the encoding used in DER for both high tag
229 // number form and OID components.
231  uint64_t v = 0;
232  uint8_t b;
233  do {
234  if (!CBS_get_u8(cbs, &b)) {
235  return 0;
236  }
237  if ((v >> (64 - 7)) != 0) {
238  // The value is too large.
239  return 0;
240  }
241  if (v == 0 && b == 0x80) {
242  // The value must be minimally encoded.
243  return 0;
244  }
245  v = (v << 7) | (b & 0x7f);
246 
247  // Values end at an octet with the high bit cleared.
248  } while (b & 0x80);
249 
250  *out = v;
251  return 1;
252 }
253 
254 static int parse_asn1_tag(CBS *cbs, unsigned *out) {
255  uint8_t tag_byte;
256  if (!CBS_get_u8(cbs, &tag_byte)) {
257  return 0;
258  }
259 
260  // ITU-T X.690 section 8.1.2.3 specifies the format for identifiers with a tag
261  // number no greater than 30.
262  //
263  // If the number portion is 31 (0x1f, the largest value that fits in the
264  // allotted bits), then the tag is more than one byte long and the
265  // continuation bytes contain the tag number.
266  unsigned tag = ((unsigned)tag_byte & 0xe0) << CBS_ASN1_TAG_SHIFT;
267  unsigned tag_number = tag_byte & 0x1f;
268  if (tag_number == 0x1f) {
269  uint64_t v;
270  if (!parse_base128_integer(cbs, &v) ||
271  // Check the tag number is within our supported bounds.
273  // Small tag numbers should have used low tag number form, even in BER.
274  v < 0x1f) {
275  return 0;
276  }
277  tag_number = (unsigned)v;
278  }
279 
280  tag |= tag_number;
281 
282  *out = tag;
283  return 1;
284 }
285 
286 static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
287  size_t *out_header_len, int *out_ber_found,
288  int ber_ok) {
289  CBS header = *cbs;
290  CBS throwaway;
291 
292  if (out == NULL) {
293  out = &throwaway;
294  }
295  if (ber_ok) {
296  *out_ber_found = 0;
297  }
298 
299  unsigned tag;
300  if (!parse_asn1_tag(&header, &tag)) {
301  return 0;
302  }
303  if (out_tag != NULL) {
304  *out_tag = tag;
305  }
306 
307  uint8_t length_byte;
308  if (!CBS_get_u8(&header, &length_byte)) {
309  return 0;
310  }
311 
312  size_t header_len = CBS_len(cbs) - CBS_len(&header);
313 
314  size_t len;
315  // The format for the length encoding is specified in ITU-T X.690 section
316  // 8.1.3.
317  if ((length_byte & 0x80) == 0) {
318  // Short form length.
319  len = ((size_t) length_byte) + header_len;
320  if (out_header_len != NULL) {
321  *out_header_len = header_len;
322  }
323  } else {
324  // The high bit indicate that this is the long form, while the next 7 bits
325  // encode the number of subsequent octets used to encode the length (ITU-T
326  // X.690 clause 8.1.3.5.b).
327  const size_t num_bytes = length_byte & 0x7f;
328  uint64_t len64;
329 
330  if (ber_ok && (tag & CBS_ASN1_CONSTRUCTED) != 0 && num_bytes == 0) {
331  // indefinite length
332  if (out_header_len != NULL) {
333  *out_header_len = header_len;
334  }
335  *out_ber_found = 1;
336  return CBS_get_bytes(cbs, out, header_len);
337  }
338 
339  // ITU-T X.690 clause 8.1.3.5.c specifies that the value 0xff shall not be
340  // used as the first byte of the length. If this parser encounters that
341  // value, num_bytes will be parsed as 127, which will fail this check.
342  if (num_bytes == 0 || num_bytes > 4) {
343  return 0;
344  }
345  if (!cbs_get_u(&header, &len64, num_bytes)) {
346  return 0;
347  }
348  // ITU-T X.690 section 10.1 (DER length forms) requires encoding the
349  // length with the minimum number of octets. BER could, technically, have
350  // 125 superfluous zero bytes. We do not attempt to handle that and still
351  // require that the length fit in a |uint32_t| for BER.
352  if (len64 < 128) {
353  // Length should have used short-form encoding.
354  if (ber_ok) {
355  *out_ber_found = 1;
356  } else {
357  return 0;
358  }
359  }
360  if ((len64 >> ((num_bytes - 1) * 8)) == 0) {
361  // Length should have been at least one byte shorter.
362  if (ber_ok) {
363  *out_ber_found = 1;
364  } else {
365  return 0;
366  }
367  }
368  len = len64;
369  if (len + header_len + num_bytes < len) {
370  // Overflow.
371  return 0;
372  }
373  len += header_len + num_bytes;
374  if (out_header_len != NULL) {
375  *out_header_len = header_len + num_bytes;
376  }
377  }
378 
379  return CBS_get_bytes(cbs, out, len);
380 }
381 
382 int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag) {
383  size_t header_len;
384  if (!CBS_get_any_asn1_element(cbs, out, out_tag, &header_len)) {
385  return 0;
386  }
387 
388  if (!CBS_skip(out, header_len)) {
389  assert(0);
390  return 0;
391  }
392 
393  return 1;
394 }
395 
396 int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
397  size_t *out_header_len) {
398  return cbs_get_any_asn1_element(cbs, out, out_tag, out_header_len,
399  NULL, 0 /* DER only */);
400 }
401 
402 int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag,
403  size_t *out_header_len, int *out_ber_found) {
404  int ber_found_temp;
406  cbs, out, out_tag, out_header_len,
407  out_ber_found ? out_ber_found : &ber_found_temp, 1 /* BER allowed */);
408 }
409 
410 static int cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value,
411  int skip_header) {
412  size_t header_len;
413  unsigned tag;
414  CBS throwaway;
415 
416  if (out == NULL) {
417  out = &throwaway;
418  }
419 
420  if (!CBS_get_any_asn1_element(cbs, out, &tag, &header_len) ||
421  tag != tag_value) {
422  return 0;
423  }
424 
425  if (skip_header && !CBS_skip(out, header_len)) {
426  assert(0);
427  return 0;
428  }
429 
430  return 1;
431 }
432 
433 int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value) {
434  return cbs_get_asn1(cbs, out, tag_value, 1 /* skip header */);
435 }
436 
437 int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value) {
438  return cbs_get_asn1(cbs, out, tag_value, 0 /* include header */);
439 }
440 
441 int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value) {
442  if (CBS_len(cbs) < 1) {
443  return 0;
444  }
445 
446  CBS copy = *cbs;
447  unsigned actual_tag;
448  return parse_asn1_tag(&copy, &actual_tag) && tag_value == actual_tag;
449 }
450 
452  CBS bytes;
455  return 0;
456  }
457 
458  *out = 0;
459  const uint8_t *data = CBS_data(&bytes);
460  size_t len = CBS_len(&bytes);
461  for (size_t i = 0; i < len; i++) {
462  if ((*out >> 56) != 0) {
463  // Too large to represent as a uint64_t.
464  return 0;
465  }
466  *out <<= 8;
467  *out |= data[i];
468  }
469 
470  return 1;
471 }
472 
474  int is_negative;
475  CBS bytes;
477  !CBS_is_valid_asn1_integer(&bytes, &is_negative)) {
478  return 0;
479  }
480  const uint8_t *data = CBS_data(&bytes);
481  const size_t len = CBS_len(&bytes);
482  if (len > sizeof(int64_t)) {
483  return 0;
484  }
485  union {
486  int64_t i;
487  uint8_t bytes[sizeof(int64_t)];
488  } u;
489  memset(u.bytes, is_negative ? 0xff : 0, sizeof(u.bytes)); // Sign-extend.
490  for (size_t i = 0; i < len; i++) {
491  u.bytes[i] = data[len - i - 1];
492  }
493  *out = u.i;
494  return 1;
495 }
496 
498  CBS bytes;
500  CBS_len(&bytes) != 1) {
501  return 0;
502  }
503 
504  const uint8_t value = *CBS_data(&bytes);
505  if (value != 0 && value != 0xff) {
506  return 0;
507  }
508 
509  *out = !!value;
510  return 1;
511 }
512 
513 int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag) {
514  int present = 0;
515 
516  if (CBS_peek_asn1_tag(cbs, tag)) {
517  if (!CBS_get_asn1(cbs, out, tag)) {
518  return 0;
519  }
520  present = 1;
521  }
522 
523  if (out_present != NULL) {
524  *out_present = present;
525  }
526 
527  return 1;
528 }
529 
531  unsigned tag) {
532  CBS child;
533  int present;
534  if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) {
535  return 0;
536  }
537  if (present) {
538  assert(out);
540  CBS_len(&child) != 0) {
541  return 0;
542  }
543  } else {
544  CBS_init(out, NULL, 0);
545  }
546  if (out_present) {
547  *out_present = present;
548  }
549  return 1;
550 }
551 
553  uint64_t default_value) {
554  CBS child;
555  int present;
556  if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) {
557  return 0;
558  }
559  if (present) {
560  if (!CBS_get_asn1_uint64(&child, out) ||
561  CBS_len(&child) != 0) {
562  return 0;
563  }
564  } else {
565  *out = default_value;
566  }
567  return 1;
568 }
569 
570 int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag,
571  int default_value) {
572  CBS child, child2;
573  int present;
574  if (!CBS_get_optional_asn1(cbs, &child, &present, tag)) {
575  return 0;
576  }
577  if (present) {
578  uint8_t boolean;
579 
580  if (!CBS_get_asn1(&child, &child2, CBS_ASN1_BOOLEAN) ||
581  CBS_len(&child2) != 1 ||
582  CBS_len(&child) != 0) {
583  return 0;
584  }
585 
586  boolean = CBS_data(&child2)[0];
587  if (boolean == 0) {
588  *out = 0;
589  } else if (boolean == 0xff) {
590  *out = 1;
591  } else {
592  return 0;
593  }
594  } else {
595  *out = default_value;
596  }
597  return 1;
598 }
599 
601  CBS in = *cbs;
602  uint8_t num_unused_bits;
603  if (!CBS_get_u8(&in, &num_unused_bits) ||
604  num_unused_bits > 7) {
605  return 0;
606  }
607 
608  if (num_unused_bits == 0) {
609  return 1;
610  }
611 
612  // All num_unused_bits bits must exist and be zeros.
613  uint8_t last;
614  if (!CBS_get_last_u8(&in, &last) ||
615  (last & ((1 << num_unused_bits) - 1)) != 0) {
616  return 0;
617  }
618 
619  return 1;
620 }
621 
622 int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit) {
624  return 0;
625  }
626 
627  const unsigned byte_num = (bit >> 3) + 1;
628  const unsigned bit_num = 7 - (bit & 7);
629 
630  // Unused bits are zero, and this function does not distinguish between
631  // missing and unset bits. Thus it is sufficient to do a byte-level length
632  // check.
633  return byte_num < CBS_len(cbs) &&
634  (CBS_data(cbs)[byte_num] & (1 << bit_num)) != 0;
635 }
636 
637 int CBS_is_valid_asn1_integer(const CBS *cbs, int *out_is_negative) {
638  CBS copy = *cbs;
639  uint8_t first_byte, second_byte;
640  if (!CBS_get_u8(&copy, &first_byte)) {
641  return 0; // INTEGERs may not be empty.
642  }
643  if (out_is_negative != NULL) {
644  *out_is_negative = (first_byte & 0x80) != 0;
645  }
646  if (!CBS_get_u8(&copy, &second_byte)) {
647  return 1; // One byte INTEGERs are always minimal.
648  }
649  if ((first_byte == 0x00 && (second_byte & 0x80) == 0) ||
650  (first_byte == 0xff && (second_byte & 0x80) != 0)) {
651  return 0; // The value is minimal iff the first 9 bits are not all equal.
652  }
653  return 1;
654 }
655 
657  int is_negative;
658  return CBS_is_valid_asn1_integer(cbs, &is_negative) && !is_negative;
659 }
660 
661 static int add_decimal(CBB *out, uint64_t v) {
662  char buf[DECIMAL_SIZE(uint64_t) + 1];
663  BIO_snprintf(buf, sizeof(buf), "%" PRIu64, v);
664  return CBB_add_bytes(out, (const uint8_t *)buf, strlen(buf));
665 }
666 
667 char *CBS_asn1_oid_to_text(const CBS *cbs) {
668  CBB cbb;
669  if (!CBB_init(&cbb, 32)) {
670  goto err;
671  }
672 
673  CBS copy = *cbs;
674  // The first component is 40 * value1 + value2, where value1 is 0, 1, or 2.
675  uint64_t v;
676  if (!parse_base128_integer(&copy, &v)) {
677  goto err;
678  }
679 
680  if (v >= 80) {
681  if (!CBB_add_bytes(&cbb, (const uint8_t *)"2.", 2) ||
682  !add_decimal(&cbb, v - 80)) {
683  goto err;
684  }
685  } else if (!add_decimal(&cbb, v / 40) ||
686  !CBB_add_u8(&cbb, '.') ||
687  !add_decimal(&cbb, v % 40)) {
688  goto err;
689  }
690 
691  while (CBS_len(&copy) != 0) {
692  if (!parse_base128_integer(&copy, &v) ||
693  !CBB_add_u8(&cbb, '.') ||
694  !add_decimal(&cbb, v)) {
695  goto err;
696  }
697  }
698 
699  uint8_t *txt;
700  size_t txt_len;
701  if (!CBB_add_u8(&cbb, '\0') ||
702  !CBB_finish(&cbb, &txt, &txt_len)) {
703  goto err;
704  }
705 
706  return (char *)txt;
707 
708 err:
709  CBB_cleanup(&cbb);
710  return NULL;
711 }
CBS_get_asn1
int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value)
Definition: cbs.c:433
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
CBS_ASN1_INTEGER
#define CBS_ASN1_INTEGER
Definition: bytestring.h:207
CBS_data
const uint8_t * CBS_data(const CBS *cbs)
Definition: cbs.c:47
CBB_init
#define CBB_init
Definition: boringssl_prefix_symbols.h:1047
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
add_decimal
static int add_decimal(CBB *out, uint64_t v)
Definition: cbs.c:661
cbs_st
Definition: bytestring.h:39
CBB_cleanup
#define CBB_cleanup
Definition: boringssl_prefix_symbols.h:1039
memset
return memset(p, 0, total)
CBS_get_last_u8
int CBS_get_last_u8(CBS *cbs, uint8_t *out)
Definition: cbs.c:169
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
CBS_get_u64le
int CBS_get_u64le(CBS *cbs, uint64_t *out)
Definition: cbs.c:161
CRYPTO_bswap2
static uint16_t CRYPTO_bswap2(uint16_t x)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:749
string.h
copy
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
Definition: message_compress.cc:145
CBS_ASN1_OCTETSTRING
#define CBS_ASN1_OCTETSTRING
Definition: bytestring.h:209
CBB_add_u8
#define CBB_add_u8
Definition: boringssl_prefix_symbols.h:1036
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
CBS_get_optional_asn1_bool
int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, int default_value)
Definition: cbs.c:570
CRYPTO_bswap8
static uint64_t CRYPTO_bswap8(uint64_t x)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:759
CBS_get_u16le
int CBS_get_u16le(CBS *cbs, uint16_t *out)
Definition: cbs.c:123
cbs_get
static int cbs_get(CBS *cbs, const uint8_t **p, size_t n)
Definition: cbs.c:31
CBS_get_u24_length_prefixed
int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out)
Definition: cbs.c:215
error_ref_leak.err
err
Definition: error_ref_leak.py:35
OPENSSL_memchr
static void * OPENSSL_memchr(const void *s, int c, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:801
cbs_st::len
size_t len
Definition: bytestring.h:41
u
OPENSSL_EXPORT pem_password_cb void * u
Definition: pem.h:351
cbs_get_asn1
static int cbs_get_asn1(CBS *cbs, CBS *out, unsigned tag_value, int skip_header)
Definition: cbs.c:410
CBS_contains_zero_byte
int CBS_contains_zero_byte(const CBS *cbs)
Definition: cbs.c:79
CBS_ASN1_BOOLEAN
#define CBS_ASN1_BOOLEAN
Definition: bytestring.h:206
CBS_stow
int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len)
Definition: cbs.c:55
cbs
const CBS * cbs
Definition: third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h:107
xds_manager.p
p
Definition: xds_manager.py:60
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
CBS_ASN1_TAG_SHIFT
#define CBS_ASN1_TAG_SHIFT
Definition: bytestring.h:185
CBS_get_bytes
int CBS_get_bytes(CBS *cbs, CBS *out, size_t len)
Definition: cbs.c:178
CBS_get_u8_length_prefixed
int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out)
Definition: cbs.c:207
cbs_get_length_prefixed
static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len)
Definition: cbs.c:196
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
CBS_get_optional_asn1_uint64
int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, unsigned tag, uint64_t default_value)
Definition: cbs.c:552
bytestring.h
internal.h
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
CBS_strdup
int CBS_strdup(const CBS *cbs, char **out_ptr)
Definition: cbs.c:71
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
CBS_get_u64
int CBS_get_u64(CBS *cbs, uint64_t *out)
Definition: cbs.c:157
CBS_get_u8
int CBS_get_u8(CBS *cbs, uint8_t *out)
Definition: cbs.c:105
CRYPTO_bswap4
static uint32_t CRYPTO_bswap4(uint32_t x)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:753
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
CBS_asn1_oid_to_text
char * CBS_asn1_oid_to_text(const CBS *cbs)
Definition: cbs.c:667
CBS_get_any_asn1_element
int CBS_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len)
Definition: cbs.c:396
CBB_finish
#define CBB_finish
Definition: boringssl_prefix_symbols.h:1043
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
OPENSSL_memcpy
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:819
header
struct absl::base_internal::@2940::AllocList::Header header
CBS_get_any_asn1
int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag)
Definition: cbs.c:382
googletest-filter-unittest.child
child
Definition: bloaty/third_party/googletest/googletest/test/googletest-filter-unittest.py:62
CBS_get_optional_asn1_octet_string
int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, int *out_present, unsigned tag)
Definition: cbs.c:530
CBS_asn1_bitstring_has_bit
int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit)
Definition: cbs.c:622
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
n
int n
Definition: abseil-cpp/absl/container/btree_test.cc:1080
BIO_snprintf
#define BIO_snprintf
Definition: boringssl_prefix_symbols.h:864
parse_base128_integer
static int parse_base128_integer(CBS *cbs, uint64_t *out)
Definition: cbs.c:230
CBS_ASN1_CONSTRUCTED
#define CBS_ASN1_CONSTRUCTED
Definition: bytestring.h:188
CBS_get_asn1_element
int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value)
Definition: cbs.c:437
cbs_get_any_asn1_element
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)
Definition: cbs.c:286
value
const char * value
Definition: hpack_parser_table.cc:165
CBS_len
size_t CBS_len(const CBS *cbs)
Definition: cbs.c:51
CBB_add_bytes
#define CBB_add_bytes
Definition: boringssl_prefix_symbols.h:1025
bytes
uint8 bytes[10]
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/coded_stream_unittest.cc:153
CBS_get_asn1_uint64
int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out)
Definition: cbs.c:451
CBS_is_valid_asn1_bitstring
int CBS_is_valid_asn1_bitstring(const CBS *cbs)
Definition: cbs.c:600
CBS_init
void CBS_init(CBS *cbs, const uint8_t *data, size_t len)
Definition: cbs.c:26
CBS_get_u24
int CBS_get_u24(CBS *cbs, uint32_t *out)
Definition: cbs.c:131
OPENSSL_memdup
#define OPENSSL_memdup
Definition: boringssl_prefix_symbols.h:1887
cbs_get_u
static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len)
Definition: cbs.c:90
CBS_skip
int CBS_skip(CBS *cbs, size_t len)
Definition: cbs.c:42
parse_asn1_tag
static int parse_asn1_tag(CBS *cbs, unsigned *out)
Definition: cbs.c:254
CBS_mem_equal
int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len)
Definition: cbs.c:83
CBS_get_u16
int CBS_get_u16(CBS *cbs, uint16_t *out)
Definition: cbs.c:114
CBS_get_asn1_bool
int CBS_get_asn1_bool(CBS *cbs, int *out)
Definition: cbs.c:497
CBS_copy_bytes
int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len)
Definition: cbs.c:187
CBS_get_any_ber_asn1_element
int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, size_t *out_header_len, int *out_ber_found)
Definition: cbs.c:402
absl::ABSL_NAMESPACE_BEGIN::dummy
int dummy
Definition: function_type_benchmark.cc:28
CBS_get_asn1_int64
int CBS_get_asn1_int64(CBS *cbs, int64_t *out)
Definition: cbs.c:473
DECIMAL_SIZE
#define DECIMAL_SIZE(type)
Definition: mem.h:124
CBS_get_u32
int CBS_get_u32(CBS *cbs, uint32_t *out)
Definition: cbs.c:140
CBS_ASN1_TAG_NUMBER_MASK
#define CBS_ASN1_TAG_NUMBER_MASK
Definition: bytestring.h:202
CBS_peek_asn1_tag
int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value)
Definition: cbs.c:441
mem.h
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
CBS_get_u32le
int CBS_get_u32le(CBS *cbs, uint32_t *out)
Definition: cbs.c:149
split
static void split(const char *s, char ***ss, size_t *ns)
Definition: debug/trace.cc:111
CBS_is_valid_asn1_integer
int CBS_is_valid_asn1_integer(const CBS *cbs, int *out_is_negative)
Definition: cbs.c:637
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
CBS_get_optional_asn1
int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, unsigned tag)
Definition: cbs.c:513
OPENSSL_strndup
#define OPENSSL_strndup
Definition: boringssl_prefix_symbols.h:1896
CRYPTO_memcmp
#define CRYPTO_memcmp
Definition: boringssl_prefix_symbols.h:1178
CBS_get_u16_length_prefixed
int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out)
Definition: cbs.c:211
CBS_get_until_first
int CBS_get_until_first(CBS *cbs, CBS *out, uint8_t c)
Definition: cbs.c:219
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
CBS_is_unsigned_asn1_integer
int CBS_is_unsigned_asn1_integer(const CBS *cbs)
Definition: cbs.c:656
cbb_st
Definition: bytestring.h:375
cbs_st::data
const uint8_t * data
Definition: bytestring.h:40


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:43