1 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
2  * project 1999. */
3 /* ====================================================================
4  * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in
15  *    the documentation and/or other materials provided with the
16  *    distribution.
17  *
18  * 3. All advertising materials mentioning features or use of this
19  *    software must display the following acknowledgment:
20  *    "This product includes software developed by the OpenSSL Project
21  *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
22  *
23  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
24  *    endorse or promote products derived from this software without
25  *    prior written permission. For written permission, please contact
26  *    licensing@OpenSSL.org.
27  *
28  * 5. Products derived from this software may not be called "OpenSSL"
29  *    nor may "OpenSSL" appear in their names without prior written
30  *    permission of the OpenSSL Project.
31  *
32  * 6. Redistributions of any form whatsoever must retain the following
33  *    acknowledgment:
34  *    "This product includes software developed by the OpenSSL Project
35  *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
36  *
37  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
38  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
39  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
41  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
43  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
44  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
45  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
46  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
47  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
48  * OF THE POSSIBILITY OF SUCH DAMAGE.
49  * ====================================================================
50  *
51  * This product includes cryptographic software written by Eric Young
52  * (eay@cryptsoft.com).  This product includes software written by Tim
53  * Hudson (tjh@cryptsoft.com). */
54 
55 #ifndef HEADER_X509V3_H
56 #define HEADER_X509V3_H
57 
58 #include <openssl/bio.h>
59 #include <openssl/conf.h>
60 #include <openssl/lhash.h>
61 #include <openssl/x509.h>
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 
68 // Legacy X.509 library.
69 //
70 // This header is part of OpenSSL's X.509 implementation. It is retained for
71 // compatibility but otherwise underdocumented and not actively maintained. In
72 // the future, a replacement library will be available. Meanwhile, minimize
73 // dependencies on this header where possible.
74 
75 
76 // Forward reference
77 struct v3_ext_method;
78 struct v3_ext_ctx;
79 
80 // Useful typedefs
81 
82 typedef void *(*X509V3_EXT_NEW)(void);
83 typedef void (*X509V3_EXT_FREE)(void *);
84 typedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);
85 typedef int (*X509V3_EXT_I2D)(void *, unsigned char **);
86 typedef STACK_OF(CONF_VALUE) *(*X509V3_EXT_I2V)(
87     const struct v3_ext_method *method, void *ext,
88     STACK_OF(CONF_VALUE) *extlist);
89 typedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method,
90                                 struct v3_ext_ctx *ctx,
91                                 STACK_OF(CONF_VALUE) *values);
92 typedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext);
93 typedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method,
94                                 struct v3_ext_ctx *ctx, const char *str);
95 typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext,
96                               BIO *out, int indent);
97 typedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method,
98                                 struct v3_ext_ctx *ctx, const char *str);
99 
100 // V3 extension structure
101 
102 struct v3_ext_method {
103   int ext_nid;
104   int ext_flags;
105   // If this is set the following four fields are ignored
106   ASN1_ITEM_EXP *it;
107   // Old style ASN1 calls
108   X509V3_EXT_NEW ext_new;
109   X509V3_EXT_FREE ext_free;
110   X509V3_EXT_D2I d2i;
111   X509V3_EXT_I2D i2d;
112 
113   // The following pair is used for string extensions
114   X509V3_EXT_I2S i2s;
115   X509V3_EXT_S2I s2i;
116 
117   // The following pair is used for multi-valued extensions
118   X509V3_EXT_I2V i2v;
119   X509V3_EXT_V2I v2i;
120 
121   // The following are used for raw extensions
122   X509V3_EXT_I2R i2r;
123   X509V3_EXT_R2I r2i;
124 
125   void *usr_data;  // Any extension specific data
126 };
127 
128 typedef struct X509V3_CONF_METHOD_st {
129   char *(*get_string)(void *db, const char *section, const char *value);
130   STACK_OF(CONF_VALUE) *(*get_section)(void *db, const char *section);
131   void (*free_string)(void *db, char *string);
132   void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section);
133 } X509V3_CONF_METHOD;
134 
135 // Context specific info
136 struct v3_ext_ctx {
137 #define CTX_TEST 0x1
138   int flags;
139   X509 *issuer_cert;
140   X509 *subject_cert;
141   X509_REQ *subject_req;
142   X509_CRL *crl;
143   const X509V3_CONF_METHOD *db_meth;
144   void *db;
145   // Maybe more here
146 };
147 
148 typedef struct v3_ext_method X509V3_EXT_METHOD;
149 
150 DEFINE_STACK_OF(X509V3_EXT_METHOD)
151 
152 // ext_flags values
153 #define X509V3_EXT_DYNAMIC 0x1
154 #define X509V3_EXT_CTX_DEP 0x2
155 #define X509V3_EXT_MULTILINE 0x4
156 
157 typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
158 
159 struct BASIC_CONSTRAINTS_st {
160   int ca;
161   ASN1_INTEGER *pathlen;
162 };
163 
164 
165 typedef struct otherName_st {
166   ASN1_OBJECT *type_id;
167   ASN1_TYPE *value;
168 } OTHERNAME;
169 
170 typedef struct EDIPartyName_st {
171   ASN1_STRING *nameAssigner;
172   ASN1_STRING *partyName;
173 } EDIPARTYNAME;
174 
175 typedef struct GENERAL_NAME_st {
176 #define GEN_OTHERNAME 0
177 #define GEN_EMAIL 1
178 #define GEN_DNS 2
179 #define GEN_X400 3
180 #define GEN_DIRNAME 4
181 #define GEN_EDIPARTY 5
182 #define GEN_URI 6
183 #define GEN_IPADD 7
184 #define GEN_RID 8
185 
186   int type;
187   union {
188     char *ptr;
189     OTHERNAME *otherName;  // otherName
190     ASN1_IA5STRING *rfc822Name;
191     ASN1_IA5STRING *dNSName;
192     ASN1_TYPE *x400Address;
193     X509_NAME *directoryName;
194     EDIPARTYNAME *ediPartyName;
195     ASN1_IA5STRING *uniformResourceIdentifier;
196     ASN1_OCTET_STRING *iPAddress;
197     ASN1_OBJECT *registeredID;
198 
199     // Old names
200     ASN1_OCTET_STRING *ip;  // iPAddress
201     X509_NAME *dirn;        // dirn
202     ASN1_IA5STRING *ia5;    // rfc822Name, dNSName, uniformResourceIdentifier
203     ASN1_OBJECT *rid;       // registeredID
204     ASN1_TYPE *other;       // x400Address
205   } d;
206 } GENERAL_NAME;
207 
208 DEFINE_STACK_OF(GENERAL_NAME)
209 DECLARE_ASN1_SET_OF(GENERAL_NAME)
210 
211 typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
212 
213 DEFINE_STACK_OF(GENERAL_NAMES)
214 
215 typedef struct ACCESS_DESCRIPTION_st {
216   ASN1_OBJECT *method;
217   GENERAL_NAME *location;
218 } ACCESS_DESCRIPTION;
219 
220 DEFINE_STACK_OF(ACCESS_DESCRIPTION)
221 DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)
222 
223 typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
224 
225 typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
226 
227 typedef struct DIST_POINT_NAME_st {
228   int type;
229   union {
230     GENERAL_NAMES *fullname;
231     STACK_OF(X509_NAME_ENTRY) *relativename;
232   } name;
233   // If relativename then this contains the full distribution point name
234   X509_NAME *dpname;
235 } DIST_POINT_NAME;
236 // All existing reasons
237 #define CRLDP_ALL_REASONS 0x807f
238 
239 #define CRL_REASON_NONE (-1)
240 #define CRL_REASON_UNSPECIFIED 0
241 #define CRL_REASON_KEY_COMPROMISE 1
242 #define CRL_REASON_CA_COMPROMISE 2
243 #define CRL_REASON_AFFILIATION_CHANGED 3
244 #define CRL_REASON_SUPERSEDED 4
245 #define CRL_REASON_CESSATION_OF_OPERATION 5
246 #define CRL_REASON_CERTIFICATE_HOLD 6
247 #define CRL_REASON_REMOVE_FROM_CRL 8
248 #define CRL_REASON_PRIVILEGE_WITHDRAWN 9
249 #define CRL_REASON_AA_COMPROMISE 10
250 
251 struct DIST_POINT_st {
252   DIST_POINT_NAME *distpoint;
253   ASN1_BIT_STRING *reasons;
254   GENERAL_NAMES *CRLissuer;
255   int dp_reasons;
256 };
257 
258 typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
259 
260 DEFINE_STACK_OF(DIST_POINT)
261 DECLARE_ASN1_SET_OF(DIST_POINT)
262 
263 struct AUTHORITY_KEYID_st {
264   ASN1_OCTET_STRING *keyid;
265   GENERAL_NAMES *issuer;
266   ASN1_INTEGER *serial;
267 };
268 
269 typedef struct NOTICEREF_st {
270   ASN1_STRING *organization;
271   STACK_OF(ASN1_INTEGER) *noticenos;
272 } NOTICEREF;
273 
274 typedef struct USERNOTICE_st {
275   NOTICEREF *noticeref;
276   ASN1_STRING *exptext;
277 } USERNOTICE;
278 
279 typedef struct POLICYQUALINFO_st {
280   ASN1_OBJECT *pqualid;
281   union {
282     ASN1_IA5STRING *cpsuri;
283     USERNOTICE *usernotice;
284     ASN1_TYPE *other;
285   } d;
286 } POLICYQUALINFO;
287 
288 DEFINE_STACK_OF(POLICYQUALINFO)
289 DECLARE_ASN1_SET_OF(POLICYQUALINFO)
290 
291 typedef struct POLICYINFO_st {
292   ASN1_OBJECT *policyid;
293   STACK_OF(POLICYQUALINFO) *qualifiers;
294 } POLICYINFO;
295 
296 typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
297 
298 DEFINE_STACK_OF(POLICYINFO)
299 DECLARE_ASN1_SET_OF(POLICYINFO)
300 
301 typedef struct POLICY_MAPPING_st {
302   ASN1_OBJECT *issuerDomainPolicy;
303   ASN1_OBJECT *subjectDomainPolicy;
304 } POLICY_MAPPING;
305 
306 DEFINE_STACK_OF(POLICY_MAPPING)
307 
308 typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
309 
310 typedef struct GENERAL_SUBTREE_st {
311   GENERAL_NAME *base;
312   ASN1_INTEGER *minimum;
313   ASN1_INTEGER *maximum;
314 } GENERAL_SUBTREE;
315 
316 DEFINE_STACK_OF(GENERAL_SUBTREE)
317 
318 struct NAME_CONSTRAINTS_st {
319   STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
320   STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
321 };
322 
323 typedef struct POLICY_CONSTRAINTS_st {
324   ASN1_INTEGER *requireExplicitPolicy;
325   ASN1_INTEGER *inhibitPolicyMapping;
326 } POLICY_CONSTRAINTS;
327 
328 // Proxy certificate structures, see RFC 3820
329 typedef struct PROXY_POLICY_st {
330   ASN1_OBJECT *policyLanguage;
331   ASN1_OCTET_STRING *policy;
332 } PROXY_POLICY;
333 
334 typedef struct PROXY_CERT_INFO_EXTENSION_st {
335   ASN1_INTEGER *pcPathLengthConstraint;
336   PROXY_POLICY *proxyPolicy;
337 } PROXY_CERT_INFO_EXTENSION;
338 
339 DECLARE_ASN1_FUNCTIONS(PROXY_POLICY)
340 DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
341 
342 struct ISSUING_DIST_POINT_st {
343   DIST_POINT_NAME *distpoint;
344   int onlyuser;
345   int onlyCA;
346   ASN1_BIT_STRING *onlysomereasons;
347   int indirectCRL;
348   int onlyattr;
349 };
350 
351 // Values in idp_flags field
352 // IDP present
353 #define IDP_PRESENT 0x1
354 // IDP values inconsistent
355 #define IDP_INVALID 0x2
356 // onlyuser true
357 #define IDP_ONLYUSER 0x4
358 // onlyCA true
359 #define IDP_ONLYCA 0x8
360 // onlyattr true
361 #define IDP_ONLYATTR 0x10
362 // indirectCRL true
363 #define IDP_INDIRECT 0x20
364 // onlysomereasons present
365 #define IDP_REASONS 0x40
366 
367 #define X509V3_conf_err(val)                                               \
368   ERR_add_error_data(6, "section:", (val)->section, ",name:", (val)->name, \
369                      ",value:", (val)->value);
370 
371 #define X509V3_set_ctx_test(ctx) \
372   X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
373 #define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
374 
375 #define EXT_BITSTRING(nid, table)                                        \
376   {                                                                      \
377     nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), 0, 0, 0, 0, 0, 0,            \
378         (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING,                             \
379         (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, NULL, NULL, (void *)(table) \
380   }
381 
382 #define EXT_IA5STRING(nid)                                   \
383   {                                                          \
384     nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), 0, 0, 0, 0,       \
385         (X509V3_EXT_I2S)i2s_ASN1_IA5STRING,                  \
386         (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, 0, 0, 0, 0, NULL \
387   }
388 
389 #define EXT_END \
390   { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
391 
392 
393 // X509_PURPOSE stuff
394 
395 #define EXFLAG_BCONS 0x1
396 #define EXFLAG_KUSAGE 0x2
397 #define EXFLAG_XKUSAGE 0x4
398 #define EXFLAG_NSCERT 0x8
399 
400 #define EXFLAG_CA 0x10
401 // Really self issued not necessarily self signed
402 #define EXFLAG_SI 0x20
403 #define EXFLAG_V1 0x40
404 #define EXFLAG_INVALID 0x80
405 #define EXFLAG_SET 0x100
406 #define EXFLAG_CRITICAL 0x200
407 #define EXFLAG_PROXY 0x400
408 
409 #define EXFLAG_INVALID_POLICY 0x800
410 #define EXFLAG_FRESHEST 0x1000
411 // Self signed
412 #define EXFLAG_SS 0x2000
413 
414 #define KU_DIGITAL_SIGNATURE 0x0080
415 #define KU_NON_REPUDIATION 0x0040
416 #define KU_KEY_ENCIPHERMENT 0x0020
417 #define KU_DATA_ENCIPHERMENT 0x0010
418 #define KU_KEY_AGREEMENT 0x0008
419 #define KU_KEY_CERT_SIGN 0x0004
420 #define KU_CRL_SIGN 0x0002
421 #define KU_ENCIPHER_ONLY 0x0001
422 #define KU_DECIPHER_ONLY 0x8000
423 
424 #define NS_SSL_CLIENT 0x80
425 #define NS_SSL_SERVER 0x40
426 #define NS_SMIME 0x20
427 #define NS_OBJSIGN 0x10
428 #define NS_SSL_CA 0x04
429 #define NS_SMIME_CA 0x02
430 #define NS_OBJSIGN_CA 0x01
431 #define NS_ANY_CA (NS_SSL_CA | NS_SMIME_CA | NS_OBJSIGN_CA)
432 
433 #define XKU_SSL_SERVER 0x1
434 #define XKU_SSL_CLIENT 0x2
435 #define XKU_SMIME 0x4
436 #define XKU_CODE_SIGN 0x8
437 #define XKU_SGC 0x10
438 #define XKU_OCSP_SIGN 0x20
439 #define XKU_TIMESTAMP 0x40
440 #define XKU_DVCS 0x80
441 #define XKU_ANYEKU 0x100
442 
443 #define X509_PURPOSE_DYNAMIC 0x1
444 #define X509_PURPOSE_DYNAMIC_NAME 0x2
445 
446 typedef struct x509_purpose_st {
447   int purpose;
448   int trust;  // Default trust ID
449   int flags;
450   int (*check_purpose)(const struct x509_purpose_st *, const X509 *, int);
451   char *name;
452   char *sname;
453   void *usr_data;
454 } X509_PURPOSE;
455 
456 #define X509_PURPOSE_SSL_CLIENT 1
457 #define X509_PURPOSE_SSL_SERVER 2
458 #define X509_PURPOSE_NS_SSL_SERVER 3
459 #define X509_PURPOSE_SMIME_SIGN 4
460 #define X509_PURPOSE_SMIME_ENCRYPT 5
461 #define X509_PURPOSE_CRL_SIGN 6
462 #define X509_PURPOSE_ANY 7
463 #define X509_PURPOSE_OCSP_HELPER 8
464 #define X509_PURPOSE_TIMESTAMP_SIGN 9
465 
466 #define X509_PURPOSE_MIN 1
467 #define X509_PURPOSE_MAX 9
468 
469 DEFINE_STACK_OF(X509_PURPOSE)
470 
471 DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
472 
473 DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
474 
475 DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
476 OPENSSL_EXPORT GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
477 
478 // GENERAL_NAME_cmp returns zero if |a| and |b| are equal and a non-zero
479 // value otherwise. Note this function does not provide a comparison suitable
480 // for sorting.
481 OPENSSL_EXPORT int GENERAL_NAME_cmp(const GENERAL_NAME *a,
482                                     const GENERAL_NAME *b);
483 
484 
485 
486 OPENSSL_EXPORT ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
487                                                     X509V3_CTX *ctx,
488                                                     STACK_OF(CONF_VALUE) *nval);
489 OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(
490     X509V3_EXT_METHOD *method, ASN1_BIT_STRING *bits,
491     STACK_OF(CONF_VALUE) *extlist);
492 
493 OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(
494     X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
495 OPENSSL_EXPORT int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
496 
497 DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)
498 
499 OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(
500     X509V3_EXT_METHOD *method, GENERAL_NAMES *gen,
501     STACK_OF(CONF_VALUE) *extlist);
502 OPENSSL_EXPORT GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
503                                                 X509V3_CTX *ctx,
504                                                 STACK_OF(CONF_VALUE) *nval);
505 
506 DECLARE_ASN1_FUNCTIONS(OTHERNAME)
507 DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
508 OPENSSL_EXPORT int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
509 OPENSSL_EXPORT void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type,
510                                             void *value);
511 OPENSSL_EXPORT void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype);
512 OPENSSL_EXPORT int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
513                                                ASN1_OBJECT *oid,
514                                                ASN1_TYPE *value);
515 OPENSSL_EXPORT int GENERAL_NAME_get0_otherName(const GENERAL_NAME *gen,
516                                                ASN1_OBJECT **poid,
517                                                ASN1_TYPE **pvalue);
518 
519 OPENSSL_EXPORT char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
520                                            const ASN1_OCTET_STRING *ia5);
521 OPENSSL_EXPORT ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(
522     X509V3_EXT_METHOD *method, X509V3_CTX *ctx, const char *str);
523 
524 DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
525 OPENSSL_EXPORT int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION *a);
526 
527 DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
528 DECLARE_ASN1_FUNCTIONS(POLICYINFO)
529 DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)
530 DECLARE_ASN1_FUNCTIONS(USERNOTICE)
531 DECLARE_ASN1_FUNCTIONS(NOTICEREF)
532 
533 DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)
534 DECLARE_ASN1_FUNCTIONS(DIST_POINT)
535 DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)
536 DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)
537 
538 OPENSSL_EXPORT int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn,
539                                          X509_NAME *iname);
540 
541 OPENSSL_EXPORT int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
542 
543 DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)
544 DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)
545 
546 DECLARE_ASN1_ITEM(POLICY_MAPPING)
547 DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
548 DECLARE_ASN1_ITEM(POLICY_MAPPINGS)
549 
550 DECLARE_ASN1_ITEM(GENERAL_SUBTREE)
551 DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
552 
553 DECLARE_ASN1_ITEM(NAME_CONSTRAINTS)
554 DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
555 
556 DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
557 DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)
558 
559 OPENSSL_EXPORT GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
560                                               const X509V3_EXT_METHOD *method,
561                                               X509V3_CTX *ctx, int gen_type,
562                                               const char *value, int is_nc);
563 
564 OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,
565                                               X509V3_CTX *ctx, CONF_VALUE *cnf);
566 OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME_ex(
567     GENERAL_NAME *out, const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
568     CONF_VALUE *cnf, int is_nc);
569 OPENSSL_EXPORT void X509V3_conf_free(CONF_VALUE *val);
570 
571 // X509V3_EXT_conf_nid contains the only exposed instance of an LHASH in our
572 // public headers. The |conf| pointer must be NULL but cryptography.io wraps
573 // this function so we cannot, yet, replace the type with a dummy struct.
574 OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf,
575                                                    X509V3_CTX *ctx, int ext_nid,
576                                                    const char *value);
577 
578 OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx,
579                                                     int ext_nid,
580                                                     const char *value);
581 OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx,
582                                                 const char *name,
583                                                 const char *value);
584 OPENSSL_EXPORT int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx,
585                                            const char *section,
586                                            STACK_OF(X509_EXTENSION) **sk);
587 OPENSSL_EXPORT int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx,
588                                         const char *section, X509 *cert);
589 OPENSSL_EXPORT int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx,
590                                             const char *section, X509_REQ *req);
591 OPENSSL_EXPORT int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx,
592                                             const char *section, X509_CRL *crl);
593 
594 OPENSSL_EXPORT int X509V3_add_value_bool_nf(const char *name, int asn1_bool,
595                                             STACK_OF(CONF_VALUE) **extlist);
596 OPENSSL_EXPORT int X509V3_get_value_bool(const CONF_VALUE *value,
597                                          int *asn1_bool);
598 OPENSSL_EXPORT int X509V3_get_value_int(const CONF_VALUE *value,
599                                         ASN1_INTEGER **aint);
600 OPENSSL_EXPORT void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
601 
602 OPENSSL_EXPORT char *X509V3_get_string(X509V3_CTX *ctx, const char *name,
603                                        const char *section);
604 OPENSSL_EXPORT STACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx,
605                                                         const char *section);
606 OPENSSL_EXPORT void X509V3_string_free(X509V3_CTX *ctx, char *str);
607 OPENSSL_EXPORT void X509V3_section_free(X509V3_CTX *ctx,
608                                         STACK_OF(CONF_VALUE) *section);
609 OPENSSL_EXPORT void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
610                                    X509_REQ *req, X509_CRL *crl, int flags);
611 
612 OPENSSL_EXPORT int X509V3_add_value(const char *name, const char *value,
613                                     STACK_OF(CONF_VALUE) **extlist);
614 OPENSSL_EXPORT int X509V3_add_value_uchar(const char *name,
615                                           const unsigned char *value,
616                                           STACK_OF(CONF_VALUE) **extlist);
617 OPENSSL_EXPORT int X509V3_add_value_bool(const char *name, int asn1_bool,
618                                          STACK_OF(CONF_VALUE) **extlist);
619 OPENSSL_EXPORT int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,
620                                         STACK_OF(CONF_VALUE) **extlist);
621 OPENSSL_EXPORT char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth,
622                                       const ASN1_INTEGER *aint);
623 OPENSSL_EXPORT ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth,
624                                               const char *value);
625 OPENSSL_EXPORT char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth,
626                                          const ASN1_ENUMERATED *aint);
627 OPENSSL_EXPORT char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth,
628                                                const ASN1_ENUMERATED *aint);
629 OPENSSL_EXPORT int X509V3_EXT_add(X509V3_EXT_METHOD *ext);
630 OPENSSL_EXPORT int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);
631 OPENSSL_EXPORT int X509V3_EXT_add_alias(int nid_to, int nid_from);
632 OPENSSL_EXPORT void X509V3_EXT_cleanup(void);
633 
634 OPENSSL_EXPORT const X509V3_EXT_METHOD *X509V3_EXT_get(
635     const X509_EXTENSION *ext);
636 OPENSSL_EXPORT const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
637 OPENSSL_EXPORT int X509V3_add_standard_extensions(void);
638 OPENSSL_EXPORT STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
639 
640 // X509V3_EXT_d2i decodes |ext| and returns a pointer to a newly-allocated
641 // structure, with type dependent on the type of the extension. It returns NULL
642 // if |ext| is an unsupported extension or if there was a syntax error in the
643 // extension. The caller should cast the return value to the expected type and
644 // free the structure when done.
645 //
646 // WARNING: Casting the return value to the wrong type is a potentially
647 // exploitable memory error, so callers must not use this function before
648 // checking |ext| is of a known type.
649 OPENSSL_EXPORT void *X509V3_EXT_d2i(const X509_EXTENSION *ext);
650 
651 // X509V3_get_d2i finds and decodes the extension in |extensions| of type |nid|.
652 // If found, it decodes it and returns a newly-allocated structure, with type
653 // dependent on |nid|. If the extension is not found or on error, it returns
654 // NULL. The caller may distinguish these cases using the |out_critical| value.
655 //
656 // If |out_critical| is not NULL, this function sets |*out_critical| to one if
657 // the extension is found and critical, zero if it is found and not critical, -1
658 // if it is not found, and -2 if there is an invalid duplicate extension. Note
659 // this function may set |*out_critical| to one or zero and still return NULL if
660 // the extension is found but has a syntax error.
661 //
662 // If |out_idx| is not NULL, this function looks for the first occurrence of the
663 // extension after |*out_idx|. It then sets |*out_idx| to the index of the
664 // extension, or -1 if not found. If |out_idx| is non-NULL, duplicate extensions
665 // are not treated as an error. Callers, however, should not rely on this
666 // behavior as it may be removed in the future. Duplicate extensions are
667 // forbidden in RFC5280.
668 //
669 // WARNING: This function is difficult to use correctly. Callers should pass a
670 // non-NULL |out_critical| and check both the return value and |*out_critical|
671 // to handle errors. If the return value is NULL and |*out_critical| is not -1,
672 // there was an error. Otherwise, the function succeeded and but may return NULL
673 // for a missing extension. Callers should pass NULL to |out_idx| so that
674 // duplicate extensions are handled correctly.
675 //
676 // Additionally, casting the return value to the wrong type is a potentially
677 // exploitable memory error, so callers must ensure the cast and |nid| match.
678 OPENSSL_EXPORT void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *extensions,
679                                     int nid, int *out_critical, int *out_idx);
680 
681 // X509V3_EXT_free casts |ext_data| into the type that corresponds to |nid| and
682 // releases memory associated with it. It returns one on success and zero if
683 // |nid| is not a known extension.
684 //
685 // WARNING: Casting |ext_data| to the wrong type is a potentially exploitable
686 // memory error, so callers must ensure |ext_data|'s type matches |nid|.
687 //
688 // TODO(davidben): OpenSSL upstream no longer exposes this function. Remove it?
689 OPENSSL_EXPORT int X509V3_EXT_free(int nid, void *ext_data);
690 
691 // X509V3_EXT_i2d casts |ext_struc| into the type that corresponds to
692 // |ext_nid|, serializes it, and returns a newly-allocated |X509_EXTENSION|
693 // object containing the serialization, or NULL on error. The |X509_EXTENSION|
694 // has OID |ext_nid| and is critical if |crit| is one.
695 //
696 // WARNING: Casting |ext_struc| to the wrong type is a potentially exploitable
697 // memory error, so callers must ensure |ext_struct|'s type matches |ext_nid|.
698 OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit,
699                                               void *ext_struc);
700 
701 // The following constants control the behavior of |X509V3_add1_i2d| and related
702 // functions.
703 
704 // X509V3_ADD_OP_MASK can be ANDed with the flags to determine how duplicate
705 // extensions are processed.
706 #define X509V3_ADD_OP_MASK 0xfL
707 
708 // X509V3_ADD_DEFAULT causes the function to fail if the extension was already
709 // present.
710 #define X509V3_ADD_DEFAULT 0L
711 
712 // X509V3_ADD_APPEND causes the function to unconditionally appended the new
713 // extension to to the extensions list, even if there is a duplicate.
714 #define X509V3_ADD_APPEND 1L
715 
716 // X509V3_ADD_REPLACE causes the function to replace the existing extension, or
717 // append if it is not present.
718 #define X509V3_ADD_REPLACE 2L
719 
720 // X509V3_ADD_REPLACE causes the function to replace the existing extension and
721 // fail if it is not present.
722 #define X509V3_ADD_REPLACE_EXISTING 3L
723 
724 // X509V3_ADD_KEEP_EXISTING causes the function to succeed without replacing the
725 // extension if already present.
726 #define X509V3_ADD_KEEP_EXISTING 4L
727 
728 // X509V3_ADD_DELETE causes the function to remove the matching extension. No
729 // new extension is added. If there is no matching extension, the function
730 // fails. The |value| parameter is ignored in this mode.
731 #define X509V3_ADD_DELETE 5L
732 
733 // X509V3_ADD_SILENT may be ORed into one of the values above to indicate the
734 // function should not add to the error queue on duplicate or missing extension.
735 // The function will continue to return zero in those cases, and it will
736 // continue to return -1 and add to the error queue on other errors.
737 #define X509V3_ADD_SILENT 0x10
738 
739 // X509V3_add1_i2d casts |value| to the type that corresponds to |nid|,
740 // serializes it, and appends it to the extension list in |*x|. If |*x| is NULL,
741 // it will set |*x| to a newly-allocated |STACK_OF(X509_EXTENSION)| as needed.
742 // The |crit| parameter determines whether the new extension is critical.
743 // |flags| may be some combination of the |X509V3_ADD_*| constants to control
744 // the function's behavior on duplicate extension.
745 //
746 // This function returns one on success, zero if the operation failed due to a
747 // missing or duplicate extension, and -1 on other errors.
748 //
749 // WARNING: Casting |value| to the wrong type is a potentially exploitable
750 // memory error, so callers must ensure |value|'s type matches |nid|.
751 OPENSSL_EXPORT int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid,
752                                    void *value, int crit, unsigned long flags);
753 
754 #define X509V3_EXT_UNKNOWN_MASK (0xfL << 16)
755 
756 // X509V3_EXT_DEFAULT causes unknown extensions or syntax errors to return
757 // failure.
758 #define X509V3_EXT_DEFAULT 0
759 // X509V3_EXT_ERROR_UNKNOWN causes unknown extensions or syntax errors to print
760 // as "<Not Supported>" or "<Parse Error>", respectively.
761 #define X509V3_EXT_ERROR_UNKNOWN (1L << 16)
762 // X509V3_EXT_PARSE_UNKNOWN is deprecated and behaves like
763 // |X509V3_EXT_DUMP_UNKNOWN|.
764 #define X509V3_EXT_PARSE_UNKNOWN (2L << 16)
765 // X509V3_EXT_DUMP_UNKNOWN causes unknown extensions to be displayed as a
766 // hexdump.
767 #define X509V3_EXT_DUMP_UNKNOWN (3L << 16)
768 
769 OPENSSL_EXPORT void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val,
770                                        int indent, int ml);
771 OPENSSL_EXPORT int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext,
772                                     unsigned long flag, int indent);
773 OPENSSL_EXPORT int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag,
774                                        int indent);
775 
776 // X509V3_extensions_print prints |title|, followed by a human-readable
777 // representation of |exts| to |out|. It returns one on success and zero on
778 // error. The output is indented by |indent| spaces. |flag| is one of the
779 // |X509V3_EXT_*| constants and controls printing of unknown extensions and
780 // syntax errors.
781 OPENSSL_EXPORT int X509V3_extensions_print(BIO *out, const char *title,
782                                            const STACK_OF(X509_EXTENSION) *exts,
783                                            unsigned long flag, int indent);
784 
785 OPENSSL_EXPORT int X509_check_ca(X509 *x);
786 OPENSSL_EXPORT int X509_check_purpose(X509 *x, int id, int ca);
787 OPENSSL_EXPORT int X509_supported_extension(X509_EXTENSION *ex);
788 OPENSSL_EXPORT int X509_PURPOSE_set(int *p, int purpose);
789 OPENSSL_EXPORT int X509_check_issued(X509 *issuer, X509 *subject);
790 OPENSSL_EXPORT int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
791 
792 OPENSSL_EXPORT uint32_t X509_get_extension_flags(X509 *x);
793 OPENSSL_EXPORT uint32_t X509_get_key_usage(X509 *x);
794 OPENSSL_EXPORT uint32_t X509_get_extended_key_usage(X509 *x);
795 
796 // X509_get0_subject_key_id returns |x509|'s subject key identifier, if present.
797 // (See RFC5280, section 4.2.1.2.) It returns NULL if the extension is not
798 // present or if some extension in |x509| was invalid.
799 //
800 // Note that decoding an |X509| object will not check for invalid extensions. To
801 // detect the error case, call |X509_get_extensions_flags| and check the
802 // |EXFLAG_INVALID| bit.
803 OPENSSL_EXPORT const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x509);
804 
805 // X509_get0_authority_key_id returns keyIdentifier of |x509|'s authority key
806 // identifier, if the extension and field are present. (See RFC5280,
807 // section 4.2.1.1.) It returns NULL if the extension is not present, if it is
808 // present but lacks a keyIdentifier field, or if some extension in |x509| was
809 // invalid.
810 //
811 // Note that decoding an |X509| object will not check for invalid extensions. To
812 // detect the error case, call |X509_get_extensions_flags| and check the
813 // |EXFLAG_INVALID| bit.
814 OPENSSL_EXPORT const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x509);
815 
816 // X509_get0_authority_issuer returns the authorityCertIssuer of |x509|'s
817 // authority key identifier, if the extension and field are present. (See
818 // RFC5280, section 4.2.1.1.) It returns NULL if the extension is not present,
819 // if it is present but lacks a authorityCertIssuer field, or if some extension
820 // in |x509| was invalid.
821 //
822 // Note that decoding an |X509| object will not check for invalid extensions. To
823 // detect the error case, call |X509_get_extensions_flags| and check the
824 // |EXFLAG_INVALID| bit.
825 OPENSSL_EXPORT const GENERAL_NAMES *X509_get0_authority_issuer(X509 *x509);
826 
827 // X509_get0_authority_serial returns the authorityCertSerialNumber of |x509|'s
828 // authority key identifier, if the extension and field are present. (See
829 // RFC5280, section 4.2.1.1.) It returns NULL if the extension is not present,
830 // if it is present but lacks a authorityCertSerialNumber field, or if some
831 // extension in |x509| was invalid.
832 //
833 // Note that decoding an |X509| object will not check for invalid extensions. To
834 // detect the error case, call |X509_get_extensions_flags| and check the
835 // |EXFLAG_INVALID| bit.
836 OPENSSL_EXPORT const ASN1_INTEGER *X509_get0_authority_serial(X509 *x509);
837 
838 OPENSSL_EXPORT int X509_PURPOSE_get_count(void);
839 OPENSSL_EXPORT X509_PURPOSE *X509_PURPOSE_get0(int idx);
840 OPENSSL_EXPORT int X509_PURPOSE_get_by_sname(char *sname);
841 OPENSSL_EXPORT int X509_PURPOSE_get_by_id(int id);
842 OPENSSL_EXPORT int X509_PURPOSE_add(int id, int trust, int flags,
843                                     int (*ck)(const X509_PURPOSE *,
844                                               const X509 *, int),
845                                     char *name, char *sname, void *arg);
846 OPENSSL_EXPORT char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
847 OPENSSL_EXPORT char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
848 OPENSSL_EXPORT int X509_PURPOSE_get_trust(const X509_PURPOSE *xp);
849 OPENSSL_EXPORT void X509_PURPOSE_cleanup(void);
850 OPENSSL_EXPORT int X509_PURPOSE_get_id(const X509_PURPOSE *);
851 
852 OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
853 OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
854 OPENSSL_EXPORT void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
855 OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
856 // Flags for X509_check_* functions
857 
858 // Deprecated: this flag does nothing
859 #define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0
860 // Disable wildcard matching for dnsName fields and common name.
861 #define X509_CHECK_FLAG_NO_WILDCARDS 0x2
862 // Wildcards must not match a partial label.
863 #define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
864 // Allow (non-partial) wildcards to match multiple labels.
865 #define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
866 // Constraint verifier subdomain patterns to match a single labels.
867 #define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
868 // Skip the subject common name fallback if subjectAltNames is missing.
869 #define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20
870 //
871 // Match reference identifiers starting with "." to any sub-domain.
872 // This is a non-public flag, turned on implicitly when the subject
873 // reference identity is a DNS name.
874 #define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
875 
876 OPENSSL_EXPORT int X509_check_host(X509 *x, const char *chk, size_t chklen,
877                                    unsigned int flags, char **peername);
878 OPENSSL_EXPORT int X509_check_email(X509 *x, const char *chk, size_t chklen,
879                                     unsigned int flags);
880 OPENSSL_EXPORT int X509_check_ip(X509 *x, const unsigned char *chk,
881                                  size_t chklen, unsigned int flags);
882 OPENSSL_EXPORT int X509_check_ip_asc(X509 *x, const char *ipasc,
883                                      unsigned int flags);
884 
885 OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
886 OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
887 OPENSSL_EXPORT int a2i_ipadd(unsigned char *ipout, const char *ipasc);
888 OPENSSL_EXPORT int X509V3_NAME_from_section(X509_NAME *nm,
889                                             STACK_OF(CONF_VALUE) *dn_sk,
890                                             unsigned long chtype);
891 
892 OPENSSL_EXPORT void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node,
893                                            int indent);
894 DEFINE_STACK_OF(X509_POLICY_NODE)
895 
896 // BEGIN ERROR CODES
897 // The following lines are auto generated by the script mkerr.pl. Any changes
898 // made after this point may be overwritten when the script is next run.
899 
900 
901 #ifdef __cplusplus
902 }
903 
904 extern "C++" {
905 
906 BSSL_NAMESPACE_BEGIN
907 
908 BORINGSSL_MAKE_DELETER(ACCESS_DESCRIPTION, ACCESS_DESCRIPTION_free)
909 BORINGSSL_MAKE_DELETER(AUTHORITY_KEYID, AUTHORITY_KEYID_free)
910 BORINGSSL_MAKE_DELETER(BASIC_CONSTRAINTS, BASIC_CONSTRAINTS_free)
911 BORINGSSL_MAKE_DELETER(DIST_POINT, DIST_POINT_free)
912 BORINGSSL_MAKE_DELETER(GENERAL_NAME, GENERAL_NAME_free)
913 BORINGSSL_MAKE_DELETER(POLICYINFO, POLICYINFO_free)
914 
915 BSSL_NAMESPACE_END
916 
917 }  // extern C++
918 #endif
919 
920 #define X509V3_R_BAD_IP_ADDRESS 100
921 #define X509V3_R_BAD_OBJECT 101
922 #define X509V3_R_BN_DEC2BN_ERROR 102
923 #define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 103
924 #define X509V3_R_CANNOT_FIND_FREE_FUNCTION 104
925 #define X509V3_R_DIRNAME_ERROR 105
926 #define X509V3_R_DISTPOINT_ALREADY_SET 106
927 #define X509V3_R_DUPLICATE_ZONE_ID 107
928 #define X509V3_R_ERROR_CONVERTING_ZONE 108
929 #define X509V3_R_ERROR_CREATING_EXTENSION 109
930 #define X509V3_R_ERROR_IN_EXTENSION 110
931 #define X509V3_R_EXPECTED_A_SECTION_NAME 111
932 #define X509V3_R_EXTENSION_EXISTS 112
933 #define X509V3_R_EXTENSION_NAME_ERROR 113
934 #define X509V3_R_EXTENSION_NOT_FOUND 114
935 #define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 115
936 #define X509V3_R_EXTENSION_VALUE_ERROR 116
937 #define X509V3_R_ILLEGAL_EMPTY_EXTENSION 117
938 #define X509V3_R_ILLEGAL_HEX_DIGIT 118
939 #define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 119
940 #define X509V3_R_INVALID_BOOLEAN_STRING 120
941 #define X509V3_R_INVALID_EXTENSION_STRING 121
942 #define X509V3_R_INVALID_MULTIPLE_RDNS 122
943 #define X509V3_R_INVALID_NAME 123
944 #define X509V3_R_INVALID_NULL_ARGUMENT 124
945 #define X509V3_R_INVALID_NULL_NAME 125
946 #define X509V3_R_INVALID_NULL_VALUE 126
947 #define X509V3_R_INVALID_NUMBER 127
948 #define X509V3_R_INVALID_NUMBERS 128
949 #define X509V3_R_INVALID_OBJECT_IDENTIFIER 129
950 #define X509V3_R_INVALID_OPTION 130
951 #define X509V3_R_INVALID_POLICY_IDENTIFIER 131
952 #define X509V3_R_INVALID_PROXY_POLICY_SETTING 132
953 #define X509V3_R_INVALID_PURPOSE 133
954 #define X509V3_R_INVALID_SECTION 134
955 #define X509V3_R_INVALID_SYNTAX 135
956 #define X509V3_R_ISSUER_DECODE_ERROR 136
957 #define X509V3_R_MISSING_VALUE 137
958 #define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 138
959 #define X509V3_R_NO_CONFIG_DATABASE 139
960 #define X509V3_R_NO_ISSUER_CERTIFICATE 140
961 #define X509V3_R_NO_ISSUER_DETAILS 141
962 #define X509V3_R_NO_POLICY_IDENTIFIER 142
963 #define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 143
964 #define X509V3_R_NO_PUBLIC_KEY 144
965 #define X509V3_R_NO_SUBJECT_DETAILS 145
966 #define X509V3_R_ODD_NUMBER_OF_DIGITS 146
967 #define X509V3_R_OPERATION_NOT_DEFINED 147
968 #define X509V3_R_OTHERNAME_ERROR 148
969 #define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 149
970 #define X509V3_R_POLICY_PATH_LENGTH 150
971 #define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 151
972 #define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 152
973 #define X509V3_R_SECTION_NOT_FOUND 153
974 #define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 154
975 #define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 155
976 #define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 156
977 #define X509V3_R_UNKNOWN_EXTENSION 157
978 #define X509V3_R_UNKNOWN_EXTENSION_NAME 158
979 #define X509V3_R_UNKNOWN_OPTION 159
980 #define X509V3_R_UNSUPPORTED_OPTION 160
981 #define X509V3_R_UNSUPPORTED_TYPE 161
982 #define X509V3_R_USER_TOO_LONG 162
983 
984 #endif
985