x509v3.h 37 KB

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