x509v3.h 38 KB

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