xref: /openbsd/lib/libcrypto/x509/x509v3.h (revision d4af8408)
1 /* $OpenBSD: x509v3.h,v 1.35 2024/08/31 10:23:13 tb Exp $ */
2 /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3  * project 1999.
4  */
5 /* ====================================================================
6  * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in
17  *    the documentation and/or other materials provided with the
18  *    distribution.
19  *
20  * 3. All advertising materials mentioning features or use of this
21  *    software must display the following acknowledgment:
22  *    "This product includes software developed by the OpenSSL Project
23  *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24  *
25  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26  *    endorse or promote products derived from this software without
27  *    prior written permission. For written permission, please contact
28  *    licensing@OpenSSL.org.
29  *
30  * 5. Products derived from this software may not be called "OpenSSL"
31  *    nor may "OpenSSL" appear in their names without prior written
32  *    permission of the OpenSSL Project.
33  *
34  * 6. Redistributions of any form whatsoever must retain the following
35  *    acknowledgment:
36  *    "This product includes software developed by the OpenSSL Project
37  *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38  *
39  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
43  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50  * OF THE POSSIBILITY OF SUCH DAMAGE.
51  * ====================================================================
52  *
53  * This product includes cryptographic software written by Eric Young
54  * (eay@cryptsoft.com).  This product includes software written by Tim
55  * Hudson (tjh@cryptsoft.com).
56  *
57  */
58 #ifndef HEADER_X509V3_H
59 #define HEADER_X509V3_H
60 
61 #include <openssl/opensslconf.h>
62 
63 #include <openssl/bio.h>
64 #include <openssl/x509.h>
65 #include <openssl/conf.h>
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
71 /* Forward reference */
72 struct v3_ext_method;
73 struct v3_ext_ctx;
74 
75 /* Useful typedefs */
76 
77 typedef void * (*X509V3_EXT_NEW)(void);
78 typedef void (*X509V3_EXT_FREE)(void *);
79 typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long);
80 typedef int (*X509V3_EXT_I2D)(void *, unsigned char **);
81 typedef STACK_OF(CONF_VALUE) *
82   (*X509V3_EXT_I2V)(const struct v3_ext_method *method, void *ext,
83 		    STACK_OF(CONF_VALUE) *extlist);
84 typedef void * (*X509V3_EXT_V2I)(const struct v3_ext_method *method,
85 				 struct v3_ext_ctx *ctx,
86 				 STACK_OF(CONF_VALUE) *values);
87 typedef char * (*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext);
88 typedef void * (*X509V3_EXT_S2I)(const struct v3_ext_method *method,
89 				 struct v3_ext_ctx *ctx, const char *str);
90 typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext,
91 			      BIO *out, int indent);
92 typedef void * (*X509V3_EXT_R2I)(const struct v3_ext_method *method,
93 				 struct v3_ext_ctx *ctx, const char *str);
94 
95 /* V3 extension structure */
96 
97 struct v3_ext_method {
98 	int ext_nid;
99 	int ext_flags;
100 	/* If this is set the following four fields are ignored */
101 	ASN1_ITEM_EXP *it;
102 	/* Old style ASN1 calls */
103 	X509V3_EXT_NEW ext_new;
104 	X509V3_EXT_FREE ext_free;
105 	X509V3_EXT_D2I d2i;
106 	X509V3_EXT_I2D i2d;
107 
108 	/* The following pair is used for string extensions */
109 	X509V3_EXT_I2S i2s;
110 	X509V3_EXT_S2I s2i;
111 
112 	/* The following pair is used for multi-valued extensions */
113 	X509V3_EXT_I2V i2v;
114 	X509V3_EXT_V2I v2i;
115 
116 	/* The following are used for raw extensions */
117 	X509V3_EXT_I2R i2r;
118 	X509V3_EXT_R2I r2i;
119 
120 	const void *usr_data;	/* Any extension specific data */
121 };
122 
123 struct v3_ext_ctx {
124 	#define CTX_TEST 0x1
125 	int flags;
126 	X509 *issuer_cert;
127 	X509 *subject_cert;
128 	X509_REQ *subject_req;
129 	X509_CRL *crl;
130 	void *db;
131 };
132 
133 typedef struct v3_ext_method X509V3_EXT_METHOD;
134 
135 DECLARE_STACK_OF(X509V3_EXT_METHOD)
136 
137 /* ext_flags values */
138 #define X509V3_EXT_DYNAMIC	0x1
139 #define X509V3_EXT_CTX_DEP	0x2
140 #define X509V3_EXT_MULTILINE	0x4
141 
142 typedef BIT_STRING_BITNAME ENUMERATED_NAMES;
143 
144 typedef struct BASIC_CONSTRAINTS_st {
145 	int ca;
146 	ASN1_INTEGER *pathlen;
147 } BASIC_CONSTRAINTS;
148 
149 
150 typedef struct PKEY_USAGE_PERIOD_st {
151 	ASN1_GENERALIZEDTIME *notBefore;
152 	ASN1_GENERALIZEDTIME *notAfter;
153 } PKEY_USAGE_PERIOD;
154 
155 typedef struct otherName_st {
156 	ASN1_OBJECT *type_id;
157 	ASN1_TYPE *value;
158 } OTHERNAME;
159 
160 typedef struct EDIPartyName_st {
161 	ASN1_STRING *nameAssigner;
162 	ASN1_STRING *partyName;
163 } EDIPARTYNAME;
164 
165 typedef struct GENERAL_NAME_st {
166 
167 	#define GEN_OTHERNAME	0
168 	#define GEN_EMAIL	1
169 	#define GEN_DNS		2
170 	#define GEN_X400	3
171 	#define GEN_DIRNAME	4
172 	#define GEN_EDIPARTY	5
173 	#define GEN_URI		6
174 	#define GEN_IPADD	7
175 	#define GEN_RID		8
176 
177 	int type;
178 	union {
179 		char *ptr;
180 		OTHERNAME *otherName; /* otherName */
181 		ASN1_IA5STRING *rfc822Name;
182 		ASN1_IA5STRING *dNSName;
183 		ASN1_STRING *x400Address;
184 		X509_NAME *directoryName;
185 		EDIPARTYNAME *ediPartyName;
186 		ASN1_IA5STRING *uniformResourceIdentifier;
187 		ASN1_OCTET_STRING *iPAddress;
188 		ASN1_OBJECT *registeredID;
189 
190 		/* Old names */
191 		ASN1_OCTET_STRING *ip; /* iPAddress */
192 		X509_NAME *dirn;		/* dirn */
193 		ASN1_IA5STRING *ia5; /* rfc822Name, dNSName, uniformResourceIdentifier */
194 		ASN1_OBJECT *rid; /* registeredID */
195 	} d;
196 } GENERAL_NAME;
197 
198 typedef struct ACCESS_DESCRIPTION_st {
199 	ASN1_OBJECT *method;
200 	GENERAL_NAME *location;
201 } ACCESS_DESCRIPTION;
202 
203 typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
204 
205 typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;
206 
207 DECLARE_STACK_OF(GENERAL_NAME)
208 
209 typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;
210 DECLARE_STACK_OF(GENERAL_NAMES)
211 
212 DECLARE_STACK_OF(ACCESS_DESCRIPTION)
213 
214 typedef struct DIST_POINT_NAME_st {
215 	int type;
216 	union {
217 		GENERAL_NAMES *fullname;
218 		STACK_OF(X509_NAME_ENTRY) *relativename;
219 	} name;
220 	/* If relativename then this contains the full distribution point name */
221 	X509_NAME *dpname;
222 } DIST_POINT_NAME;
223 /* All existing reasons */
224 #define CRLDP_ALL_REASONS	0x807f
225 
226 #define CRL_REASON_NONE				-1
227 #define CRL_REASON_UNSPECIFIED			0
228 #define CRL_REASON_KEY_COMPROMISE		1
229 #define CRL_REASON_CA_COMPROMISE		2
230 #define CRL_REASON_AFFILIATION_CHANGED		3
231 #define CRL_REASON_SUPERSEDED			4
232 #define CRL_REASON_CESSATION_OF_OPERATION	5
233 #define CRL_REASON_CERTIFICATE_HOLD		6
234 #define CRL_REASON_REMOVE_FROM_CRL		8
235 #define CRL_REASON_PRIVILEGE_WITHDRAWN		9
236 #define CRL_REASON_AA_COMPROMISE		10
237 
238 struct DIST_POINT_st {
239 	DIST_POINT_NAME	*distpoint;
240 	ASN1_BIT_STRING *reasons;
241 	GENERAL_NAMES *CRLissuer;
242 	int dp_reasons;
243 };
244 
245 typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;
246 
247 DECLARE_STACK_OF(DIST_POINT)
248 
249 struct AUTHORITY_KEYID_st {
250 	ASN1_OCTET_STRING *keyid;
251 	GENERAL_NAMES *issuer;
252 	ASN1_INTEGER *serial;
253 };
254 
255 typedef struct NOTICEREF_st {
256 	ASN1_STRING *organization;
257 	STACK_OF(ASN1_INTEGER) *noticenos;
258 } NOTICEREF;
259 
260 typedef struct USERNOTICE_st {
261 	NOTICEREF *noticeref;
262 	ASN1_STRING *exptext;
263 } USERNOTICE;
264 
265 typedef struct POLICYQUALINFO_st {
266 	ASN1_OBJECT *pqualid;
267 	union {
268 		ASN1_IA5STRING *cpsuri;
269 		USERNOTICE *usernotice;
270 		ASN1_TYPE *other;
271 	} d;
272 } POLICYQUALINFO;
273 
274 DECLARE_STACK_OF(POLICYQUALINFO)
275 
276 typedef struct POLICYINFO_st {
277 	ASN1_OBJECT *policyid;
278 	STACK_OF(POLICYQUALINFO) *qualifiers;
279 } POLICYINFO;
280 
281 typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;
282 
283 DECLARE_STACK_OF(POLICYINFO)
284 
285 typedef struct POLICY_MAPPING_st {
286 	ASN1_OBJECT *issuerDomainPolicy;
287 	ASN1_OBJECT *subjectDomainPolicy;
288 } POLICY_MAPPING;
289 
290 DECLARE_STACK_OF(POLICY_MAPPING)
291 
292 typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;
293 
294 typedef struct GENERAL_SUBTREE_st {
295 	GENERAL_NAME *base;
296 	ASN1_INTEGER *minimum;
297 	ASN1_INTEGER *maximum;
298 } GENERAL_SUBTREE;
299 
300 DECLARE_STACK_OF(GENERAL_SUBTREE)
301 
302 struct NAME_CONSTRAINTS_st {
303 	STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;
304 	STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;
305 };
306 
307 typedef struct POLICY_CONSTRAINTS_st {
308 	ASN1_INTEGER *requireExplicitPolicy;
309 	ASN1_INTEGER *inhibitPolicyMapping;
310 } POLICY_CONSTRAINTS;
311 
312 struct ISSUING_DIST_POINT_st {
313 	DIST_POINT_NAME *distpoint;
314 	int onlyuser;
315 	int onlyCA;
316 	ASN1_BIT_STRING *onlysomereasons;
317 	int indirectCRL;
318 	int onlyattr;
319 };
320 
321 /* Values in idp_flags field */
322 /* IDP present */
323 #define	IDP_PRESENT	0x1
324 /* IDP values inconsistent */
325 #define IDP_INVALID	0x2
326 /* onlyuser true */
327 #define	IDP_ONLYUSER	0x4
328 /* onlyCA true */
329 #define	IDP_ONLYCA	0x8
330 /* onlyattr true */
331 #define IDP_ONLYATTR	0x10
332 /* indirectCRL true */
333 #define IDP_INDIRECT	0x20
334 /* onlysomereasons present */
335 #define IDP_REASONS	0x40
336 
337 #define X509V3_conf_err(val) ERR_asprintf_error_data( \
338 			"section:%s,name:%s,value:%s", val->section, \
339 			val->name, val->value);
340 
341 #define X509V3_set_ctx_test(ctx) \
342 			X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)
343 #define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;
344 
345 #define EXT_BITSTRING(nid, table) { nid, 0, &ASN1_BIT_STRING_it, \
346 			0,0,0,0, \
347 			0,0, \
348 			(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
349 			(X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
350 			NULL, NULL, \
351 			table}
352 
353 #define EXT_IA5STRING(nid) { nid, 0, &ASN1_IA5STRING_it, \
354 			0,0,0,0, \
355 			(X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
356 			(X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
357 			0,0,0,0, \
358 			NULL}
359 
360 #define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
361 
362 
363 /* X509_PURPOSE stuff */
364 
365 #define EXFLAG_BCONS		0x0001
366 #define EXFLAG_KUSAGE		0x0002
367 #define EXFLAG_XKUSAGE		0x0004
368 #define EXFLAG_NSCERT		0x0008
369 
370 #define EXFLAG_CA		0x0010
371 #define EXFLAG_SI		0x0020  /* Self issued. */
372 #define EXFLAG_V1		0x0040
373 #define EXFLAG_INVALID		0x0080
374 #define EXFLAG_SET		0x0100
375 #define EXFLAG_CRITICAL		0x0200
376 #if !defined(LIBRESSL_INTERNAL)
377 #define EXFLAG_PROXY		0x0400
378 #endif
379 #define EXFLAG_INVALID_POLICY	0x0800
380 #define EXFLAG_FRESHEST		0x1000
381 #define EXFLAG_SS               0x2000	/* Self signed. */
382 
383 #define KU_DIGITAL_SIGNATURE	0x0080
384 #define KU_NON_REPUDIATION	0x0040
385 #define KU_KEY_ENCIPHERMENT	0x0020
386 #define KU_DATA_ENCIPHERMENT	0x0010
387 #define KU_KEY_AGREEMENT	0x0008
388 #define KU_KEY_CERT_SIGN	0x0004
389 #define KU_CRL_SIGN		0x0002
390 #define KU_ENCIPHER_ONLY	0x0001
391 #define KU_DECIPHER_ONLY	0x8000
392 
393 #define NS_SSL_CLIENT		0x80
394 #define NS_SSL_SERVER		0x40
395 #define NS_SMIME		0x20
396 #define NS_OBJSIGN		0x10
397 #define NS_SSL_CA		0x04
398 #define NS_SMIME_CA		0x02
399 #define NS_OBJSIGN_CA		0x01
400 #define NS_ANY_CA		(NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)
401 
402 #define XKU_SSL_SERVER		0x1
403 #define XKU_SSL_CLIENT		0x2
404 #define XKU_SMIME		0x4
405 #define XKU_CODE_SIGN		0x8
406 #define XKU_SGC			0x10
407 #define XKU_OCSP_SIGN		0x20
408 #define XKU_TIMESTAMP		0x40
409 #define XKU_DVCS		0x80
410 #define XKU_ANYEKU		0x100
411 
412 #define X509_PURPOSE_DYNAMIC	0x1
413 #define X509_PURPOSE_DYNAMIC_NAME	0x2
414 
415 typedef struct x509_purpose_st X509_PURPOSE;
416 
417 #define X509_PURPOSE_SSL_CLIENT		1
418 #define X509_PURPOSE_SSL_SERVER		2
419 #define X509_PURPOSE_NS_SSL_SERVER	3
420 #define X509_PURPOSE_SMIME_SIGN		4
421 #define X509_PURPOSE_SMIME_ENCRYPT	5
422 #define X509_PURPOSE_CRL_SIGN		6
423 #define X509_PURPOSE_ANY		7
424 #define X509_PURPOSE_OCSP_HELPER	8
425 #define X509_PURPOSE_TIMESTAMP_SIGN	9
426 
427 #define X509_PURPOSE_MIN		1
428 #define X509_PURPOSE_MAX		9
429 
430 /* Flags for X509V3_EXT_print() */
431 
432 #define X509V3_EXT_UNKNOWN_MASK		(0xfL << 16)
433 /* Return error for unknown extensions */
434 #define X509V3_EXT_DEFAULT		0
435 /* Print error for unknown extensions */
436 #define X509V3_EXT_ERROR_UNKNOWN	(1L << 16)
437 /* ASN1 parse unknown extensions */
438 #define X509V3_EXT_PARSE_UNKNOWN	(2L << 16)
439 /* BIO_dump unknown extensions */
440 #define X509V3_EXT_DUMP_UNKNOWN		(3L << 16)
441 
442 /* Flags for X509V3_add1_i2d */
443 
444 #define X509V3_ADD_OP_MASK		0xfL
445 #define X509V3_ADD_DEFAULT		0L
446 #define X509V3_ADD_APPEND		1L
447 #define X509V3_ADD_REPLACE		2L
448 #define X509V3_ADD_REPLACE_EXISTING	3L
449 #define X509V3_ADD_KEEP_EXISTING	4L
450 #define X509V3_ADD_DELETE		5L
451 #define X509V3_ADD_SILENT		0x10
452 
453 DECLARE_STACK_OF(X509_PURPOSE)
454 
455 BASIC_CONSTRAINTS *BASIC_CONSTRAINTS_new(void);
456 void BASIC_CONSTRAINTS_free(BASIC_CONSTRAINTS *a);
457 BASIC_CONSTRAINTS *d2i_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS **a, const unsigned char **in, long len);
458 int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **out);
459 extern const ASN1_ITEM BASIC_CONSTRAINTS_it;
460 
461 AUTHORITY_KEYID *AUTHORITY_KEYID_new(void);
462 void AUTHORITY_KEYID_free(AUTHORITY_KEYID *a);
463 AUTHORITY_KEYID *d2i_AUTHORITY_KEYID(AUTHORITY_KEYID **a, const unsigned char **in, long len);
464 int i2d_AUTHORITY_KEYID(AUTHORITY_KEYID *a, unsigned char **out);
465 extern const ASN1_ITEM AUTHORITY_KEYID_it;
466 
467 PKEY_USAGE_PERIOD *PKEY_USAGE_PERIOD_new(void);
468 void PKEY_USAGE_PERIOD_free(PKEY_USAGE_PERIOD *a);
469 PKEY_USAGE_PERIOD *d2i_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD **a, const unsigned char **in, long len);
470 int i2d_PKEY_USAGE_PERIOD(PKEY_USAGE_PERIOD *a, unsigned char **out);
471 extern const ASN1_ITEM PKEY_USAGE_PERIOD_it;
472 
473 GENERAL_NAME *GENERAL_NAME_new(void);
474 void GENERAL_NAME_free(GENERAL_NAME *a);
475 GENERAL_NAME *d2i_GENERAL_NAME(GENERAL_NAME **a, const unsigned char **in, long len);
476 int i2d_GENERAL_NAME(GENERAL_NAME *a, unsigned char **out);
477 extern const ASN1_ITEM GENERAL_NAME_it;
478 GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
479 int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);
480 
481 
482 
483 ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
484 				X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
485 STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,
486 				ASN1_BIT_STRING *bits,
487 				STACK_OF(CONF_VALUE) *extlist);
488 
489 STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret);
490 int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);
491 
492 GENERAL_NAMES *GENERAL_NAMES_new(void);
493 void GENERAL_NAMES_free(GENERAL_NAMES *a);
494 GENERAL_NAMES *d2i_GENERAL_NAMES(GENERAL_NAMES **a, const unsigned char **in, long len);
495 int i2d_GENERAL_NAMES(GENERAL_NAMES *a, unsigned char **out);
496 extern const ASN1_ITEM GENERAL_NAMES_it;
497 
498 STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,
499 		GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist);
500 GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,
501 				 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);
502 
503 OTHERNAME *OTHERNAME_new(void);
504 void OTHERNAME_free(OTHERNAME *a);
505 OTHERNAME *d2i_OTHERNAME(OTHERNAME **a, const unsigned char **in, long len);
506 int i2d_OTHERNAME(OTHERNAME *a, unsigned char **out);
507 extern const ASN1_ITEM OTHERNAME_it;
508 EDIPARTYNAME *EDIPARTYNAME_new(void);
509 void EDIPARTYNAME_free(EDIPARTYNAME *a);
510 EDIPARTYNAME *d2i_EDIPARTYNAME(EDIPARTYNAME **a, const unsigned char **in, long len);
511 int i2d_EDIPARTYNAME(EDIPARTYNAME *a, unsigned char **out);
512 extern const ASN1_ITEM EDIPARTYNAME_it;
513 int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
514 void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
515 void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
516 int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
517 				ASN1_OBJECT *oid, ASN1_TYPE *value);
518 int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
519 				ASN1_OBJECT **poid, ASN1_TYPE **pvalue);
520 
521 char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
522     const ASN1_OCTET_STRING *ia5);
523 ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
524     X509V3_CTX *ctx, const char *str);
525 
526 EXTENDED_KEY_USAGE *EXTENDED_KEY_USAGE_new(void);
527 void EXTENDED_KEY_USAGE_free(EXTENDED_KEY_USAGE *a);
528 EXTENDED_KEY_USAGE *d2i_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE **a, const unsigned char **in, long len);
529 int i2d_EXTENDED_KEY_USAGE(EXTENDED_KEY_USAGE *a, unsigned char **out);
530 extern const ASN1_ITEM EXTENDED_KEY_USAGE_it;
531 int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a);
532 
533 CERTIFICATEPOLICIES *CERTIFICATEPOLICIES_new(void);
534 void CERTIFICATEPOLICIES_free(CERTIFICATEPOLICIES *a);
535 CERTIFICATEPOLICIES *d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **a, const unsigned char **in, long len);
536 int i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *a, unsigned char **out);
537 extern const ASN1_ITEM CERTIFICATEPOLICIES_it;
538 POLICYINFO *POLICYINFO_new(void);
539 void POLICYINFO_free(POLICYINFO *a);
540 POLICYINFO *d2i_POLICYINFO(POLICYINFO **a, const unsigned char **in, long len);
541 int i2d_POLICYINFO(POLICYINFO *a, unsigned char **out);
542 extern const ASN1_ITEM POLICYINFO_it;
543 POLICYQUALINFO *POLICYQUALINFO_new(void);
544 void POLICYQUALINFO_free(POLICYQUALINFO *a);
545 POLICYQUALINFO *d2i_POLICYQUALINFO(POLICYQUALINFO **a, const unsigned char **in, long len);
546 int i2d_POLICYQUALINFO(POLICYQUALINFO *a, unsigned char **out);
547 extern const ASN1_ITEM POLICYQUALINFO_it;
548 USERNOTICE *USERNOTICE_new(void);
549 void USERNOTICE_free(USERNOTICE *a);
550 USERNOTICE *d2i_USERNOTICE(USERNOTICE **a, const unsigned char **in, long len);
551 int i2d_USERNOTICE(USERNOTICE *a, unsigned char **out);
552 extern const ASN1_ITEM USERNOTICE_it;
553 NOTICEREF *NOTICEREF_new(void);
554 void NOTICEREF_free(NOTICEREF *a);
555 NOTICEREF *d2i_NOTICEREF(NOTICEREF **a, const unsigned char **in, long len);
556 int i2d_NOTICEREF(NOTICEREF *a, unsigned char **out);
557 extern const ASN1_ITEM NOTICEREF_it;
558 
559 CRL_DIST_POINTS *CRL_DIST_POINTS_new(void);
560 void CRL_DIST_POINTS_free(CRL_DIST_POINTS *a);
561 CRL_DIST_POINTS *d2i_CRL_DIST_POINTS(CRL_DIST_POINTS **a, const unsigned char **in, long len);
562 int i2d_CRL_DIST_POINTS(CRL_DIST_POINTS *a, unsigned char **out);
563 extern const ASN1_ITEM CRL_DIST_POINTS_it;
564 DIST_POINT *DIST_POINT_new(void);
565 void DIST_POINT_free(DIST_POINT *a);
566 DIST_POINT *d2i_DIST_POINT(DIST_POINT **a, const unsigned char **in, long len);
567 int i2d_DIST_POINT(DIST_POINT *a, unsigned char **out);
568 extern const ASN1_ITEM DIST_POINT_it;
569 DIST_POINT_NAME *DIST_POINT_NAME_new(void);
570 void DIST_POINT_NAME_free(DIST_POINT_NAME *a);
571 DIST_POINT_NAME *d2i_DIST_POINT_NAME(DIST_POINT_NAME **a, const unsigned char **in, long len);
572 int i2d_DIST_POINT_NAME(DIST_POINT_NAME *a, unsigned char **out);
573 extern const ASN1_ITEM DIST_POINT_NAME_it;
574 ISSUING_DIST_POINT *ISSUING_DIST_POINT_new(void);
575 void ISSUING_DIST_POINT_free(ISSUING_DIST_POINT *a);
576 ISSUING_DIST_POINT *d2i_ISSUING_DIST_POINT(ISSUING_DIST_POINT **a, const unsigned char **in, long len);
577 int i2d_ISSUING_DIST_POINT(ISSUING_DIST_POINT *a, unsigned char **out);
578 extern const ASN1_ITEM ISSUING_DIST_POINT_it;
579 
580 int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname);
581 
582 int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);
583 
584 ACCESS_DESCRIPTION *ACCESS_DESCRIPTION_new(void);
585 void ACCESS_DESCRIPTION_free(ACCESS_DESCRIPTION *a);
586 ACCESS_DESCRIPTION *d2i_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION **a, const unsigned char **in, long len);
587 int i2d_ACCESS_DESCRIPTION(ACCESS_DESCRIPTION *a, unsigned char **out);
588 extern const ASN1_ITEM ACCESS_DESCRIPTION_it;
589 AUTHORITY_INFO_ACCESS *AUTHORITY_INFO_ACCESS_new(void);
590 void AUTHORITY_INFO_ACCESS_free(AUTHORITY_INFO_ACCESS *a);
591 AUTHORITY_INFO_ACCESS *d2i_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS **a, const unsigned char **in, long len);
592 int i2d_AUTHORITY_INFO_ACCESS(AUTHORITY_INFO_ACCESS *a, unsigned char **out);
593 extern const ASN1_ITEM AUTHORITY_INFO_ACCESS_it;
594 
595 extern const ASN1_ITEM POLICY_MAPPING_it;
596 POLICY_MAPPING *POLICY_MAPPING_new(void);
597 void POLICY_MAPPING_free(POLICY_MAPPING *a);
598 extern const ASN1_ITEM POLICY_MAPPINGS_it;
599 
600 extern const ASN1_ITEM GENERAL_SUBTREE_it;
601 GENERAL_SUBTREE *GENERAL_SUBTREE_new(void);
602 void GENERAL_SUBTREE_free(GENERAL_SUBTREE *a);
603 
604 extern const ASN1_ITEM NAME_CONSTRAINTS_it;
605 NAME_CONSTRAINTS *NAME_CONSTRAINTS_new(void);
606 void NAME_CONSTRAINTS_free(NAME_CONSTRAINTS *a);
607 
608 POLICY_CONSTRAINTS *POLICY_CONSTRAINTS_new(void);
609 void POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a);
610 extern const ASN1_ITEM POLICY_CONSTRAINTS_it;
611 
612 GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
613 			       const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
614 			       int gen_type, const char *value, int is_nc);
615 
616 #ifdef HEADER_CONF_H
617 GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
618 			       CONF_VALUE *cnf);
619 GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
620 				  const X509V3_EXT_METHOD *method,
621 				  X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc);
622 void X509V3_conf_free(CONF_VALUE *val);
623 
624 X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,
625     const char *value);
626 X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, const char *name,
627     const char *value);
628 int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, const char *section,
629     STACK_OF(X509_EXTENSION) **sk);
630 int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
631     X509 *cert);
632 int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
633     X509_REQ *req);
634 int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, const char *section,
635     X509_CRL *crl);
636 
637 X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
638     int ext_nid, const char *value);
639 X509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,
640     const char *name, const char *value);
641 
642 void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);
643 #endif
644 
645 void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,
646 				 X509_REQ *req, X509_CRL *crl, int flags);
647 
648 char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const ASN1_INTEGER *aint);
649 ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, const char *value);
650 char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, const ASN1_ENUMERATED *aint);
651 char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth,
652     const ASN1_ENUMERATED *aint);
653 
654 const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);
655 const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);
656 int X509V3_add_standard_extensions(void);
657 STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);
658 void *X509V3_EXT_d2i(X509_EXTENSION *ext);
659 void *X509V3_get_d2i(const STACK_OF(X509_EXTENSION) *x, int nid, int *crit,
660     int *idx);
661 
662 X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);
663 int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags);
664 
665 char *hex_to_string(const unsigned char *buffer, long len);
666 unsigned char *string_to_hex(const char *str, long *len);
667 
668 void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,
669 								 int ml);
670 int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent);
671 int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);
672 
673 int X509V3_extensions_print(BIO *out, const char *title,
674     const STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent);
675 
676 int X509_check_ca(X509 *x);
677 int X509_check_purpose(X509 *x, int id, int ca);
678 int X509_supported_extension(X509_EXTENSION *ex);
679 int X509_check_issued(X509 *issuer, X509 *subject);
680 int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);
681 
682 int X509_PURPOSE_get_count(void);
683 const X509_PURPOSE *X509_PURPOSE_get0(int idx);
684 int X509_PURPOSE_get_by_sname(const char *sname);
685 const char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
686 const char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
687 int X509_PURPOSE_get_id(const X509_PURPOSE *);
688 uint32_t X509_get_extension_flags(X509 *x);
689 uint32_t X509_get_key_usage(X509 *x);
690 uint32_t X509_get_extended_key_usage(X509 *x);
691 
692 STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
693 STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
694 void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
695 STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
696 
697 /* Flags for X509_check_* functions */
698 /* Always check subject name for host match even if subject alt names present */
699 #define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT	0x1
700 /* Disable wildcard matching for dnsName fields and common name. */
701 #define X509_CHECK_FLAG_NO_WILDCARDS	0x2
702 /* Wildcards must not match a partial label. */
703 #define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
704 /* Allow (non-partial) wildcards to match multiple labels. */
705 #define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
706 /* Constraint verifier subdomain patterns to match a single labels. */
707 #define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
708 /* Disable checking the CN for a hostname, to support modern validation */
709 #define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20
710 
711 /*
712  * Match reference identifiers starting with "." to any sub-domain.
713  * This is a non-public flag, turned on implicitly when the subject
714  * reference identity is a DNS name.
715  */
716 #define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
717 
718 int X509_check_host(X509 *x, const char *chk, size_t chklen,
719     unsigned int flags, char **peername);
720 int X509_check_email(X509 *x, const char *chk, size_t chklen,
721     unsigned int flags);
722 int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
723     unsigned int flags);
724 int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);
725 
726 ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
727 ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
728 int a2i_ipadd(unsigned char *ipout, const char *ipasc);
729 int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk,
730 						unsigned long chtype);
731 
732 #ifndef OPENSSL_NO_RFC3779
733 typedef struct ASRange_st {
734 	ASN1_INTEGER *min;
735 	ASN1_INTEGER *max;
736 } ASRange;
737 
738 #define ASIdOrRange_id		0
739 #define ASIdOrRange_range	1
740 
741 typedef struct ASIdOrRange_st {
742 	int type;
743 	union {
744 		ASN1_INTEGER *id;
745 		ASRange *range;
746 	} u;
747 } ASIdOrRange;
748 
749 typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
750 DECLARE_STACK_OF(ASIdOrRange)
751 
752 #define ASIdentifierChoice_inherit		0
753 #define ASIdentifierChoice_asIdsOrRanges	1
754 
755 typedef struct ASIdentifierChoice_st {
756 	int type;
757 	union {
758 		ASN1_NULL *inherit;
759 		ASIdOrRanges *asIdsOrRanges;
760 	} u;
761 } ASIdentifierChoice;
762 
763 typedef struct ASIdentifiers_st {
764 	ASIdentifierChoice *asnum;
765 	ASIdentifierChoice *rdi;
766 } ASIdentifiers;
767 
768 ASRange *ASRange_new(void);
769 void ASRange_free(ASRange *a);
770 ASRange *d2i_ASRange(ASRange **a, const unsigned char **in, long len);
771 int i2d_ASRange(ASRange *a, unsigned char **out);
772 extern const ASN1_ITEM ASRange_it;
773 
774 ASIdOrRange *ASIdOrRange_new(void);
775 void ASIdOrRange_free(ASIdOrRange *a);
776 ASIdOrRange *d2i_ASIdOrRange(ASIdOrRange **a, const unsigned char **in,
777     long len);
778 int i2d_ASIdOrRange(ASIdOrRange *a, unsigned char **out);
779 extern const ASN1_ITEM ASIdOrRange_it;
780 
781 ASIdentifierChoice *ASIdentifierChoice_new(void);
782 void ASIdentifierChoice_free(ASIdentifierChoice *a);
783 ASIdentifierChoice *d2i_ASIdentifierChoice(ASIdentifierChoice **a,
784     const unsigned char **in, long len);
785 int i2d_ASIdentifierChoice(ASIdentifierChoice *a, unsigned char **out);
786 extern const ASN1_ITEM ASIdentifierChoice_it;
787 
788 ASIdentifiers *ASIdentifiers_new(void);
789 void ASIdentifiers_free(ASIdentifiers *a);
790 ASIdentifiers *d2i_ASIdentifiers(ASIdentifiers **a, const unsigned char **in,
791     long len);
792 int i2d_ASIdentifiers(ASIdentifiers *a, unsigned char **out);
793 extern const ASN1_ITEM ASIdentifiers_it;
794 
795 typedef struct IPAddressRange_st {
796 	ASN1_BIT_STRING *min;
797 	ASN1_BIT_STRING *max;
798 } IPAddressRange;
799 
800 #define IPAddressOrRange_addressPrefix	0
801 #define IPAddressOrRange_addressRange	1
802 
803 typedef struct IPAddressOrRange_st {
804 	int type;
805 	union {
806 		ASN1_BIT_STRING *addressPrefix;
807 		IPAddressRange *addressRange;
808 	} u;
809 } IPAddressOrRange;
810 
811 typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
812 DECLARE_STACK_OF(IPAddressOrRange)
813 
814 #define IPAddressChoice_inherit			0
815 #define IPAddressChoice_addressesOrRanges	1
816 
817 typedef struct IPAddressChoice_st {
818 	int type;
819 	union {
820 		ASN1_NULL *inherit;
821 		IPAddressOrRanges *addressesOrRanges;
822 	} u;
823 } IPAddressChoice;
824 
825 typedef struct IPAddressFamily_st {
826 	ASN1_OCTET_STRING *addressFamily;
827 	IPAddressChoice *ipAddressChoice;
828 } IPAddressFamily;
829 
830 typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
831 DECLARE_STACK_OF(IPAddressFamily)
832 
833 IPAddressRange *IPAddressRange_new(void);
834 void IPAddressRange_free(IPAddressRange *a);
835 IPAddressRange *d2i_IPAddressRange(IPAddressRange **a,
836     const unsigned char **in, long len);
837 int i2d_IPAddressRange(IPAddressRange *a, unsigned char **out);
838 extern const ASN1_ITEM IPAddressRange_it;
839 
840 IPAddressOrRange *IPAddressOrRange_new(void);
841 void IPAddressOrRange_free(IPAddressOrRange *a);
842 IPAddressOrRange *d2i_IPAddressOrRange(IPAddressOrRange **a,
843     const unsigned char **in, long len);
844 int i2d_IPAddressOrRange(IPAddressOrRange *a, unsigned char **out);
845 extern const ASN1_ITEM IPAddressOrRange_it;
846 
847 IPAddressChoice *IPAddressChoice_new(void);
848 void IPAddressChoice_free(IPAddressChoice *a);
849 IPAddressChoice *d2i_IPAddressChoice(IPAddressChoice **a,
850     const unsigned char **in, long len);
851 int i2d_IPAddressChoice(IPAddressChoice *a, unsigned char **out);
852 extern const ASN1_ITEM IPAddressChoice_it;
853 
854 IPAddressFamily *IPAddressFamily_new(void);
855 void IPAddressFamily_free(IPAddressFamily *a);
856 IPAddressFamily *d2i_IPAddressFamily(IPAddressFamily **a,
857     const unsigned char **in, long len);
858 int i2d_IPAddressFamily(IPAddressFamily *a, unsigned char **out);
859 extern const ASN1_ITEM IPAddressFamily_it;
860 
861 /*
862  * API tag for elements of the ASIdentifer SEQUENCE.
863  */
864 #define V3_ASID_ASNUM	0
865 #define V3_ASID_RDI	1
866 
867 /*
868  * AFI values, assigned by IANA.  It'd be nice to make the AFI
869  * handling code totally generic, but there are too many little things
870  * that would need to be defined for other address families for it to
871  * be worth the trouble.
872  */
873 #define IANA_AFI_IPV4	1
874 #define IANA_AFI_IPV6	2
875 
876 /*
877  * Utilities to construct and extract values from RFC3779 extensions,
878  * since some of the encodings (particularly for IP address prefixes
879  * and ranges) are a bit tedious to work with directly.
880  */
881 int X509v3_asid_add_inherit(ASIdentifiers *asid, int which);
882 int X509v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
883     ASN1_INTEGER *min, ASN1_INTEGER *max);
884 int X509v3_addr_add_inherit(IPAddrBlocks *addr, const unsigned afi,
885     const unsigned *safi);
886 int X509v3_addr_add_prefix(IPAddrBlocks *addr, const unsigned afi,
887     const unsigned *safi, unsigned char *a, const int prefixlen);
888 int X509v3_addr_add_range(IPAddrBlocks *addr, const unsigned afi,
889     const unsigned *safi, unsigned char *min, unsigned char *max);
890 unsigned X509v3_addr_get_afi(const IPAddressFamily *f);
891 int X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
892     unsigned char *min, unsigned char *max, const int length);
893 
894 /*
895  * Canonical forms.
896  */
897 int X509v3_asid_is_canonical(ASIdentifiers *asid);
898 int X509v3_addr_is_canonical(IPAddrBlocks *addr);
899 int X509v3_asid_canonize(ASIdentifiers *asid);
900 int X509v3_addr_canonize(IPAddrBlocks *addr);
901 
902 /*
903  * Tests for inheritance and containment.
904  */
905 int X509v3_asid_inherits(ASIdentifiers *asid);
906 int X509v3_addr_inherits(IPAddrBlocks *addr);
907 int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b);
908 int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
909 
910 /*
911  * Check whether RFC 3779 extensions nest properly in chains.
912  */
913 int X509v3_asid_validate_path(X509_STORE_CTX *);
914 int X509v3_addr_validate_path(X509_STORE_CTX *);
915 int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain, ASIdentifiers *ext,
916     int allow_inheritance);
917 int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain, IPAddrBlocks *ext,
918     int allow_inheritance);
919 
920 #endif /* !OPENSSL_NO_RFC3779 */
921 
922 void ERR_load_X509V3_strings(void);
923 
924 /* Error codes for the X509V3 functions. */
925 
926 /* Function codes. */
927 #define X509V3_F_A2I_GENERAL_NAME			 164
928 #define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE		 161
929 #define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL	 162
930 #define X509V3_F_COPY_EMAIL				 122
931 #define X509V3_F_COPY_ISSUER				 123
932 #define X509V3_F_DO_DIRNAME				 144
933 #define X509V3_F_DO_EXT_CONF				 124
934 #define X509V3_F_DO_EXT_I2D				 135
935 #define X509V3_F_DO_EXT_NCONF				 151
936 #define X509V3_F_DO_I2V_NAME_CONSTRAINTS		 148
937 #define X509V3_F_GNAMES_FROM_SECTNAME			 156
938 #define X509V3_F_HEX_TO_STRING				 111
939 #define X509V3_F_I2S_ASN1_ENUMERATED			 121
940 #define X509V3_F_I2S_ASN1_IA5STRING			 149
941 #define X509V3_F_I2S_ASN1_INTEGER			 120
942 #define X509V3_F_I2V_AUTHORITY_INFO_ACCESS		 138
943 #define X509V3_F_NOTICE_SECTION				 132
944 #define X509V3_F_NREF_NOS				 133
945 #define X509V3_F_POLICY_SECTION				 131
946 #define X509V3_F_PROCESS_PCI_VALUE			 150
947 #define X509V3_F_R2I_CERTPOL				 130
948 #define X509V3_F_R2I_PCI				 155
949 #define X509V3_F_S2I_ASN1_IA5STRING			 100
950 #define X509V3_F_S2I_ASN1_INTEGER			 108
951 #define X509V3_F_S2I_ASN1_OCTET_STRING			 112
952 #define X509V3_F_S2I_ASN1_SKEY_ID			 114
953 #define X509V3_F_S2I_SKEY_ID				 115
954 #define X509V3_F_SET_DIST_POINT_NAME			 158
955 #define X509V3_F_STRING_TO_HEX				 113
956 #define X509V3_F_SXNET_ADD_ID_ASC			 125
957 #define X509V3_F_SXNET_ADD_ID_INTEGER			 126
958 #define X509V3_F_SXNET_ADD_ID_ULONG			 127
959 #define X509V3_F_SXNET_GET_ID_ASC			 128
960 #define X509V3_F_SXNET_GET_ID_ULONG			 129
961 #define X509V3_F_V2I_ASIDENTIFIERS			 163
962 #define X509V3_F_V2I_ASN1_BIT_STRING			 101
963 #define X509V3_F_V2I_AUTHORITY_INFO_ACCESS		 139
964 #define X509V3_F_V2I_AUTHORITY_KEYID			 119
965 #define X509V3_F_V2I_BASIC_CONSTRAINTS			 102
966 #define X509V3_F_V2I_CRLD				 134
967 #define X509V3_F_V2I_EXTENDED_KEY_USAGE			 103
968 #define X509V3_F_V2I_GENERAL_NAMES			 118
969 #define X509V3_F_V2I_GENERAL_NAME_EX			 117
970 #define X509V3_F_V2I_IDP				 157
971 #define X509V3_F_V2I_IPADDRBLOCKS			 159
972 #define X509V3_F_V2I_ISSUER_ALT				 153
973 #define X509V3_F_V2I_NAME_CONSTRAINTS			 147
974 #define X509V3_F_V2I_POLICY_CONSTRAINTS			 146
975 #define X509V3_F_V2I_POLICY_MAPPINGS			 145
976 #define X509V3_F_V2I_SUBJECT_ALT			 154
977 #define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL		 160
978 #define X509V3_F_V3_GENERIC_EXTENSION			 116
979 #define X509V3_F_X509V3_ADD1_I2D			 140
980 #define X509V3_F_X509V3_ADD_VALUE			 105
981 #define X509V3_F_X509V3_EXT_ADD				 104
982 #define X509V3_F_X509V3_EXT_ADD_ALIAS			 106
983 #define X509V3_F_X509V3_EXT_CONF			 107
984 #define X509V3_F_X509V3_EXT_I2D				 136
985 #define X509V3_F_X509V3_EXT_NCONF			 152
986 #define X509V3_F_X509V3_GET_SECTION			 142
987 #define X509V3_F_X509V3_GET_STRING			 143
988 #define X509V3_F_X509V3_GET_VALUE_BOOL			 110
989 #define X509V3_F_X509V3_PARSE_LIST			 109
990 #define X509V3_F_X509_PURPOSE_ADD			 137
991 #define X509V3_F_X509_PURPOSE_SET			 141
992 
993 /* Reason codes. */
994 #define X509V3_R_BAD_IP_ADDRESS				 118
995 #define X509V3_R_BAD_OBJECT				 119
996 #define X509V3_R_BN_DEC2BN_ERROR			 100
997 #define X509V3_R_BN_TO_ASN1_INTEGER_ERROR		 101
998 #define X509V3_R_DIRNAME_ERROR				 149
999 #define X509V3_R_DISTPOINT_ALREADY_SET			 160
1000 #define X509V3_R_DUPLICATE_ZONE_ID			 133
1001 #define X509V3_R_ERROR_CONVERTING_ZONE			 131
1002 #define X509V3_R_ERROR_CREATING_EXTENSION		 144
1003 #define X509V3_R_ERROR_IN_EXTENSION			 128
1004 #define X509V3_R_EXPECTED_A_SECTION_NAME		 137
1005 #define X509V3_R_EXTENSION_EXISTS			 145
1006 #define X509V3_R_EXTENSION_NAME_ERROR			 115
1007 #define X509V3_R_EXTENSION_NOT_FOUND			 102
1008 #define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED	 103
1009 #define X509V3_R_EXTENSION_VALUE_ERROR			 116
1010 #define X509V3_R_ILLEGAL_EMPTY_EXTENSION		 151
1011 #define X509V3_R_ILLEGAL_HEX_DIGIT			 113
1012 #define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG		 152
1013 #define X509V3_R_INVALID_MULTIPLE_RDNS			 161
1014 #define X509V3_R_INVALID_ASNUMBER			 162
1015 #define X509V3_R_INVALID_ASRANGE			 163
1016 #define X509V3_R_INVALID_BOOLEAN_STRING			 104
1017 #define X509V3_R_INVALID_EXTENSION_STRING		 105
1018 #define X509V3_R_INVALID_INHERITANCE			 165
1019 #define X509V3_R_INVALID_IPADDRESS			 166
1020 #define X509V3_R_INVALID_NAME				 106
1021 #define X509V3_R_INVALID_NULL_ARGUMENT			 107
1022 #define X509V3_R_INVALID_NULL_NAME			 108
1023 #define X509V3_R_INVALID_NULL_VALUE			 109
1024 #define X509V3_R_INVALID_NUMBER				 140
1025 #define X509V3_R_INVALID_NUMBERS			 141
1026 #define X509V3_R_INVALID_OBJECT_IDENTIFIER		 110
1027 #define X509V3_R_INVALID_OPTION				 138
1028 #define X509V3_R_INVALID_POLICY_IDENTIFIER		 134
1029 #define X509V3_R_INVALID_PROXY_POLICY_SETTING		 153
1030 #define X509V3_R_INVALID_PURPOSE			 146
1031 #define X509V3_R_INVALID_SAFI				 164
1032 #define X509V3_R_INVALID_SECTION			 135
1033 #define X509V3_R_INVALID_SYNTAX				 143
1034 #define X509V3_R_ISSUER_DECODE_ERROR			 126
1035 #define X509V3_R_MISSING_VALUE				 124
1036 #define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS		 142
1037 #define X509V3_R_NO_CONFIG_DATABASE			 136
1038 #define X509V3_R_NO_ISSUER_CERTIFICATE			 121
1039 #define X509V3_R_NO_ISSUER_DETAILS			 127
1040 #define X509V3_R_NO_POLICY_IDENTIFIER			 139
1041 #define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED	 154
1042 #define X509V3_R_NO_PUBLIC_KEY				 114
1043 #define X509V3_R_NO_SUBJECT_DETAILS			 125
1044 #define X509V3_R_ODD_NUMBER_OF_DIGITS			 112
1045 #define X509V3_R_OPERATION_NOT_DEFINED			 148
1046 #define X509V3_R_OTHERNAME_ERROR			 147
1047 #define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED	 155
1048 #define X509V3_R_POLICY_PATH_LENGTH			 156
1049 #define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED	 157
1050 #define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED	 158
1051 #define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
1052 #define X509V3_R_SECTION_NOT_FOUND			 150
1053 #define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS		 122
1054 #define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID		 123
1055 #define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT		 111
1056 #define X509V3_R_UNKNOWN_EXTENSION			 129
1057 #define X509V3_R_UNKNOWN_EXTENSION_NAME			 130
1058 #define X509V3_R_UNKNOWN_OPTION				 120
1059 #define X509V3_R_UNSUPPORTED_OPTION			 117
1060 #define X509V3_R_UNSUPPORTED_TYPE			 167
1061 #define X509V3_R_USER_TOO_LONG				 132
1062 
1063 #ifdef  __cplusplus
1064 }
1065 #endif
1066 #endif
1067