x509v3.h 39 KB

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