x509v3.h 32 KB

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