1 /* x509v3.h */
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 module deimos.openssl.x509v3;
59 
60 import deimos.openssl._d_util;
61 
62 public import deimos.openssl.bio;
63 public import deimos.openssl.x509;
64 public import deimos.openssl.conf;
65 
66 extern (C):
67 nothrow:
68 
69 /* Forward reference */
70 // struct v3_ext_method;
71 // struct v3_ext_ctx;
72 
73 /* Useful typedefs */
74 
75 alias ExternC!(void*function()) X509V3_EXT_NEW;
76 alias ExternC!(void function(void*)) X509V3_EXT_FREE;
77 alias ExternC!(void*function(void*, const(ubyte)** , c_long)) X509V3_EXT_D2I;
78 alias ExternC!(int function(void*, ubyte**)) X509V3_EXT_I2D;
79 alias ExternC!(STACK_OF!(CONF_VALUE)* function(const(v3_ext_method)* method, void* ext,
80 		    STACK_OF!(CONF_VALUE) *extlist)) X509V3_EXT_I2V;
81 alias ExternC!(void*function(const(v3_ext_method)* method,
82 				 v3_ext_ctx* ctx,
83 				 STACK_OF!(CONF_VALUE) *values)) X509V3_EXT_V2I;
84 alias ExternC!(char*function(const(v3_ext_method)* method, void* ext)) X509V3_EXT_I2S;
85 alias ExternC!(void*function(const(v3_ext_method)* method,
86 				 v3_ext_ctx* ctx, const(char)* str)) X509V3_EXT_S2I;
87 alias ExternC!(int function(const(v3_ext_method)* method, void* ext,
88 			      BIO* out_, int indent)) X509V3_EXT_I2R;
89 alias ExternC!(void*function(const(v3_ext_method)* method,
90 				 v3_ext_ctx* ctx, const(char)* str)) X509V3_EXT_R2I;
91 
92 /* V3 extension structure */
93 
94 struct v3_ext_method {
95 int ext_nid;
96 int ext_flags;
97 /* If this is set the following four fields are ignored */
98 ASN1_ITEM_EXP* it;
99 /* Old style ASN1 calls */
100 X509V3_EXT_NEW ext_new;
101 X509V3_EXT_FREE ext_free;
102 X509V3_EXT_D2I d2i;
103 X509V3_EXT_I2D i2d;
104 
105 /* The following pair is used for string extensions */
106 X509V3_EXT_I2S i2s;
107 X509V3_EXT_S2I s2i;
108 
109 /* The following pair is used for multi-valued extensions */
110 X509V3_EXT_I2V i2v;
111 X509V3_EXT_V2I v2i;
112 
113 /* The following are used for raw extensions */
114 X509V3_EXT_I2R i2r;
115 X509V3_EXT_R2I r2i;
116 
117 void* usr_data;	/* Any extension specific data */
118 };
119 
120 struct X509V3_CONF_METHOD_st {
121 ExternC!(char* function(void* db, char* section, char* value)) get_string;
122 ExternC!(STACK_OF!(CONF_VALUE)* function(void* db, char* section)) get_section;
123 ExternC!(void function(void* db, char* string)) free_string;
124 ExternC!(void function(void* db, STACK_OF!(CONF_VALUE) *section)) free_section;
125 }
126 alias X509V3_CONF_METHOD_st X509V3_CONF_METHOD;
127 
128 /* Context specific info */
129 struct v3_ext_ctx {
130 enum CTX_TEST = 0x1;
131 int flags;
132 X509* issuer_cert;
133 X509* subject_cert;
134 X509_REQ* subject_req;
135 X509_CRL* crl;
136 X509V3_CONF_METHOD* db_meth;
137 void* db;
138 /* Maybe more here */
139 };
140 
141 alias v3_ext_method X509V3_EXT_METHOD;
142 
143 /+mixin DECLARE_STACK_OF!(X509V3_EXT_METHOD);+/
144 
145 /* ext_flags values */
146 enum X509V3_EXT_DYNAMIC = 0x1;
147 enum X509V3_EXT_CTX_DEP = 0x2;
148 enum X509V3_EXT_MULTILINE = 0x4;
149 
150 alias BIT_STRING_BITNAME ENUMERATED_NAMES;
151 
152 struct BASIC_CONSTRAINTS_st {
153 int ca;
154 ASN1_INTEGER* pathlen;
155 }
156 alias BASIC_CONSTRAINTS_st BASIC_CONSTRAINTS;
157 
158 
159 struct PKEY_USAGE_PERIOD_st {
160 ASN1_GENERALIZEDTIME* notBefore;
161 ASN1_GENERALIZEDTIME* notAfter;
162 }
163 alias PKEY_USAGE_PERIOD_st PKEY_USAGE_PERIOD;
164 
165 struct otherName_st {
166 ASN1_OBJECT* type_id;
167 ASN1_TYPE* value;
168 }
169 alias otherName_st OTHERNAME;
170 
171 struct EDIPartyName_st {
172 	ASN1_STRING* nameAssigner;
173 	ASN1_STRING* partyName;
174 }
175 alias EDIPartyName_st EDIPARTYNAME;
176 
177 struct GENERAL_NAME_st {
178 
179 enum GEN_OTHERNAME = 0;
180 enum GEN_EMAIL = 1;
181 enum GEN_DNS = 2;
182 enum GEN_X400 = 3;
183 enum GEN_DIRNAME = 4;
184 enum GEN_EDIPARTY = 5;
185 enum GEN_URI = 6;
186 enum GEN_IPADD = 7;
187 enum GEN_RID = 8;
188 
189 int type;
190 union d_ {
191 	char* ptr;
192 	OTHERNAME* otherName; /* otherName */
193 	ASN1_IA5STRING* rfc822Name;
194 	ASN1_IA5STRING* dNSName;
195 	ASN1_TYPE* x400Address;
196 	X509_NAME* directoryName;
197 	EDIPARTYNAME* ediPartyName;
198 	ASN1_IA5STRING* uniformResourceIdentifier;
199 	ASN1_OCTET_STRING* iPAddress;
200 	ASN1_OBJECT* registeredID;
201 
202 	/* Old names */
203 	ASN1_OCTET_STRING* ip; /* iPAddress */
204 	X509_NAME* dirn;		/* dirn */
205 	ASN1_IA5STRING* ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */
206 	ASN1_OBJECT* rid; /* registeredID */
207 	ASN1_TYPE* other; /* x400Address */
208 }
209 d_ d;
210 }
211 alias GENERAL_NAME_st GENERAL_NAME;
212 
213 alias STACK_OF!(GENERAL_NAME) GENERAL_NAMES;
214 
215 struct ACCESS_DESCRIPTION_st {
216 	ASN1_OBJECT* method;
217 	GENERAL_NAME* location;
218 }
219 alias ACCESS_DESCRIPTION_st ACCESS_DESCRIPTION;
220 
221 alias STACK_OF!(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
222 
223 alias STACK_OF!(ASN1_OBJECT) EXTENDED_KEY_USAGE;
224 
225 /+mixin DECLARE_STACK_OF!(GENERAL_NAME);+/
226 mixin DECLARE_ASN1_SET_OF!(GENERAL_NAME);
227 
228 /+mixin DECLARE_STACK_OF!(ACCESS_DESCRIPTION);+/
229 mixin DECLARE_ASN1_SET_OF!(ACCESS_DESCRIPTION);
230 
231 struct DIST_POINT_NAME_st {
232 int type;
233 union name_ {
234 	GENERAL_NAMES* fullname;
235 	STACK_OF!(X509_NAME_ENTRY) *relativename;
236 }
237 name_ name;
238 /* If relativename then this contains the full distribution point name */
239 X509_NAME* dpname;
240 }
241 alias DIST_POINT_NAME_st DIST_POINT_NAME;
242 /* All existing reasons */
243 enum CRLDP_ALL_REASONS = 0x807f;
244 
245 enum CRL_REASON_NONE = -1;
246 enum CRL_REASON_UNSPECIFIED = 0;
247 enum CRL_REASON_KEY_COMPROMISE = 1;
248 enum CRL_REASON_CA_COMPROMISE = 2;
249 enum CRL_REASON_AFFILIATION_CHANGED = 3;
250 enum CRL_REASON_SUPERSEDED = 4;
251 enum CRL_REASON_CESSATION_OF_OPERATION = 5;
252 enum CRL_REASON_CERTIFICATE_HOLD = 6;
253 enum CRL_REASON_REMOVE_FROM_CRL = 8;
254 enum CRL_REASON_PRIVILEGE_WITHDRAWN = 9;
255 enum CRL_REASON_AA_COMPROMISE = 10;
256 
257 struct DIST_POINT_st {
258 DIST_POINT_NAME* distpoint;
259 ASN1_BIT_STRING* reasons;
260 GENERAL_NAMES* CRLissuer;
261 int dp_reasons;
262 };
263 
264 alias STACK_OF!(DIST_POINT) CRL_DIST_POINTS;
265 
266 /+mixin DECLARE_STACK_OF!(DIST_POINT);+/
267 mixin DECLARE_ASN1_SET_OF!(DIST_POINT);
268 
269 struct AUTHORITY_KEYID_st {
270 ASN1_OCTET_STRING* keyid;
271 GENERAL_NAMES* issuer;
272 ASN1_INTEGER* serial;
273 };
274 
275 /* Strong extranet structures */
276 
277 struct SXNET_ID_st {
278 	ASN1_INTEGER* zone;
279 	ASN1_OCTET_STRING* user;
280 }
281 alias SXNET_ID_st SXNETID;
282 
283 /+mixin DECLARE_STACK_OF!(SXNETID);+/
284 mixin DECLARE_ASN1_SET_OF!(SXNETID);
285 
286 struct SXNET_st {
287 	ASN1_INTEGER* version_;
288 	STACK_OF!(SXNETID) *ids;
289 }
290 alias SXNET_st SXNET;
291 
292 struct NOTICEREF_st {
293 	ASN1_STRING* organization;
294 	STACK_OF!(ASN1_INTEGER) *noticenos;
295 }
296 alias NOTICEREF_st NOTICEREF;
297 
298 struct USERNOTICE_st {
299 	NOTICEREF* noticeref;
300 	ASN1_STRING* exptext;
301 }
302 alias USERNOTICE_st USERNOTICE;
303 
304 struct POLICYQUALINFO_st {
305 	ASN1_OBJECT* pqualid;
306 	union d_ {
307 		ASN1_IA5STRING* cpsuri;
308 		USERNOTICE* usernotice;
309 		ASN1_TYPE* other;
310 	}
311 	d_ d;
312 }
313 alias POLICYQUALINFO_st POLICYQUALINFO;
314 
315 /+mixin DECLARE_STACK_OF!(POLICYQUALINFO);+/
316 mixin DECLARE_ASN1_SET_OF!(POLICYQUALINFO);
317 
318 struct POLICYINFO_st {
319 	ASN1_OBJECT* policyid;
320 	STACK_OF!(POLICYQUALINFO) *qualifiers;
321 }
322 alias POLICYINFO_st POLICYINFO;
323 
324 alias STACK_OF!(POLICYINFO) CERTIFICATEPOLICIES;
325 
326 /+mixin DECLARE_STACK_OF!(POLICYINFO);+/
327 mixin DECLARE_ASN1_SET_OF!(POLICYINFO);
328 
329 struct POLICY_MAPPING_st {
330 	ASN1_OBJECT* issuerDomainPolicy;
331 	ASN1_OBJECT* subjectDomainPolicy;
332 }
333 alias POLICY_MAPPING_st POLICY_MAPPING;
334 
335 /+mixin DECLARE_STACK_OF!(POLICY_MAPPING);+/
336 
337 alias STACK_OF!(POLICY_MAPPING) POLICY_MAPPINGS;
338 
339 struct GENERAL_SUBTREE_st {
340 	GENERAL_NAME* base;
341 	ASN1_INTEGER* minimum;
342 	ASN1_INTEGER* maximum;
343 }
344 alias GENERAL_SUBTREE_st GENERAL_SUBTREE;
345 
346 /+mixin DECLARE_STACK_OF!(GENERAL_SUBTREE);+/
347 
348 struct NAME_CONSTRAINTS_st {
349 	STACK_OF!(GENERAL_SUBTREE) *permittedSubtrees;
350 	STACK_OF!(GENERAL_SUBTREE) *excludedSubtrees;
351 };
352 
353 struct POLICY_CONSTRAINTS_st {
354 	ASN1_INTEGER* requireExplicitPolicy;
355 	ASN1_INTEGER* inhibitPolicyMapping;
356 }
357 alias POLICY_CONSTRAINTS_st POLICY_CONSTRAINTS;
358 
359 /* Proxy certificate structures, see RFC 3820 */
360 struct PROXY_POLICY_st {
361 	ASN1_OBJECT* policyLanguage;
362 	ASN1_OCTET_STRING* policy;
363 	}
364 alias PROXY_POLICY_st PROXY_POLICY;
365 
366 struct PROXY_CERT_INFO_EXTENSION_st {
367 	ASN1_INTEGER* pcPathLengthConstraint;
368 	PROXY_POLICY* proxyPolicy;
369 	}
370 alias PROXY_CERT_INFO_EXTENSION_st PROXY_CERT_INFO_EXTENSION;
371 
372 mixin(DECLARE_ASN1_FUNCTIONS!"PROXY_POLICY");
373 mixin(DECLARE_ASN1_FUNCTIONS!"PROXY_CERT_INFO_EXTENSION");
374 
375 struct ISSUING_DIST_POINT_st
376 	{
377 	DIST_POINT_NAME* distpoint;
378 	int onlyuser;
379 	int onlyCA;
380 	ASN1_BIT_STRING* onlysomereasons;
381 	int indirectCRL;
382 	int onlyattr;
383 	};
384 
385 /* Values in idp_flags field */
386 /* IDP present */
387 enum IDP_PRESENT = 0x1;
388 /* IDP values inconsistent */
389 enum IDP_INVALID = 0x2;
390 /* onlyuser true */
391 enum IDP_ONLYUSER = 0x4;
392 /* onlyCA true */
393 enum IDP_ONLYCA = 0x8;
394 /* onlyattr true */
395 enum IDP_ONLYATTR = 0x10;
396 /* indirectCRL true */
397 enum IDP_INDIRECT = 0x20;
398 /* onlysomereasons present */
399 enum IDP_REASONS = 0x40;
400 
401 auto X509V3_conf_err()(CONF_VALUE* val) {
402 	return ERR_add_error_data(6, "section:", val.section,
403 		",name:", val.name, ",value:", val.value);
404 }
405 
406 auto X509V3_set_ctx_test()(X509V3_CTX* ctx) {
407 	return X509V3_set_ctx(ctx, null, null, null, null, CTX_TEST);
408 }
409 
410 void X509V3_set_ctx_nodb()(X509V3_CTX* ctx) { ctx.db = null; }
411 
412 /+ FIXME: Not yet ported.
413 #define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \
414 			0,0,0,0, \
415 			0,0, \
416 			(X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \
417 			(X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \
418 			NULL, NULL, \
419 			table}
420 
421 #define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \
422 			0,0,0,0, \
423 			(X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \
424 			(X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \
425 			0,0,0,0, \
426 			NULL}
427 
428 #define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
429 +/
430 
431 
432 /* X509_PURPOSE stuff */
433 
434 enum EXFLAG_BCONS = 0x1;
435 enum EXFLAG_KUSAGE = 0x2;
436 enum EXFLAG_XKUSAGE = 0x4;
437 enum EXFLAG_NSCERT = 0x8;
438 
439 enum EXFLAG_CA = 0x10;
440 /* Really self issued not necessarily self signed */
441 enum EXFLAG_SI = 0x20;
442 enum EXFLAG_SS = 0x20;
443 enum EXFLAG_V1 = 0x40;
444 enum EXFLAG_INVALID = 0x80;
445 enum EXFLAG_SET = 0x100;
446 enum EXFLAG_CRITICAL = 0x200;
447 enum EXFLAG_PROXY = 0x400;
448 
449 enum EXFLAG_INVALID_POLICY = 0x800;
450 enum EXFLAG_FRESHEST = 0x1000;
451 
452 enum KU_DIGITAL_SIGNATURE = 0x0080;
453 enum KU_NON_REPUDIATION = 0x0040;
454 enum KU_KEY_ENCIPHERMENT = 0x0020;
455 enum KU_DATA_ENCIPHERMENT = 0x0010;
456 enum KU_KEY_AGREEMENT = 0x0008;
457 enum KU_KEY_CERT_SIGN = 0x0004;
458 enum KU_CRL_SIGN = 0x0002;
459 enum KU_ENCIPHER_ONLY = 0x0001;
460 enum KU_DECIPHER_ONLY = 0x8000;
461 
462 enum NS_SSL_CLIENT = 0x80;
463 enum NS_SSL_SERVER = 0x40;
464 enum NS_SMIME = 0x20;
465 enum NS_OBJSIGN = 0x10;
466 enum NS_SSL_CA = 0x04;
467 enum NS_SMIME_CA = 0x02;
468 enum NS_OBJSIGN_CA = 0x01;
469 enum NS_ANY_CA = (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA);
470 
471 enum XKU_SSL_SERVER = 0x1;
472 enum XKU_SSL_CLIENT = 0x2;
473 enum XKU_SMIME = 0x4;
474 enum XKU_CODE_SIGN = 0x8;
475 enum XKU_SGC = 0x10;
476 enum XKU_OCSP_SIGN = 0x20;
477 enum XKU_TIMESTAMP = 0x40;
478 enum XKU_DVCS = 0x80;
479 
480 enum X509_PURPOSE_DYNAMIC = 0x1;
481 enum X509_PURPOSE_DYNAMIC_NAME = 0x2;
482 
483 struct x509_purpose_st {
484 	int purpose;
485 	int trust;		/* Default trust ID */
486 	int flags;
487 	ExternC!(int function(const(x509_purpose_st)*,
488 				const(X509)*, int)) check_purpose;
489 	char* name;
490 	char* sname;
491 	void* usr_data;
492 }
493 alias x509_purpose_st X509_PURPOSE;
494 
495 enum X509_PURPOSE_SSL_CLIENT = 1;
496 enum X509_PURPOSE_SSL_SERVER = 2;
497 enum X509_PURPOSE_NS_SSL_SERVER = 3;
498 enum X509_PURPOSE_SMIME_SIGN = 4;
499 enum X509_PURPOSE_SMIME_ENCRYPT = 5;
500 enum X509_PURPOSE_CRL_SIGN = 6;
501 enum X509_PURPOSE_ANY = 7;
502 enum X509_PURPOSE_OCSP_HELPER = 8;
503 enum X509_PURPOSE_TIMESTAMP_SIGN = 9;
504 
505 enum X509_PURPOSE_MIN = 1;
506 enum X509_PURPOSE_MAX = 9;
507 
508 /* Flags for X509V3_EXT_print() */
509 
510 enum X509V3_EXT_UNKNOWN_MASK = (0xfL << 16);
511 /* Return error for unknown extensions */
512 enum X509V3_EXT_DEFAULT = 0;
513 /* Print error for unknown extensions */
514 enum X509V3_EXT_ERROR_UNKNOWN = (1L << 16);
515 /* ASN1 parse unknown extensions */
516 enum X509V3_EXT_PARSE_UNKNOWN = (2L << 16);
517 /* BIO_dump unknown extensions */
518 enum X509V3_EXT_DUMP_UNKNOWN = (3L << 16);
519 
520 /* Flags for X509V3_add1_i2d */
521 
522 enum X509V3_ADD_OP_MASK = 0xf;
523 enum X509V3_ADD_DEFAULT = 0;
524 enum X509V3_ADD_APPEND = 1;
525 enum X509V3_ADD_REPLACE = 2;
526 enum X509V3_ADD_REPLACE_EXISTING = 3;
527 enum X509V3_ADD_KEEP_EXISTING = 4;
528 enum X509V3_ADD_DELETE = 5;
529 enum X509V3_ADD_SILENT = 0x10;
530 
531 /+mixin DECLARE_STACK_OF!(X509_PURPOSE);+/
532 
533 mixin(DECLARE_ASN1_FUNCTIONS!"BASIC_CONSTRAINTS");
534 
535 mixin(DECLARE_ASN1_FUNCTIONS!"SXNET");
536 mixin(DECLARE_ASN1_FUNCTIONS!"SXNETID");
537 
538 int SXNET_add_id_asc(SXNET** psx, char* zone, char* user, int userlen);
539 int SXNET_add_id_ulong(SXNET** psx, c_ulong lzone, char* user, int userlen);
540 int SXNET_add_id_INTEGER(SXNET** psx, ASN1_INTEGER* izone, char* user, int userlen);
541 
542 ASN1_OCTET_STRING* SXNET_get_id_asc(SXNET* sx, char* zone);
543 ASN1_OCTET_STRING* SXNET_get_id_ulong(SXNET* sx, c_ulong lzone);
544 ASN1_OCTET_STRING* SXNET_get_id_INTEGER(SXNET* sx, ASN1_INTEGER* zone);
545 
546 mixin(DECLARE_ASN1_FUNCTIONS!"AUTHORITY_KEYID");
547 
548 mixin(DECLARE_ASN1_FUNCTIONS!"PKEY_USAGE_PERIOD");
549 
550 mixin(DECLARE_ASN1_FUNCTIONS!"GENERAL_NAME");
551 GENERAL_NAME* GENERAL_NAME_dup(GENERAL_NAME* a);
552 int GENERAL_NAME_cmp(GENERAL_NAME* a, GENERAL_NAME* b);
553 
554 
555 
556 ASN1_BIT_STRING* v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD* method,
557 				X509V3_CTX* ctx, STACK_OF!(CONF_VALUE) *nval);
558 STACK_OF!(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD* method,
559 				ASN1_BIT_STRING* bits,
560 				STACK_OF!(CONF_VALUE) *extlist);
561 
562 STACK_OF!(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD* method, GENERAL_NAME* gen, STACK_OF!(CONF_VALUE) *ret);
563 int GENERAL_NAME_print(BIO* out_, GENERAL_NAME* gen);
564 
565 mixin(DECLARE_ASN1_FUNCTIONS!"GENERAL_NAMES");
566 
567 STACK_OF!(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD* method,
568 		GENERAL_NAMES* gen, STACK_OF!(CONF_VALUE) *extlist);
569 GENERAL_NAMES* v2i_GENERAL_NAMES(const(X509V3_EXT_METHOD)* method,
570 				 X509V3_CTX* ctx, STACK_OF!(CONF_VALUE) *nval);
571 
572 mixin(DECLARE_ASN1_FUNCTIONS!"OTHERNAME");
573 mixin(DECLARE_ASN1_FUNCTIONS!"EDIPARTYNAME");
574 int OTHERNAME_cmp(OTHERNAME* a, OTHERNAME* b);
575 void GENERAL_NAME_set0_value(GENERAL_NAME* a, int type, void* value);
576 void* GENERAL_NAME_get0_value(GENERAL_NAME* a, int* ptype);
577 int GENERAL_NAME_set0_othername(GENERAL_NAME* gen,
578 				ASN1_OBJECT* oid, ASN1_TYPE* value);
579 int GENERAL_NAME_get0_otherName(GENERAL_NAME* gen,
580 				ASN1_OBJECT** poid, ASN1_TYPE** pvalue);
581 
582 char* i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD* method, ASN1_OCTET_STRING* ia5);
583 ASN1_OCTET_STRING* s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD* method, X509V3_CTX* ctx, char* str);
584 
585 mixin(DECLARE_ASN1_FUNCTIONS!"EXTENDED_KEY_USAGE");
586 int i2a_ACCESS_DESCRIPTION(BIO* bp, ACCESS_DESCRIPTION* a);
587 
588 mixin(DECLARE_ASN1_FUNCTIONS!"CERTIFICATEPOLICIES");
589 mixin(DECLARE_ASN1_FUNCTIONS!"POLICYINFO");
590 mixin(DECLARE_ASN1_FUNCTIONS!"POLICYQUALINFO");
591 mixin(DECLARE_ASN1_FUNCTIONS!"USERNOTICE");
592 mixin(DECLARE_ASN1_FUNCTIONS!"NOTICEREF");
593 
594 mixin(DECLARE_ASN1_FUNCTIONS!"CRL_DIST_POINTS");
595 mixin(DECLARE_ASN1_FUNCTIONS!"DIST_POINT");
596 mixin(DECLARE_ASN1_FUNCTIONS!"DIST_POINT_NAME");
597 mixin(DECLARE_ASN1_FUNCTIONS!"ISSUING_DIST_POINT");
598 
599 int DIST_POINT_set_dpname(DIST_POINT_NAME* dpn, X509_NAME* iname);
600 
601 int NAME_CONSTRAINTS_check(X509* x, NAME_CONSTRAINTS* nc);
602 
603 mixin(DECLARE_ASN1_FUNCTIONS!"ACCESS_DESCRIPTION");
604 mixin(DECLARE_ASN1_FUNCTIONS!"AUTHORITY_INFO_ACCESS");
605 
606 mixin(DECLARE_ASN1_ITEM!"POLICY_MAPPING");
607 mixin(DECLARE_ASN1_ALLOC_FUNCTIONS_name!("POLICY_MAPPING", "POLICY_MAPPING"));
608 mixin(DECLARE_ASN1_ITEM!"POLICY_MAPPINGS");
609 
610 mixin(DECLARE_ASN1_ITEM!"GENERAL_SUBTREE");
611 mixin(DECLARE_ASN1_ALLOC_FUNCTIONS_name!("GENERAL_SUBTREE", "GENERAL_SUBTREE"));
612 
613 mixin(DECLARE_ASN1_ITEM!"NAME_CONSTRAINTS");
614 mixin(DECLARE_ASN1_ALLOC_FUNCTIONS_name!("NAME_CONSTRAINTS", "NAME_CONSTRAINTS"));
615 
616 mixin(DECLARE_ASN1_ALLOC_FUNCTIONS_name!("POLICY_CONSTRAINTS", "POLICY_CONSTRAINTS"));
617 mixin(DECLARE_ASN1_ITEM!"POLICY_CONSTRAINTS");
618 
619 GENERAL_NAME* a2i_GENERAL_NAME(GENERAL_NAME* out_,
620 			       const(X509V3_EXT_METHOD)* method, X509V3_CTX* ctx,
621 			       int gen_type, char* value, int is_nc);
622 
623 // #ifdef HEADER_CONF_H
624 GENERAL_NAME* v2i_GENERAL_NAME(const(X509V3_EXT_METHOD)* method, X509V3_CTX* ctx,
625 			       CONF_VALUE* cnf);
626 GENERAL_NAME* v2i_GENERAL_NAME_ex(GENERAL_NAME* out_,
627 				  const(X509V3_EXT_METHOD)* method,
628 				  X509V3_CTX* ctx, CONF_VALUE* cnf, int is_nc);
629 void X509V3_conf_free(CONF_VALUE* val);
630 
631 X509_EXTENSION* X509V3_EXT_nconf_nid(CONF* conf, X509V3_CTX* ctx, int ext_nid, char* value);
632 X509_EXTENSION* X509V3_EXT_nconf(CONF* conf, X509V3_CTX* ctx, char* name, char* value);
633 int X509V3_EXT_add_nconf_sk(CONF* conf, X509V3_CTX* ctx, char* section, STACK_OF!(X509_EXTENSION) **sk);
634 int X509V3_EXT_add_nconf(CONF* conf, X509V3_CTX* ctx, char* section, X509* cert);
635 int X509V3_EXT_REQ_add_nconf(CONF* conf, X509V3_CTX* ctx, char* section, X509_REQ* req);
636 int X509V3_EXT_CRL_add_nconf(CONF* conf, X509V3_CTX* ctx, char* section, X509_CRL* crl);
637 
638 X509_EXTENSION* X509V3_EXT_conf_nid(LHASH_OF!(CONF_VALUE) *conf, X509V3_CTX* ctx,
639 				    int ext_nid, char* value);
640 X509_EXTENSION* X509V3_EXT_conf(LHASH_OF!(CONF_VALUE) *conf, X509V3_CTX* ctx,
641 				char* name, char* value);
642 int X509V3_EXT_add_conf(LHASH_OF!(CONF_VALUE) *conf, X509V3_CTX* ctx,
643 			char* section, X509* cert);
644 int X509V3_EXT_REQ_add_conf(LHASH_OF!(CONF_VALUE) *conf, X509V3_CTX* ctx,
645 			    char* section, X509_REQ* req);
646 int X509V3_EXT_CRL_add_conf(LHASH_OF!(CONF_VALUE) *conf, X509V3_CTX* ctx,
647 			    char* section, X509_CRL* crl);
648 
649 int X509V3_add_value_bool_nf(char* name, int asn1_bool,
650 			     STACK_OF!(CONF_VALUE) **extlist);
651 int X509V3_get_value_bool(CONF_VALUE* value, int* asn1_bool);
652 int X509V3_get_value_int(CONF_VALUE* value, ASN1_INTEGER** aint);
653 void X509V3_set_nconf(X509V3_CTX* ctx, CONF* conf);
654 void X509V3_set_conf_lhash(X509V3_CTX* ctx, LHASH_OF!(CONF_VALUE) *lhash);
655 // #endif
656 
657 char* X509V3_get_string(X509V3_CTX* ctx, char* name, char* section);
658 STACK_OF!(CONF_VALUE) * X509V3_get_section(X509V3_CTX* ctx, char* section);
659 void X509V3_string_free(X509V3_CTX* ctx, char* str);
660 void X509V3_section_free( X509V3_CTX* ctx, STACK_OF!(CONF_VALUE) *section);
661 void X509V3_set_ctx(X509V3_CTX* ctx, X509* issuer, X509* subject,
662 				 X509_REQ* req, X509_CRL* crl, int flags);
663 
664 int X509V3_add_value(const(char)* name, const(char)* value,
665 						STACK_OF!(CONF_VALUE) **extlist);
666 int X509V3_add_value_uchar(const(char)* name, const(ubyte)* value,
667 						STACK_OF!(CONF_VALUE) **extlist);
668 int X509V3_add_value_bool(const(char)* name, int asn1_bool,
669 						STACK_OF!(CONF_VALUE) **extlist);
670 int X509V3_add_value_int(const(char)* name, ASN1_INTEGER* aint,
671 						STACK_OF!(CONF_VALUE) **extlist);
672 char* i2s_ASN1_INTEGER(X509V3_EXT_METHOD* meth, ASN1_INTEGER* aint);
673 ASN1_INTEGER* s2i_ASN1_INTEGER(X509V3_EXT_METHOD* meth, char* value);
674 char* i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD* meth, ASN1_ENUMERATED* aint);
675 char* i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD* meth, ASN1_ENUMERATED* aint);
676 int X509V3_EXT_add(X509V3_EXT_METHOD* ext);
677 int X509V3_EXT_add_list(X509V3_EXT_METHOD* extlist);
678 int X509V3_EXT_add_alias(int nid_to, int nid_from);
679 void X509V3_EXT_cleanup();
680 
681 const(X509V3_EXT_METHOD)* X509V3_EXT_get(X509_EXTENSION* ext);
682 const(X509V3_EXT_METHOD)* X509V3_EXT_get_nid(int nid);
683 int X509V3_add_standard_extensions();
684 STACK_OF!(CONF_VALUE) *X509V3_parse_list(const(char)* line);
685 void* X509V3_EXT_d2i(X509_EXTENSION* ext);
686 void* X509V3_get_d2i(STACK_OF!(X509_EXTENSION) *x, int nid, int* crit, int* idx);
687 
688 
689 X509_EXTENSION* X509V3_EXT_i2d(int ext_nid, int crit, void* ext_struc);
690 int X509V3_add1_i2d(STACK_OF!(X509_EXTENSION) **x, int nid, void* value, int crit, c_ulong flags);
691 
692 char* hex_to_string(const(ubyte)* buffer, c_long len);
693 ubyte* string_to_hex(const(char)* str, c_long* len);
694 int name_cmp(const(char)* name, const(char)* cmp);
695 
696 void X509V3_EXT_val_prn(BIO* out_, STACK_OF!(CONF_VALUE) *val, int indent,
697 								 int ml);
698 int X509V3_EXT_print(BIO* out_, X509_EXTENSION* ext, c_ulong flag, int indent);
699 int X509V3_EXT_print_fp(FILE* out_, X509_EXTENSION* ext, int flag, int indent);
700 
701 int X509V3_extensions_print(BIO* out_, char* title, STACK_OF!(X509_EXTENSION) *exts, c_ulong flag, int indent);
702 
703 int X509_check_ca(X509* x);
704 int X509_check_purpose(X509* x, int id, int ca);
705 int X509_supported_extension(X509_EXTENSION* ex);
706 int X509_PURPOSE_set(int* p, int purpose);
707 int X509_check_issued(X509* issuer, X509* subject);
708 int X509_check_akid(X509* issuer, AUTHORITY_KEYID* akid);
709 int X509_PURPOSE_get_count();
710 X509_PURPOSE* X509_PURPOSE_get0(int idx);
711 int X509_PURPOSE_get_by_sname(char* sname);
712 int X509_PURPOSE_get_by_id(int id);
713 int X509_PURPOSE_add(int id, int trust, int flags,
714 			ExternC!(int function(const(X509_PURPOSE)*, const(X509)*, int)) ck,
715 				char* name, char* sname, void* arg);
716 char* X509_PURPOSE_get0_name(X509_PURPOSE* xp);
717 char* X509_PURPOSE_get0_sname(X509_PURPOSE* xp);
718 int X509_PURPOSE_get_trust(X509_PURPOSE* xp);
719 void X509_PURPOSE_cleanup();
720 int X509_PURPOSE_get_id(X509_PURPOSE*);
721 
722 STACK_OF!(OPENSSL_STRING) *X509_get1_email(X509* x);
723 STACK_OF!(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ* x);
724 void X509_email_free(STACK_OF!(OPENSSL_STRING) *sk);
725 STACK_OF!(OPENSSL_STRING) *X509_get1_ocsp(X509* x);
726 
727 ASN1_OCTET_STRING* a2i_IPADDRESS(const(char)* ipasc);
728 ASN1_OCTET_STRING* a2i_IPADDRESS_NC(const(char)* ipasc);
729 int a2i_ipadd(ubyte* ipout, const(char)* ipasc);
730 int X509V3_NAME_from_section(X509_NAME* nm, STACK_OF!(CONF_VALUE)*dn_sk,
731 						c_ulong chtype);
732 
733 void X509_POLICY_NODE_print(BIO* out_, X509_POLICY_NODE* node, int indent);
734 /+mixin DECLARE_STACK_OF!(X509_POLICY_NODE);+/
735 
736 version(OPENSSL_NO_RFC3779) {} else {
737 struct ASRange_st {
738   ASN1_INTEGER* min, max;
739 }
740 alias ASRange_st ASRange;
741 
742 enum ASIdOrRange_id = 0;
743 enum ASIdOrRange_range = 1;
744 
745 struct ASIdOrRange_st {
746   int type;
747   union u_ {
748     ASN1_INTEGER* id;
749     ASRange* range;
750   }
751   u_ u;
752 }
753 alias ASIdOrRange_st ASIdOrRange;
754 
755 alias STACK_OF!(ASIdOrRange) ASIdOrRanges;
756 /+mixin DECLARE_STACK_OF!(ASIdOrRange);+/
757 
758 enum ASIdentifierChoice_inherit = 0;
759 enum ASIdentifierChoice_asIdsOrRanges = 1;
760 
761 struct ASIdentifierChoice_st {
762   int type;
763   union u_ {
764     ASN1_NULL* inherit;
765     ASIdOrRanges* asIdsOrRanges;
766   }
767   u_ u;
768 }
769 alias ASIdOrRange_st ASIdentifierChoice;
770 
771 struct ASIdentifiers_st {
772   ASIdentifierChoice* asnum, rdi;
773 }
774 alias ASIdentifiers_st ASIdentifiers;
775 
776 mixin(DECLARE_ASN1_FUNCTIONS!"ASRange");
777 mixin(DECLARE_ASN1_FUNCTIONS!"ASIdOrRange");
778 mixin(DECLARE_ASN1_FUNCTIONS!"ASIdentifierChoice");
779 mixin(DECLARE_ASN1_FUNCTIONS!"ASIdentifiers");
780 
781 
782 struct IPAddressRange_st {
783   ASN1_BIT_STRING* min, max;
784 }
785 alias IPAddressRange_st IPAddressRange;
786 
787 enum IPAddressOrRange_addressPrefix = 0;
788 enum IPAddressOrRange_addressRange = 1;
789 
790 struct IPAddressOrRange_st {
791   int type;
792   union u_ {
793     ASN1_BIT_STRING* addressPrefix;
794     IPAddressRange* addressRange;
795   }
796   u_ u;
797 }
798 alias IPAddressOrRange_st IPAddressOrRange;
799 
800 alias STACK_OF!(IPAddressOrRange) IPAddressOrRanges;
801 /+mixin DECLARE_STACK_OF!(IPAddressOrRange);+/
802 
803 enum IPAddressChoice_inherit = 0;
804 enum IPAddressChoice_addressesOrRanges = 1;
805 
806 struct IPAddressChoice_st {
807   int type;
808   union u_ {
809     ASN1_NULL* inherit;
810     IPAddressOrRanges* addressesOrRanges;
811   }
812   u_ u;
813 }
814 alias IPAddressChoice_st IPAddressChoice;
815 
816 struct IPAddressFamily_st {
817   ASN1_OCTET_STRING* addressFamily;
818   IPAddressChoice* ipAddressChoice;
819 }
820 alias IPAddressFamily_st IPAddressFamily;
821 
822 alias STACK_OF!(IPAddressFamily) IPAddrBlocks;
823 /+mixin DECLARE_STACK_OF!(IPAddressFamily);+/
824 
825 mixin(DECLARE_ASN1_FUNCTIONS!"IPAddressRange");
826 mixin(DECLARE_ASN1_FUNCTIONS!"IPAddressOrRange");
827 mixin(DECLARE_ASN1_FUNCTIONS!"IPAddressChoice");
828 mixin(DECLARE_ASN1_FUNCTIONS!"IPAddressFamily");
829 
830 /*
831  * API tag for elements of the ASIdentifer SEQUENCE.
832  */
833 enum V3_ASID_ASNUM = 0;
834 enum V3_ASID_RDI = 1;
835 
836 /*
837  * AFI values, assigned by IANA.  It'd be nice to make the AFI
838  * handling code totally generic, but there are too many little things
839  * that would need to be defined for other address families for it to
840  * be worth the trouble.
841  */
842 enum IANA_AFI_IPV4 = 1;
843 enum IANA_AFI_IPV6 = 2;
844 
845 /*
846  * Utilities to conand extract values from RFC3779 extensions,
847  * since some of the encodings (particularly for IP address prefixes
848  * and ranges) are a bit tedious to work with directly.
849  */
850 int v3_asid_add_inherit(ASIdentifiers* asid, int which);
851 int v3_asid_add_id_or_range(ASIdentifiers* asid, int which,
852 			    ASN1_INTEGER* min, ASN1_INTEGER* max);
853 int v3_addr_add_inherit(IPAddrBlocks* addr,
854 			const uint afi, const(uint)* safi);
855 int v3_addr_add_prefix(IPAddrBlocks* addr,
856 		       const uint afi, const(uint)* safi,
857 		       ubyte* a, const int prefixlen);
858 int v3_addr_add_range(IPAddrBlocks* addr,
859 		      const uint afi, const(uint)* safi,
860 		      ubyte* min, ubyte* max);
861 uint v3_addr_get_afi(const(IPAddressFamily)* f);
862 int v3_addr_get_range(IPAddressOrRange* aor, const uint afi,
863 		      ubyte* min, ubyte* max,
864 		      const int length);
865 
866 /*
867  * Canonical forms.
868  */
869 int v3_asid_is_canonical(ASIdentifiers* asid);
870 int v3_addr_is_canonical(IPAddrBlocks* addr);
871 int v3_asid_canonize(ASIdentifiers* asid);
872 int v3_addr_canonize(IPAddrBlocks* addr);
873 
874 /*
875  * Tests for inheritance and containment.
876  */
877 int v3_asid_inherits(ASIdentifiers* asid);
878 int v3_addr_inherits(IPAddrBlocks* addr);
879 int v3_asid_subset(ASIdentifiers* a, ASIdentifiers* b);
880 int v3_addr_subset(IPAddrBlocks* a, IPAddrBlocks* b);
881 
882 /*
883  * Check whether RFC 3779 extensions nest properly in chains.
884  */
885 int v3_asid_validate_path(X509_STORE_CTX*);
886 int v3_addr_validate_path(X509_STORE_CTX*);
887 int v3_asid_validate_resource_set(STACK_OF!(X509) *chain,
888 				  ASIdentifiers* ext,
889 				  int allow_inheritance);
890 int v3_addr_validate_resource_set(STACK_OF!(X509) *chain,
891 				  IPAddrBlocks* ext,
892 				  int allow_inheritance);
893 
894 } /* OPENSSL_NO_RFC3779 */
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 void ERR_load_X509V3_strings();
901 
902 /* Error codes for the X509V3 functions. */
903 
904 /* Function codes. */
905 enum X509V3_F_A2I_GENERAL_NAME = 164;
906 enum X509V3_F_ASIDENTIFIERCHOICE_CANONIZE = 161;
907 enum X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL = 162;
908 enum X509V3_F_COPY_EMAIL = 122;
909 enum X509V3_F_COPY_ISSUER = 123;
910 enum X509V3_F_DO_DIRNAME = 144;
911 enum X509V3_F_DO_EXT_CONF = 124;
912 enum X509V3_F_DO_EXT_I2D = 135;
913 enum X509V3_F_DO_EXT_NCONF = 151;
914 enum X509V3_F_DO_I2V_NAME_CONSTRAINTS = 148;
915 enum X509V3_F_GNAMES_FROM_SECTNAME = 156;
916 enum X509V3_F_HEX_TO_STRING = 111;
917 enum X509V3_F_I2S_ASN1_ENUMERATED = 121;
918 enum X509V3_F_I2S_ASN1_IA5STRING = 149;
919 enum X509V3_F_I2S_ASN1_INTEGER = 120;
920 enum X509V3_F_I2V_AUTHORITY_INFO_ACCESS = 138;
921 enum X509V3_F_NOTICE_SECTION = 132;
922 enum X509V3_F_NREF_NOS = 133;
923 enum X509V3_F_POLICY_SECTION = 131;
924 enum X509V3_F_PROCESS_PCI_VALUE = 150;
925 enum X509V3_F_R2I_CERTPOL = 130;
926 enum X509V3_F_R2I_PCI = 155;
927 enum X509V3_F_S2I_ASN1_IA5STRING = 100;
928 enum X509V3_F_S2I_ASN1_INTEGER = 108;
929 enum X509V3_F_S2I_ASN1_OCTET_STRING = 112;
930 enum X509V3_F_S2I_ASN1_SKEY_ID = 114;
931 enum X509V3_F_S2I_SKEY_ID = 115;
932 enum X509V3_F_SET_DIST_POINT_NAME = 158;
933 enum X509V3_F_STRING_TO_HEX = 113;
934 enum X509V3_F_SXNET_ADD_ID_ASC = 125;
935 enum X509V3_F_SXNET_ADD_ID_INTEGER = 126;
936 enum X509V3_F_SXNET_ADD_ID_ULONG = 127;
937 enum X509V3_F_SXNET_GET_ID_ASC = 128;
938 enum X509V3_F_SXNET_GET_ID_ULONG = 129;
939 enum X509V3_F_V2I_ASIDENTIFIERS = 163;
940 enum X509V3_F_V2I_ASN1_BIT_STRING = 101;
941 enum X509V3_F_V2I_AUTHORITY_INFO_ACCESS = 139;
942 enum X509V3_F_V2I_AUTHORITY_KEYID = 119;
943 enum X509V3_F_V2I_BASIC_CONSTRAINTS = 102;
944 enum X509V3_F_V2I_CRLD = 134;
945 enum X509V3_F_V2I_EXTENDED_KEY_USAGE = 103;
946 enum X509V3_F_V2I_GENERAL_NAMES = 118;
947 enum X509V3_F_V2I_GENERAL_NAME_EX = 117;
948 enum X509V3_F_V2I_IDP = 157;
949 enum X509V3_F_V2I_IPADDRBLOCKS = 159;
950 enum X509V3_F_V2I_ISSUER_ALT = 153;
951 enum X509V3_F_V2I_NAME_CONSTRAINTS = 147;
952 enum X509V3_F_V2I_POLICY_CONSTRAINTS = 146;
953 enum X509V3_F_V2I_POLICY_MAPPINGS = 145;
954 enum X509V3_F_V2I_SUBJECT_ALT = 154;
955 enum X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL = 160;
956 enum X509V3_F_V3_GENERIC_EXTENSION = 116;
957 enum X509V3_F_X509V3_ADD1_I2D = 140;
958 enum X509V3_F_X509V3_ADD_VALUE = 105;
959 enum X509V3_F_X509V3_EXT_ADD = 104;
960 enum X509V3_F_X509V3_EXT_ADD_ALIAS = 106;
961 enum X509V3_F_X509V3_EXT_CONF = 107;
962 enum X509V3_F_X509V3_EXT_I2D = 136;
963 enum X509V3_F_X509V3_EXT_NCONF = 152;
964 enum X509V3_F_X509V3_GET_SECTION = 142;
965 enum X509V3_F_X509V3_GET_STRING = 143;
966 enum X509V3_F_X509V3_GET_VALUE_BOOL = 110;
967 enum X509V3_F_X509V3_PARSE_LIST = 109;
968 enum X509V3_F_X509_PURPOSE_ADD = 137;
969 enum X509V3_F_X509_PURPOSE_SET = 141;
970 
971 /* Reason codes. */
972 enum X509V3_R_BAD_IP_ADDRESS = 118;
973 enum X509V3_R_BAD_OBJECT = 119;
974 enum X509V3_R_BN_DEC2BN_ERROR = 100;
975 enum X509V3_R_BN_TO_ASN1_INTEGER_ERROR = 101;
976 enum X509V3_R_DIRNAME_ERROR = 149;
977 enum X509V3_R_DISTPOINT_ALREADY_SET = 160;
978 enum X509V3_R_DUPLICATE_ZONE_ID = 133;
979 enum X509V3_R_ERROR_CONVERTING_ZONE = 131;
980 enum X509V3_R_ERROR_CREATING_EXTENSION = 144;
981 enum X509V3_R_ERROR_IN_EXTENSION = 128;
982 enum X509V3_R_EXPECTED_A_SECTION_NAME = 137;
983 enum X509V3_R_EXTENSION_EXISTS = 145;
984 enum X509V3_R_EXTENSION_NAME_ERROR = 115;
985 enum X509V3_R_EXTENSION_NOT_FOUND = 102;
986 enum X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED = 103;
987 enum X509V3_R_EXTENSION_VALUE_ERROR = 116;
988 enum X509V3_R_ILLEGAL_EMPTY_EXTENSION = 151;
989 enum X509V3_R_ILLEGAL_HEX_DIGIT = 113;
990 enum X509V3_R_INCORRECT_POLICY_SYNTAX_TAG = 152;
991 enum X509V3_R_INVALID_MULTIPLE_RDNS = 161;
992 enum X509V3_R_INVALID_ASNUMBER = 162;
993 enum X509V3_R_INVALID_ASRANGE = 163;
994 enum X509V3_R_INVALID_BOOLEAN_STRING = 104;
995 enum X509V3_R_INVALID_EXTENSION_STRING = 105;
996 enum X509V3_R_INVALID_INHERITANCE = 165;
997 enum X509V3_R_INVALID_IPADDRESS = 166;
998 enum X509V3_R_INVALID_NAME = 106;
999 enum X509V3_R_INVALID_NULL_ARGUMENT = 107;
1000 enum X509V3_R_INVALID_NULL_NAME = 108;
1001 enum X509V3_R_INVALID_NULL_VALUE = 109;
1002 enum X509V3_R_INVALID_NUMBER = 140;
1003 enum X509V3_R_INVALID_NUMBERS = 141;
1004 enum X509V3_R_INVALID_OBJECT_IDENTIFIER = 110;
1005 enum X509V3_R_INVALID_OPTION = 138;
1006 enum X509V3_R_INVALID_POLICY_IDENTIFIER = 134;
1007 enum X509V3_R_INVALID_PROXY_POLICY_SETTING = 153;
1008 enum X509V3_R_INVALID_PURPOSE = 146;
1009 enum X509V3_R_INVALID_SAFI = 164;
1010 enum X509V3_R_INVALID_SECTION = 135;
1011 enum X509V3_R_INVALID_SYNTAX = 143;
1012 enum X509V3_R_ISSUER_DECODE_ERROR = 126;
1013 enum X509V3_R_MISSING_VALUE = 124;
1014 enum X509V3_R_NEED_ORGANIZATION_AND_NUMBERS = 142;
1015 enum X509V3_R_NO_CONFIG_DATABASE = 136;
1016 enum X509V3_R_NO_ISSUER_CERTIFICATE = 121;
1017 enum X509V3_R_NO_ISSUER_DETAILS = 127;
1018 enum X509V3_R_NO_POLICY_IDENTIFIER = 139;
1019 enum X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED = 154;
1020 enum X509V3_R_NO_PUBLIC_KEY = 114;
1021 enum X509V3_R_NO_SUBJECT_DETAILS = 125;
1022 enum X509V3_R_ODD_NUMBER_OF_DIGITS = 112;
1023 enum X509V3_R_OPERATION_NOT_DEFINED = 148;
1024 enum X509V3_R_OTHERNAME_ERROR = 147;
1025 enum X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED = 155;
1026 enum X509V3_R_POLICY_PATH_LENGTH = 156;
1027 enum X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED = 157;
1028 enum X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED = 158;
1029 enum X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY = 159;
1030 enum X509V3_R_SECTION_NOT_FOUND = 150;
1031 enum X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS = 122;
1032 enum X509V3_R_UNABLE_TO_GET_ISSUER_KEYID = 123;
1033 enum X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT = 111;
1034 enum X509V3_R_UNKNOWN_EXTENSION = 129;
1035 enum X509V3_R_UNKNOWN_EXTENSION_NAME = 130;
1036 enum X509V3_R_UNKNOWN_OPTION = 120;
1037 enum X509V3_R_UNSUPPORTED_OPTION = 117;
1038 enum X509V3_R_UNSUPPORTED_TYPE = 167;
1039 enum X509V3_R_USER_TOO_LONG = 132;