obj.c
Go to the documentation of this file.
1 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
2  * All rights reserved.
3  *
4  * This package is an SSL implementation written
5  * by Eric Young (eay@cryptsoft.com).
6  * The implementation was written so as to conform with Netscapes SSL.
7  *
8  * This library is free for commercial and non-commercial use as long as
9  * the following conditions are aheared to. The following conditions
10  * apply to all code found in this distribution, be it the RC4, RSA,
11  * lhash, DES, etc., code; not just the SSL code. The SSL documentation
12  * included with this distribution is covered by the same copyright terms
13  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
14  *
15  * Copyright remains Eric Young's, and as such any Copyright notices in
16  * the code are not to be removed.
17  * If this package is used in a product, Eric Young should be given attribution
18  * as the author of the parts of the library used.
19  * This can be in the form of a textual message at program startup or
20  * in documentation (online or textual) provided with the package.
21  *
22  * Redistribution and use in source and binary forms, with or without
23  * modification, are permitted provided that the following conditions
24  * are met:
25  * 1. Redistributions of source code must retain the copyright
26  * notice, this list of conditions and the following disclaimer.
27  * 2. Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  * 3. All advertising materials mentioning features or use of this software
31  * must display the following acknowledgement:
32  * "This product includes cryptographic software written by
33  * Eric Young (eay@cryptsoft.com)"
34  * The word 'cryptographic' can be left out if the rouines from the library
35  * being used are not cryptographic related :-).
36  * 4. If you include any Windows specific code (or a derivative thereof) from
37  * the apps directory (application code) you must include an acknowledgement:
38  * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
39  *
40  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
41  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
44  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50  * SUCH DAMAGE.
51  *
52  * The licence and distribution terms for any publically available version or
53  * derivative of this code cannot be changed. i.e. this code cannot simply be
54  * copied and put under another distribution licence
55  * [including the GNU Public Licence.] */
56 
57 #include <openssl/obj.h>
58 
59 #include <inttypes.h>
60 #include <limits.h>
61 #include <string.h>
62 
63 #include <openssl/asn1.h>
64 #include <openssl/bytestring.h>
65 #include <openssl/err.h>
66 #include <openssl/lhash.h>
67 #include <openssl/mem.h>
68 #include <openssl/thread.h>
69 
70 #include "../asn1/internal.h"
71 #include "../internal.h"
72 #include "../lhash/internal.h"
73 
74 // obj_data.h must be included after the definition of |ASN1_OBJECT|.
75 #include "obj_dat.h"
76 
77 
79 
81 // These globals are protected by |global_added_lock|.
82 static LHASH_OF(ASN1_OBJECT) *global_added_by_data = NULL;
83 static LHASH_OF(ASN1_OBJECT) *global_added_by_nid = NULL;
84 static LHASH_OF(ASN1_OBJECT) *global_added_by_short_name = NULL;
85 static LHASH_OF(ASN1_OBJECT) *global_added_by_long_name = NULL;
86 
87 static struct CRYPTO_STATIC_MUTEX global_next_nid_lock =
89 static unsigned global_next_nid = NUM_NID;
90 
91 static int obj_next_nid(void) {
92  int ret;
93 
94  CRYPTO_STATIC_MUTEX_lock_write(&global_next_nid_lock);
95  ret = global_next_nid++;
96  CRYPTO_STATIC_MUTEX_unlock_write(&global_next_nid_lock);
97 
98  return ret;
99 }
100 
102  ASN1_OBJECT *r;
103  unsigned char *data = NULL;
104  char *sn = NULL, *ln = NULL;
105 
106  if (o == NULL) {
107  return NULL;
108  }
109 
110  if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC)) {
111  // TODO(fork): this is a little dangerous.
112  return (ASN1_OBJECT *)o;
113  }
114 
115  r = ASN1_OBJECT_new();
116  if (r == NULL) {
118  return NULL;
119  }
120  r->ln = r->sn = NULL;
121 
122  data = OPENSSL_malloc(o->length);
123  if (data == NULL) {
124  goto err;
125  }
126  if (o->data != NULL) {
127  OPENSSL_memcpy(data, o->data, o->length);
128  }
129 
130  // once data is attached to an object, it remains const
131  r->data = data;
132  r->length = o->length;
133  r->nid = o->nid;
134 
135  if (o->ln != NULL) {
136  ln = OPENSSL_strdup(o->ln);
137  if (ln == NULL) {
138  goto err;
139  }
140  }
141 
142  if (o->sn != NULL) {
143  sn = OPENSSL_strdup(o->sn);
144  if (sn == NULL) {
145  goto err;
146  }
147  }
148 
149  r->sn = sn;
150  r->ln = ln;
151 
152  r->flags =
155  return r;
156 
157 err:
159  OPENSSL_free(ln);
160  OPENSSL_free(sn);
162  OPENSSL_free(r);
163  return NULL;
164 }
165 
166 int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
167  int ret;
168 
169  ret = a->length - b->length;
170  if (ret) {
171  return ret;
172  }
173  return OPENSSL_memcmp(a->data, b->data, a->length);
174 }
175 
177  if (obj == NULL) {
178  return NULL;
179  }
180 
181  return obj->data;
182 }
183 
184 size_t OBJ_length(const ASN1_OBJECT *obj) {
185  if (obj == NULL || obj->length < 0) {
186  return 0;
187  }
188 
189  return (size_t)obj->length;
190 }
191 
192 // obj_cmp is called to search the kNIDsInOIDOrder array. The |key| argument is
193 // an |ASN1_OBJECT|* that we're looking for and |element| is a pointer to an
194 // unsigned int in the array.
195 static int obj_cmp(const void *key, const void *element) {
196  uint16_t nid = *((const uint16_t *)element);
197  const ASN1_OBJECT *a = key;
198  const ASN1_OBJECT *b = &kObjects[nid];
199 
200  if (a->length < b->length) {
201  return -1;
202  } else if (a->length > b->length) {
203  return 1;
204  }
205  return OPENSSL_memcmp(a->data, b->data, a->length);
206 }
207 
209  if (obj == NULL) {
210  return NID_undef;
211  }
212 
213  if (obj->nid != 0) {
214  return obj->nid;
215  }
216 
218  if (global_added_by_data != NULL) {
220 
221  match = lh_ASN1_OBJECT_retrieve(global_added_by_data, obj);
222  if (match != NULL) {
224  return match->nid;
225  }
226  }
228 
229  const uint16_t *nid_ptr =
231  sizeof(kNIDsInOIDOrder[0]), obj_cmp);
232  if (nid_ptr == NULL) {
233  return NID_undef;
234  }
235 
236  return kObjects[*nid_ptr].nid;
237 }
238 
239 int OBJ_cbs2nid(const CBS *cbs) {
240  if (CBS_len(cbs) > INT_MAX) {
241  return NID_undef;
242  }
243 
245  OPENSSL_memset(&obj, 0, sizeof(obj));
246  obj.data = CBS_data(cbs);
247  obj.length = (int)CBS_len(cbs);
248 
249  return OBJ_obj2nid(&obj);
250 }
251 
252 // short_name_cmp is called to search the kNIDsInShortNameOrder array. The
253 // |key| argument is name that we're looking for and |element| is a pointer to
254 // an unsigned int in the array.
255 static int short_name_cmp(const void *key, const void *element) {
256  const char *name = (const char *)key;
257  uint16_t nid = *((const uint16_t *)element);
258 
259  return strcmp(name, kObjects[nid].sn);
260 }
261 
262 int OBJ_sn2nid(const char *short_name) {
264  if (global_added_by_short_name != NULL) {
265  ASN1_OBJECT *match, template;
266 
267  template.sn = short_name;
268  match = lh_ASN1_OBJECT_retrieve(global_added_by_short_name, &template);
269  if (match != NULL) {
271  return match->nid;
272  }
273  }
275 
276  const uint16_t *nid_ptr =
277  bsearch(short_name, kNIDsInShortNameOrder,
280  if (nid_ptr == NULL) {
281  return NID_undef;
282  }
283 
284  return kObjects[*nid_ptr].nid;
285 }
286 
287 // long_name_cmp is called to search the kNIDsInLongNameOrder array. The
288 // |key| argument is name that we're looking for and |element| is a pointer to
289 // an unsigned int in the array.
290 static int long_name_cmp(const void *key, const void *element) {
291  const char *name = (const char *)key;
292  uint16_t nid = *((const uint16_t *)element);
293 
294  return strcmp(name, kObjects[nid].ln);
295 }
296 
297 int OBJ_ln2nid(const char *long_name) {
299  if (global_added_by_long_name != NULL) {
300  ASN1_OBJECT *match, template;
301 
302  template.ln = long_name;
303  match = lh_ASN1_OBJECT_retrieve(global_added_by_long_name, &template);
304  if (match != NULL) {
306  return match->nid;
307  }
308  }
310 
311  const uint16_t *nid_ptr = bsearch(
313  sizeof(kNIDsInLongNameOrder[0]), long_name_cmp);
314  if (nid_ptr == NULL) {
315  return NID_undef;
316  }
317 
318  return kObjects[*nid_ptr].nid;
319 }
320 
321 int OBJ_txt2nid(const char *s) {
322  ASN1_OBJECT *obj;
323  int nid;
324 
325  obj = OBJ_txt2obj(s, 0 /* search names */);
326  nid = OBJ_obj2nid(obj);
328  return nid;
329 }
330 
332  const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
333  CBB oid;
334 
335  if (obj == NULL ||
337  !CBB_add_bytes(&oid, obj->data, obj->length) ||
338  !CBB_flush(out)) {
339  return 0;
340  }
341 
342  return 1;
343 }
344 
346  if (nid >= 0 && nid < NUM_NID) {
347  if (nid != NID_undef && kObjects[nid].nid == NID_undef) {
348  goto err;
349  }
350  return (ASN1_OBJECT *)&kObjects[nid];
351  }
352 
354  if (global_added_by_nid != NULL) {
355  ASN1_OBJECT *match, template;
356 
357  template.nid = nid;
358  match = lh_ASN1_OBJECT_retrieve(global_added_by_nid, &template);
359  if (match != NULL) {
361  return match;
362  }
363  }
365 
366 err:
368  return NULL;
369 }
370 
371 const char *OBJ_nid2sn(int nid) {
372  const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
373  if (obj == NULL) {
374  return NULL;
375  }
376 
377  return obj->sn;
378 }
379 
380 const char *OBJ_nid2ln(int nid) {
381  const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
382  if (obj == NULL) {
383  return NULL;
384  }
385 
386  return obj->ln;
387 }
388 
389 static ASN1_OBJECT *create_object_with_text_oid(int (*get_nid)(void),
390  const char *oid,
391  const char *short_name,
392  const char *long_name) {
393  uint8_t *buf;
394  size_t len;
395  CBB cbb;
396  if (!CBB_init(&cbb, 32) ||
397  !CBB_add_asn1_oid_from_text(&cbb, oid, strlen(oid)) ||
398  !CBB_finish(&cbb, &buf, &len)) {
400  CBB_cleanup(&cbb);
401  return NULL;
402  }
403 
404  ASN1_OBJECT *ret = ASN1_OBJECT_create(get_nid ? get_nid() : NID_undef, buf,
405  len, short_name, long_name);
406  OPENSSL_free(buf);
407  return ret;
408 }
409 
410 ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) {
411  if (!dont_search_names) {
412  int nid = OBJ_sn2nid(s);
413  if (nid == NID_undef) {
414  nid = OBJ_ln2nid(s);
415  }
416 
417  if (nid != NID_undef) {
418  return OBJ_nid2obj(nid);
419  }
420  }
421 
422  return create_object_with_text_oid(NULL, s, NULL, NULL);
423 }
424 
425 static int strlcpy_int(char *dst, const char *src, int dst_size) {
426  size_t ret = OPENSSL_strlcpy(dst, src, dst_size < 0 ? 0 : (size_t)dst_size);
427  if (ret > INT_MAX) {
429  return -1;
430  }
431  return (int)ret;
432 }
433 
434 int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj,
435  int always_return_oid) {
436  // Python depends on the empty OID successfully encoding as the empty
437  // string.
438  if (obj == NULL || obj->length == 0) {
439  return strlcpy_int(out, "", out_len);
440  }
441 
442  if (!always_return_oid) {
443  int nid = OBJ_obj2nid(obj);
444  if (nid != NID_undef) {
445  const char *name = OBJ_nid2ln(nid);
446  if (name == NULL) {
447  name = OBJ_nid2sn(nid);
448  }
449  if (name != NULL) {
450  return strlcpy_int(out, name, out_len);
451  }
452  }
453  }
454 
455  CBS cbs;
456  CBS_init(&cbs, obj->data, obj->length);
457  char *txt = CBS_asn1_oid_to_text(&cbs);
458  if (txt == NULL) {
459  if (out_len > 0) {
460  out[0] = '\0';
461  }
462  return -1;
463  }
464 
465  int ret = strlcpy_int(out, txt, out_len);
466  OPENSSL_free(txt);
467  return ret;
468 }
469 
471  return obj->nid;
472 }
473 
474 static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
475  return a->nid - b->nid;
476 }
477 
479  return OPENSSL_hash32(obj->data, obj->length);
480 }
481 
482 static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
483  int i = a->length - b->length;
484  if (i) {
485  return i;
486  }
487  return OPENSSL_memcmp(a->data, b->data, a->length);
488 }
489 
491  return OPENSSL_strhash(obj->sn);
492 }
493 
494 static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
495  return strcmp(a->sn, b->sn);
496 }
497 
499  return OPENSSL_strhash(obj->ln);
500 }
501 
502 static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b) {
503  return strcmp(a->ln, b->ln);
504 }
505 
506 // obj_add_object inserts |obj| into the various global hashes for run-time
507 // added objects. It returns one on success or zero otherwise.
509  int ok;
510  ASN1_OBJECT *old_object;
511 
514 
516  if (global_added_by_nid == NULL) {
517  global_added_by_nid = lh_ASN1_OBJECT_new(hash_nid, cmp_nid);
518  global_added_by_data = lh_ASN1_OBJECT_new(hash_data, cmp_data);
519  global_added_by_short_name = lh_ASN1_OBJECT_new(hash_short_name, cmp_short_name);
520  global_added_by_long_name = lh_ASN1_OBJECT_new(hash_long_name, cmp_long_name);
521  }
522 
523  // We don't pay attention to |old_object| (which contains any previous object
524  // that was evicted from the hashes) because we don't have a reference count
525  // on ASN1_OBJECT values. Also, we should never have duplicates nids and so
526  // should always have objects in |global_added_by_nid|.
527 
528  ok = lh_ASN1_OBJECT_insert(global_added_by_nid, &old_object, obj);
529  if (obj->length != 0 && obj->data != NULL) {
530  ok &= lh_ASN1_OBJECT_insert(global_added_by_data, &old_object, obj);
531  }
532  if (obj->sn != NULL) {
533  ok &= lh_ASN1_OBJECT_insert(global_added_by_short_name, &old_object, obj);
534  }
535  if (obj->ln != NULL) {
536  ok &= lh_ASN1_OBJECT_insert(global_added_by_long_name, &old_object, obj);
537  }
539 
540  return ok;
541 }
542 
543 int OBJ_create(const char *oid, const char *short_name, const char *long_name) {
544  ASN1_OBJECT *op =
545  create_object_with_text_oid(obj_next_nid, oid, short_name, long_name);
546  if (op == NULL ||
547  !obj_add_object(op)) {
548  return NID_undef;
549  }
550  return op->nid;
551 }
552 
553 void OBJ_cleanup(void) {}
ASN1_OBJECT_FLAG_DYNAMIC_DATA
#define ASN1_OBJECT_FLAG_DYNAMIC_DATA
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:94
OBJ_cleanup
void OBJ_cleanup(void)
Definition: obj.c:553
asn1_object_st::length
int length
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:105
obj
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1671
CRYPTO_STATIC_MUTEX_INIT
#define CRYPTO_STATIC_MUTEX_INIT
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:536
hash_short_name
static uint32_t hash_short_name(const ASN1_OBJECT *obj)
Definition: obj.c:490
global_added_lock
static struct CRYPTO_STATIC_MUTEX global_added_lock
Definition: obj.c:80
CBB_flush
#define CBB_flush
Definition: boringssl_prefix_symbols.h:1045
dst
static const char dst[]
Definition: test-fs-copyfile.c:37
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
element
static std::function< Slot &(Slot *)> element
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:44
cbs_st
Definition: bytestring.h:39
OPENSSL_memcmp
static int OPENSSL_memcmp(const void *s1, const void *s2, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:811
ASN1_OBJECT_new
#define ASN1_OBJECT_new
Definition: boringssl_prefix_symbols.h:657
CBB_cleanup
#define CBB_cleanup
Definition: boringssl_prefix_symbols.h:1039
kObjects
static const ASN1_OBJECT kObjects[NUM_NID]
Definition: obj_dat.h:7142
cmp_short_name
static int cmp_short_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
Definition: obj.c:494
CBS_data
#define CBS_data
Definition: boringssl_prefix_symbols.h:1057
CRYPTO_STATIC_MUTEX_unlock_write
#define CRYPTO_STATIC_MUTEX_unlock_write
Definition: boringssl_prefix_symbols.h:1135
uint16_t
unsigned short uint16_t
Definition: stdint-msvc2008.h:79
create_object_with_text_oid
static ASN1_OBJECT * create_object_with_text_oid(int(*get_nid)(void), const char *oid, const char *short_name, const char *long_name)
Definition: obj.c:389
OBJ_txt2nid
int OBJ_txt2nid(const char *s)
Definition: obj.c:321
ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:93
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
match
unsigned char match[65280+2]
Definition: bloaty/third_party/zlib/examples/gun.c:165
string.h
OPENSSL_ARRAY_SIZE
#define OPENSSL_ARRAY_SIZE(array)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:179
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
hash_long_name
static uint32_t hash_long_name(const ASN1_OBJECT *obj)
Definition: obj.c:498
cmp_data
static int cmp_data(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
Definition: obj.c:482
error_ref_leak.err
err
Definition: error_ref_leak.py:35
OPENSSL_hash32
#define OPENSSL_hash32
Definition: boringssl_prefix_symbols.h:1873
CBS_len
#define CBS_len
Definition: boringssl_prefix_symbols.h:1089
OBJ_get0_data
const uint8_t * OBJ_get0_data(const ASN1_OBJECT *obj)
Definition: obj.c:176
setup.name
name
Definition: setup.py:542
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
cbs
const CBS * cbs
Definition: third_party/boringssl-with-bazel/src/crypto/trust_token/internal.h:107
CBS_init
#define CBS_init
Definition: boringssl_prefix_symbols.h:1085
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
hash_data
static uint32_t hash_data(const ASN1_OBJECT *obj)
Definition: obj.c:478
OPENSSL_memset
static void * OPENSSL_memset(void *dst, int c, size_t n)
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:835
gen_build_yaml.struct
def struct(**kwargs)
Definition: test/core/end2end/gen_build_yaml.py:30
asn1_object_st
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:102
short_name_cmp
static int short_name_cmp(const void *key, const void *element)
Definition: obj.c:255
asn1_object_st::flags
int flags
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:107
o
UnboundConversion o
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:97
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
CRYPTO_STATIC_MUTEX
Definition: third_party/boringssl-with-bazel/src/crypto/internal.h:533
kNIDsInOIDOrder
static const uint16_t kNIDsInOIDOrder[]
Definition: obj_dat.h:10698
bytestring.h
hash_nid
static uint32_t hash_nid(const ASN1_OBJECT *obj)
Definition: obj.c:470
ASN1_OBJECT_FLAG_DYNAMIC
#define ASN1_OBJECT_FLAG_DYNAMIC
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:92
OBJ_sn2nid
int OBJ_sn2nid(const char *short_name)
Definition: obj.c:262
obj_cmp
static int obj_cmp(const void *key, const void *element)
Definition: obj.c:195
asn1_object_st::nid
int nid
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:104
xds_interop_client.int
int
Definition: xds_interop_client.py:113
OBJ_cbs2nid
int OBJ_cbs2nid(const CBS *cbs)
Definition: obj.c:239
oid
uint8_t oid[9]
Definition: digest_extra.c:124
OPENSSL_strhash
#define OPENSSL_strhash
Definition: boringssl_prefix_symbols.h:1892
asn1_object_st::sn
const char * sn
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:103
CBB_finish
#define CBB_finish
Definition: boringssl_prefix_symbols.h:1043
OBJ_obj2nid
int OBJ_obj2nid(const ASN1_OBJECT *obj)
Definition: obj.c:208
CRYPTO_STATIC_MUTEX_unlock_read
#define CRYPTO_STATIC_MUTEX_unlock_read
Definition: boringssl_prefix_symbols.h:1134
LHASH_OF
static LHASH_OF(ASN1_OBJECT)
Definition: obj.c:82
asn1_object_st::data
const unsigned char * data
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:106
CRYPTO_STATIC_MUTEX_lock_write
#define CRYPTO_STATIC_MUTEX_lock_write
Definition: boringssl_prefix_symbols.h:1133
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
CBB_add_asn1
#define CBB_add_asn1
Definition: boringssl_prefix_symbols.h:1019
err.h
obj_add_object
static int obj_add_object(ASN1_OBJECT *obj)
Definition: obj.c:508
OBJ_R_UNKNOWN_NID
#define OBJ_R_UNKNOWN_NID
Definition: obj.h:253
lhash.h
OBJ_obj2txt
int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, int always_return_oid)
Definition: obj.c:434
ASN1_OBJECT_free
#define ASN1_OBJECT_free
Definition: boringssl_prefix_symbols.h:655
NID_undef
#define NID_undef
Definition: nid.h:85
OBJ_nid2sn
const char * OBJ_nid2sn(int nid)
Definition: obj.c:371
data
char data[kBufferLength]
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1006
OBJ_nid2ln
const char * OBJ_nid2ln(int nid)
Definition: obj.c:380
b
uint64_t b
Definition: abseil-cpp/absl/container/internal/layout_test.cc:53
OBJ_R_INVALID_OID_STRING
#define OBJ_R_INVALID_OID_STRING
Definition: obj.h:254
CBB_add_asn1_oid_from_text
#define CBB_add_asn1_oid_from_text
Definition: boringssl_prefix_symbols.h:1023
ERR_R_OVERFLOW
#define ERR_R_OVERFLOW
Definition: err.h:375
OBJ_cmp
int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
Definition: obj.c:166
nid
int nid
Definition: cipher_extra.c:71
long_name_cmp
static int long_name_cmp(const void *key, const void *element)
Definition: obj.c:290
ERR_R_ASN1_LIB
#define ERR_R_ASN1_LIB
Definition: err.h:340
CBB_add_bytes
#define CBB_add_bytes
Definition: boringssl_prefix_symbols.h:1025
OBJ_nid2obj
ASN1_OBJECT * OBJ_nid2obj(int nid)
Definition: obj.c:345
key
const char * key
Definition: hpack_parser_table.cc:164
strlcpy_int
static int strlcpy_int(char *dst, const char *src, int dst_size)
Definition: obj.c:425
OPENSSL_strdup
#define OPENSSL_strdup
Definition: boringssl_prefix_symbols.h:1891
OPENSSL_strlcpy
#define OPENSSL_strlcpy
Definition: boringssl_prefix_symbols.h:1894
CBS_asn1_oid_to_text
#define CBS_asn1_oid_to_text
Definition: boringssl_prefix_symbols.h:1054
DEFINE_LHASH_OF
#define DEFINE_LHASH_OF(type)
Definition: third_party/boringssl-with-bazel/src/crypto/lhash/internal.h:159
CBS_ASN1_OBJECT
#define CBS_ASN1_OBJECT
Definition: bytestring.h:211
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
fix_build_deps.r
r
Definition: fix_build_deps.py:491
obj_dat.h
ok
bool ok
Definition: async_end2end_test.cc:197
OPENSSL_EXPORT
#define OPENSSL_EXPORT
Definition: base.h:222
OBJ_dup
ASN1_OBJECT * OBJ_dup(const ASN1_OBJECT *o)
Definition: obj.c:101
obj.h
OBJ_create
int OBJ_create(const char *oid, const char *short_name, const char *long_name)
Definition: obj.c:543
CRYPTO_STATIC_MUTEX_lock_read
#define CRYPTO_STATIC_MUTEX_lock_read
Definition: boringssl_prefix_symbols.h:1132
mem.h
OBJ_txt2obj
ASN1_OBJECT * OBJ_txt2obj(const char *s, int dont_search_names)
Definition: obj.c:410
cmp_nid
static int cmp_nid(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
Definition: obj.c:474
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
OBJ_nid2cbb
OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid)
Definition: obj.c:331
cmp_long_name
static int cmp_long_name(const ASN1_OBJECT *a, const ASN1_OBJECT *b)
Definition: obj.c:502
OBJ_length
size_t OBJ_length(const ASN1_OBJECT *obj)
Definition: obj.c:184
thread.h
OBJ_ln2nid
int OBJ_ln2nid(const char *long_name)
Definition: obj.c:297
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
NUM_NID
#define NUM_NID
Definition: obj_dat.h:60
ASN1_OBJECT_create
#define ASN1_OBJECT_create
Definition: boringssl_prefix_symbols.h:654
kNIDsInLongNameOrder
static const uint16_t kNIDsInLongNameOrder[]
Definition: obj_dat.h:9742
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
asn1.h
kNIDsInShortNameOrder
static const uint16_t kNIDsInShortNameOrder[]
Definition: obj_dat.h:8786
ERR_R_MALLOC_FAILURE
#define ERR_R_MALLOC_FAILURE
Definition: err.h:371
asn1_object_st::ln
const char * ln
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:103
cbb_st
Definition: bytestring.h:375


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:43