x_name.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 <ctype.h>
58 #include <string.h>
59 
60 #include <openssl/asn1.h>
61 #include <openssl/asn1t.h>
62 #include <openssl/buf.h>
63 #include <openssl/err.h>
64 #include <openssl/mem.h>
65 #include <openssl/obj.h>
66 #include <openssl/stack.h>
67 #include <openssl/x509.h>
68 
69 #include "../asn1/internal.h"
70 #include "../internal.h"
71 #include "internal.h"
72 
73 
74 typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
75 DEFINE_STACK_OF(STACK_OF_X509_NAME_ENTRY)
76 
77 /*
78  * Maximum length of X509_NAME: much larger than anything we should
79  * ever see in practice.
80  */
81 
82 #define X509_NAME_MAX (1024 * 1024)
83 
84 static int x509_name_ex_d2i(ASN1_VALUE **val,
85  const unsigned char **in, long len,
86  const ASN1_ITEM *it,
87  int tag, int aclass, char opt, ASN1_TLC *ctx);
88 
89 static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out,
90  const ASN1_ITEM *it, int tag, int aclass);
91 static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it);
92 static void x509_name_ex_free(ASN1_VALUE **val, const ASN1_ITEM *it);
93 
94 static int x509_name_encode(X509_NAME *a);
95 static int x509_name_canon(X509_NAME *a);
97 static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * intname,
98  unsigned char **in);
99 
102  ASN1_SIMPLE(X509_NAME_ENTRY, value, ASN1_PRINTABLE)
104 
107 
108 /*
109  * For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } so
110  * declare two template wrappers for this
111  */
112 
113 ASN1_ITEM_TEMPLATE(X509_NAME_ENTRIES) =
115 ASN1_ITEM_TEMPLATE_END(X509_NAME_ENTRIES)
116 
117 ASN1_ITEM_TEMPLATE(X509_NAME_INTERNAL) =
118  ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, Name, X509_NAME_ENTRIES)
119 ASN1_ITEM_TEMPLATE_END(X509_NAME_INTERNAL)
120 
121 /*
122  * Normally that's where it would end: we'd have two nested STACK structures
123  * representing the ASN1. Unfortunately X509_NAME uses a completely different
124  * form and caches encodings so we have to process the internal form and
125  * convert to the external form.
126  */
127 
128 static const ASN1_EXTERN_FUNCS x509_name_ff = {
129  NULL,
132  0, /* Default clear behaviour is OK */
135  NULL,
136 };
137 
139 
141 
143 
145 {
146  X509_NAME *ret = NULL;
147  ret = OPENSSL_malloc(sizeof(X509_NAME));
148  if (!ret)
149  goto memerr;
150  if ((ret->entries = sk_X509_NAME_ENTRY_new_null()) == NULL)
151  goto memerr;
152  if ((ret->bytes = BUF_MEM_new()) == NULL)
153  goto memerr;
154  ret->canon_enc = NULL;
155  ret->canon_enclen = 0;
156  ret->modified = 1;
157  *val = (ASN1_VALUE *)ret;
158  return 1;
159 
160  memerr:
162  if (ret) {
163  if (ret->entries)
164  sk_X509_NAME_ENTRY_free(ret->entries);
165  OPENSSL_free(ret);
166  }
167  return 0;
168 }
169 
170 static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
171 {
172  X509_NAME *a;
173  if (!pval || !*pval)
174  return;
175  a = (X509_NAME *)*pval;
176 
177  BUF_MEM_free(a->bytes);
178  sk_X509_NAME_ENTRY_pop_free(a->entries, X509_NAME_ENTRY_free);
179  if (a->canon_enc)
180  OPENSSL_free(a->canon_enc);
181  OPENSSL_free(a);
182  *pval = NULL;
183 }
184 
186 {
187  sk_X509_NAME_ENTRY_free(ne);
188 }
189 
191 {
192  sk_X509_NAME_ENTRY_pop_free(ne, X509_NAME_ENTRY_free);
193 }
194 
195 static int x509_name_ex_d2i(ASN1_VALUE **val,
196  const unsigned char **in, long len,
197  const ASN1_ITEM *it, int tag, int aclass,
198  char opt, ASN1_TLC *ctx)
199 {
200  const unsigned char *p = *in, *q;
201  STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname = NULL;
202  X509_NAME *nm = NULL;
203  size_t i, j;
204  int ret;
205  STACK_OF(X509_NAME_ENTRY) *entries;
206  X509_NAME_ENTRY *entry;
207  /* Bound the size of an X509_NAME we are willing to parse. */
208  if (len > X509_NAME_MAX) {
209  len = X509_NAME_MAX;
210  }
211  q = p;
212 
213  /* Get internal representation of Name */
214  ASN1_VALUE *intname_val = NULL;
215  ret = ASN1_item_ex_d2i(&intname_val,
216  &p, len, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
217  tag, aclass, opt, ctx);
218  if (ret <= 0)
219  return ret;
220  intname = (STACK_OF(STACK_OF_X509_NAME_ENTRY) *)intname_val;
221 
222  if (*val)
223  x509_name_ex_free(val, NULL);
224  ASN1_VALUE *nm_val = NULL;
225  if (!x509_name_ex_new(&nm_val, NULL))
226  goto err;
227  nm = (X509_NAME *)nm_val;
228  /* We've decoded it: now cache encoding */
229  if (!BUF_MEM_grow(nm->bytes, p - q))
230  goto err;
231  OPENSSL_memcpy(nm->bytes->data, q, p - q);
232 
233  /* Convert internal representation to X509_NAME structure */
234  for (i = 0; i < sk_STACK_OF_X509_NAME_ENTRY_num(intname); i++) {
235  entries = sk_STACK_OF_X509_NAME_ENTRY_value(intname, i);
236  for (j = 0; j < sk_X509_NAME_ENTRY_num(entries); j++) {
237  entry = sk_X509_NAME_ENTRY_value(entries, j);
238  entry->set = i;
239  if (!sk_X509_NAME_ENTRY_push(nm->entries, entry))
240  goto err;
241  (void)sk_X509_NAME_ENTRY_set(entries, j, NULL);
242  }
243  }
245  if (!ret)
246  goto err;
247  sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
249  nm->modified = 0;
250  *val = (ASN1_VALUE *)nm;
251  *in = p;
252  return ret;
253  err:
255  sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
258  return 0;
259 }
260 
261 static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out,
262  const ASN1_ITEM *it, int tag, int aclass)
263 {
264  X509_NAME *a = (X509_NAME *)*val;
265  if (a->modified &&
266  (!x509_name_encode(a) ||
267  !x509_name_canon(a))) {
268  return -1;
269  }
270  int ret = a->bytes->length;
271  if (out != NULL) {
272  OPENSSL_memcpy(*out, a->bytes->data, ret);
273  *out += ret;
274  }
275  return ret;
276 }
277 
279 {
280  int len;
281  unsigned char *p;
282  STACK_OF(X509_NAME_ENTRY) *entries = NULL;
283  X509_NAME_ENTRY *entry;
284  int set = -1;
285  size_t i;
286  STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname =
287  sk_STACK_OF_X509_NAME_ENTRY_new_null();
288  if (!intname)
289  goto memerr;
290  for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
291  entry = sk_X509_NAME_ENTRY_value(a->entries, i);
292  if (entry->set != set) {
293  entries = sk_X509_NAME_ENTRY_new_null();
294  if (!entries)
295  goto memerr;
296  if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
297  sk_X509_NAME_ENTRY_free(entries);
298  goto memerr;
299  }
300  set = entry->set;
301  }
302  if (!sk_X509_NAME_ENTRY_push(entries, entry))
303  goto memerr;
304  }
305  ASN1_VALUE *intname_val = (ASN1_VALUE *)intname;
306  len =
307  ASN1_item_ex_i2d(&intname_val, NULL, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
308  /*tag=*/-1, /*aclass=*/0);
309  if (len <= 0) {
310  goto err;
311  }
312  if (!BUF_MEM_grow(a->bytes, len))
313  goto memerr;
314  p = (unsigned char *)a->bytes->data;
315  if (ASN1_item_ex_i2d(&intname_val, &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL),
316  /*tag=*/-1, /*aclass=*/0) <= 0) {
317  goto err;
318  }
319  sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
321  a->modified = 0;
322  return 1;
323  memerr:
325 err:
326  sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
328  return 0;
329 }
330 
331 /*
332  * This function generates the canonical encoding of the Name structure. In
333  * it all strings are converted to UTF8, leading, trailing and multiple
334  * spaces collapsed, converted to lower case and the leading SEQUENCE header
335  * removed. In future we could also normalize the UTF8 too. By doing this
336  * comparison of Name structures can be rapidly perfomed by just using
337  * OPENSSL_memcmp() of the canonical encoding. By omitting the leading SEQUENCE name
338  * constraints of type dirName can also be checked with a simple OPENSSL_memcmp().
339  */
340 
342 {
343  unsigned char *p;
344  STACK_OF(STACK_OF_X509_NAME_ENTRY) *intname = NULL;
345  STACK_OF(X509_NAME_ENTRY) *entries = NULL;
346  X509_NAME_ENTRY *entry, *tmpentry = NULL;
347  int set = -1, ret = 0, len;
348  size_t i;
349 
350  if (a->canon_enc) {
351  OPENSSL_free(a->canon_enc);
352  a->canon_enc = NULL;
353  }
354  /* Special case: empty X509_NAME => null encoding */
355  if (sk_X509_NAME_ENTRY_num(a->entries) == 0) {
356  a->canon_enclen = 0;
357  return 1;
358  }
359  intname = sk_STACK_OF_X509_NAME_ENTRY_new_null();
360  if (!intname)
361  goto err;
362  for (i = 0; i < sk_X509_NAME_ENTRY_num(a->entries); i++) {
363  entry = sk_X509_NAME_ENTRY_value(a->entries, i);
364  if (entry->set != set) {
365  entries = sk_X509_NAME_ENTRY_new_null();
366  if (!entries)
367  goto err;
368  if (!sk_STACK_OF_X509_NAME_ENTRY_push(intname, entries)) {
369  sk_X509_NAME_ENTRY_free(entries);
370  goto err;
371  }
372  set = entry->set;
373  }
374  tmpentry = X509_NAME_ENTRY_new();
375  if (tmpentry == NULL)
376  goto err;
377  tmpentry->object = OBJ_dup(entry->object);
378  if (!asn1_string_canon(tmpentry->value, entry->value))
379  goto err;
380  if (!sk_X509_NAME_ENTRY_push(entries, tmpentry))
381  goto err;
382  tmpentry = NULL;
383  }
384 
385  /* Finally generate encoding */
386 
387  len = i2d_name_canon(intname, NULL);
388  if (len < 0) {
389  goto err;
390  }
391  a->canon_enclen = len;
392 
393  p = OPENSSL_malloc(a->canon_enclen);
394 
395  if (!p)
396  goto err;
397 
398  a->canon_enc = p;
399 
400  i2d_name_canon(intname, &p);
401 
402  ret = 1;
403 
404  err:
405 
406  if (tmpentry)
407  X509_NAME_ENTRY_free(tmpentry);
408  if (intname)
409  sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname,
411  return ret;
412 }
413 
414 /* Bitmap of all the types of string that will be canonicalized. */
415 
416 #define ASN1_MASK_CANON \
417  (B_ASN1_UTF8STRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING \
418  | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING \
419  | B_ASN1_VISIBLESTRING)
420 
422 {
423  unsigned char *to, *from;
424  int len, i;
425 
426  /* If type not in bitmask just copy string across */
427  if (!(ASN1_tag2bit(in->type) & ASN1_MASK_CANON)) {
428  if (!ASN1_STRING_copy(out, in))
429  return 0;
430  return 1;
431  }
432 
433  out->type = V_ASN1_UTF8STRING;
434  out->length = ASN1_STRING_to_UTF8(&out->data, in);
435  if (out->length == -1)
436  return 0;
437 
438  to = out->data;
439  from = to;
440 
441  len = out->length;
442 
443  /*
444  * Convert string in place to canonical form. Ultimately we may need to
445  * handle a wider range of characters but for now ignore anything with
446  * MSB set and rely on the isspace() and tolower() functions.
447  */
448 
449  /* Ignore leading spaces */
450  while ((len > 0) && !(*from & 0x80) && isspace(*from)) {
451  from++;
452  len--;
453  }
454 
455  to = from + len;
456 
457  /* Ignore trailing spaces */
458  while ((len > 0) && !(to[-1] & 0x80) && isspace(to[-1])) {
459  to--;
460  len--;
461  }
462 
463  to = out->data;
464 
465  i = 0;
466  while (i < len) {
467  /* If MSB set just copy across */
468  if (*from & 0x80) {
469  *to++ = *from++;
470  i++;
471  }
472  /* Collapse multiple spaces */
473  else if (isspace(*from)) {
474  /* Copy one space across */
475  *to++ = ' ';
476  /*
477  * Ignore subsequent spaces. Note: don't need to check len here
478  * because we know the last character is a non-space so we can't
479  * overflow.
480  */
481  do {
482  from++;
483  i++;
484  }
485  while (!(*from & 0x80) && isspace(*from));
486  } else {
487  *to++ = OPENSSL_tolower(*from);
488  from++;
489  i++;
490  }
491  }
492 
493  out->length = to - out->data;
494 
495  return 1;
496 
497 }
498 
499 static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) * _intname,
500  unsigned char **in)
501 {
502  int len, ltmp;
503  size_t i;
504  ASN1_VALUE *v;
505  STACK_OF(ASN1_VALUE) *intname = (STACK_OF(ASN1_VALUE) *)_intname;
506 
507  len = 0;
508  for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) {
509  v = sk_ASN1_VALUE_value(intname, i);
510  ltmp = ASN1_item_ex_i2d(&v, in, ASN1_ITEM_rptr(X509_NAME_ENTRIES),
511  /*tag=*/-1, /*aclass=*/0);
512  if (ltmp < 0)
513  return ltmp;
514  len += ltmp;
515  }
516  return len;
517 }
518 
520 {
521  if ((name = X509_NAME_dup(name)) == NULL)
522  return 0;
523  X509_NAME_free(*xn);
524  *xn = name;
525  return 1;
526 }
527 
529 {
530  return ne->set;
531 }
532 
533 int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder,
534  size_t *pderlen)
535 {
536  /* Make sure encoding is valid */
537  if (i2d_X509_NAME(nm, NULL) <= 0)
538  return 0;
539  if (pder != NULL)
540  *pder = (unsigned char *)nm->bytes->data;
541  if (pderlen != NULL)
542  *pderlen = nm->bytes->length;
543  return 1;
544 }
gen_build_yaml.out
dictionary out
Definition: src/benchmark/gen_build_yaml.py:24
X509_name_entry_st::value
ASN1_STRING * value
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:90
regen-readme.it
it
Definition: regen-readme.py:15
ASN1_TLC_st
Definition: asn1t.h:520
ctx
Definition: benchmark-async.c:30
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
X509_NAME_ENTRY_free
#define X509_NAME_ENTRY_free
Definition: boringssl_prefix_symbols.h:2363
OPENSSL_PUT_ERROR
#define OPENSSL_PUT_ERROR(library, reason)
Definition: err.h:423
string.h
V_ASN1_SEQUENCE
#define V_ASN1_SEQUENCE
Definition: asn1.h:136
STACK_OF
typedef STACK_OF(X509_NAME_ENTRY)
Definition: x_name.c:74
ASN1_EXTERN_FUNCS_st
Definition: asn1t.h:547
ASN1_item_ex_i2d
#define ASN1_item_ex_i2d
Definition: boringssl_prefix_symbols.h:744
error_ref_leak.err
err
Definition: error_ref_leak.py:35
V_ASN1_UTF8STRING
#define V_ASN1_UTF8STRING
Definition: asn1.h:135
setup.name
name
Definition: setup.py:542
a
int a
Definition: abseil-cpp/absl/container/internal/hash_policy_traits_test.cc:88
to
size_t to
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1385
xds_manager.p
p
Definition: xds_manager.py:60
IMPLEMENT_ASN1_FUNCTIONS
#define IMPLEMENT_ASN1_FUNCTIONS(stname)
Definition: asn1t.h:636
X509_NAME_free
#define X509_NAME_free
Definition: boringssl_prefix_symbols.h:2381
OBJ_dup
#define OBJ_dup
Definition: boringssl_prefix_symbols.h:1847
asn1_object_st
Definition: third_party/boringssl-with-bazel/src/crypto/asn1/internal.h:102
ASN1_TFLG_SEQUENCE_OF
#define ASN1_TFLG_SEQUENCE_OF
Definition: asn1t.h:393
local_sk_X509_NAME_ENTRY_pop_free
static void local_sk_X509_NAME_ENTRY_pop_free(STACK_OF(X509_NAME_ENTRY) *ne)
Definition: x_name.c:190
OPENSSL_malloc
#define OPENSSL_malloc
Definition: boringssl_prefix_symbols.h:1885
from
size_t from
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1384
OPENSSL_tolower
#define OPENSSL_tolower
Definition: boringssl_prefix_symbols.h:1898
in
const char * in
Definition: third_party/abseil-cpp/absl/strings/internal/str_format/parser_test.cc:391
BUF_MEM_grow
#define BUF_MEM_grow
Definition: boringssl_prefix_symbols.h:1009
x509_name_ex_i2d
static int x509_name_ex_i2d(ASN1_VALUE **val, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass)
Definition: x_name.c:261
ASN1_ITEM_TEMPLATE
ASN1_ITEM_TEMPLATE(CERTIFICATEPOLICIES)
ASN1_ITEM_st
Definition: asn1t.h:459
internal.h
tag
static void * tag(intptr_t t)
Definition: bad_client.cc:318
buf.h
setup.v
v
Definition: third_party/bloaty/third_party/capstone/bindings/python/setup.py:42
ASN1_MASK_CANON
#define ASN1_MASK_CANON
Definition: x_name.c:416
buf_mem_st::length
size_t length
Definition: buf.h:72
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
X509_NAME_set
int X509_NAME_set(X509_NAME **xn, X509_NAME *name)
Definition: x_name.c:519
err.h
local_sk_X509_NAME_ENTRY_free
static void local_sk_X509_NAME_ENTRY_free(STACK_OF(X509_NAME_ENTRY) *ne)
Definition: x_name.c:185
X509_NAME_ENTRY_new
#define X509_NAME_ENTRY_new
Definition: boringssl_prefix_symbols.h:2367
IMPLEMENT_EXTERN_ASN1
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs)
Definition: asn1t.h:623
BUF_MEM_free
#define BUF_MEM_free
Definition: boringssl_prefix_symbols.h:1008
ASN1_SEQUENCE
#define ASN1_SEQUENCE(tname)
Definition: asn1t.h:130
asn1t.h
IMPLEMENT_ASN1_DUP_FUNCTION
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname)
Definition: asn1t.h:696
x509_name_ex_free
static void x509_name_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)
Definition: x_name.c:170
DEFINE_STACK_OF
#define DEFINE_STACK_OF(type)
Definition: stack.h:409
ASN1_tag2bit
#define ASN1_tag2bit
Definition: boringssl_prefix_symbols.h:762
X509_name_entry_st
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:88
i2d_X509_NAME
#define i2d_X509_NAME
Definition: boringssl_prefix_symbols.h:3288
ASN1_EX_TEMPLATE_TYPE
#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type)
Definition: asn1t.h:235
ERR_R_ASN1_LIB
#define ERR_R_ASN1_LIB
Definition: err.h:340
X509_name_entry_st::object
ASN1_OBJECT * object
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:89
value
const char * value
Definition: hpack_parser_table.cc:165
ASN1_SEQUENCE_END
ASN1_SEQUENCE_END(X509_NAME_ENTRY)
Definition: x_name.c:103
ASN1_STRING_to_UTF8
#define ASN1_STRING_to_UTF8
Definition: boringssl_prefix_symbols.h:693
x509_st
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:139
buf_mem_st::data
char * data
Definition: buf.h:73
ASN1_ITEM_rptr
#define ASN1_ITEM_rptr(name)
Definition: asn1.h:302
X509_NAME_ENTRY_set
int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne)
Definition: x_name.c:528
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
ASN1_STRING_copy
#define ASN1_STRING_copy
Definition: boringssl_prefix_symbols.h:677
X509_name_st::bytes
BUF_MEM * bytes
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:98
i2d_name_canon
static int i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) *_intname, unsigned char **in)
Definition: x_name.c:499
ASN1_item_ex_d2i
#define ASN1_item_ex_d2i
Definition: boringssl_prefix_symbols.h:742
cpp.gmock_class.set
set
Definition: bloaty/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py:44
ASN1_VALUE
struct ASN1_VALUE_st ASN1_VALUE
Definition: asn1.h:320
X509_NAME_MAX
#define X509_NAME_MAX
X509_NAME_dup
OPENSSL_EXPORT X509_NAME * X509_NAME_dup(X509_NAME *xn)
obj.h
BUF_MEM_new
#define BUF_MEM_new
Definition: boringssl_prefix_symbols.h:1011
x509_name_encode
static int x509_name_encode(X509_NAME *a)
Definition: x_name.c:278
X509_name_entry_st::set
int set
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:91
mem.h
len
int len
Definition: abseil-cpp/absl/base/internal/low_level_alloc_test.cc:46
asn1_string_canon
static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in)
Definition: x_name.c:421
ASN1_TFLG_SET_OF
#define ASN1_TFLG_SET_OF
Definition: asn1t.h:390
OPENSSL_free
#define OPENSSL_free
Definition: boringssl_prefix_symbols.h:1869
x509_name_ex_d2i
static int x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it, int tag, int aclass, char opt, ASN1_TLC *ctx)
Definition: x_name.c:195
X509_name_st
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:95
if
if(p->owned &&p->wrapped !=NULL)
Definition: call.c:42
ASN1_ITEM_TEMPLATE_END
#define ASN1_ITEM_TEMPLATE_END(tname)
Definition: asn1t.h:95
X509_name_st::modified
int modified
Definition: third_party/boringssl-with-bazel/src/crypto/x509/internal.h:97
asn1_string_st
Definition: asn1.h:543
x509_name_canon
static int x509_name_canon(X509_NAME *a)
Definition: x_name.c:341
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
asn1.h
ERR_R_MALLOC_FAILURE
#define ERR_R_MALLOC_FAILURE
Definition: err.h:371
x509_name_ex_new
static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it)
Definition: x_name.c:144
X509_NAME_get0_der
int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen)
Definition: x_name.c:533
stack.h
x509.h
ASN1_SIMPLE
#define ASN1_SIMPLE(stname, field, type)
Definition: asn1t.h:265


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:56