x509v3.h 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008
  1. /*
  2. * Copyright 1999-2018 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. const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x);
  550. int X509_PURPOSE_get_count(void);
  551. X509_PURPOSE *X509_PURPOSE_get0(int idx);
  552. int X509_PURPOSE_get_by_sname(const char *sname);
  553. int X509_PURPOSE_get_by_id(int id);
  554. int X509_PURPOSE_add(int id, int trust, int flags,
  555. int (*ck) (const X509_PURPOSE *, const X509 *, int),
  556. const char *name, const char *sname, void *arg);
  557. char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
  558. char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
  559. int X509_PURPOSE_get_trust(const X509_PURPOSE *xp);
  560. void X509_PURPOSE_cleanup(void);
  561. int X509_PURPOSE_get_id(const X509_PURPOSE *);
  562. STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
  563. STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
  564. void X509_email_free(STACK_OF(OPENSSL_STRING) *sk);
  565. STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);
  566. /* Flags for X509_check_* functions */
  567. /*
  568. * Always check subject name for host match even if subject alt names present
  569. */
  570. # define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1
  571. /* Disable wildcard matching for dnsName fields and common name. */
  572. # define X509_CHECK_FLAG_NO_WILDCARDS 0x2
  573. /* Wildcards must not match a partial label. */
  574. # define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4
  575. /* Allow (non-partial) wildcards to match multiple labels. */
  576. # define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8
  577. /* Constraint verifier subdomain patterns to match a single labels. */
  578. # define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10
  579. /* Never check the subject CN */
  580. # define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20
  581. /*
  582. * Match reference identifiers starting with "." to any sub-domain.
  583. * This is a non-public flag, turned on implicitly when the subject
  584. * reference identity is a DNS name.
  585. */
  586. # define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000
  587. int X509_check_host(X509 *x, const char *chk, size_t chklen,
  588. unsigned int flags, char **peername);
  589. int X509_check_email(X509 *x, const char *chk, size_t chklen,
  590. unsigned int flags);
  591. int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,
  592. unsigned int flags);
  593. int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);
  594. ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);
  595. ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
  596. int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
  597. unsigned long chtype);
  598. void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);
  599. DEFINE_STACK_OF(X509_POLICY_NODE)
  600. #ifndef OPENSSL_NO_RFC3779
  601. typedef struct ASRange_st {
  602. ASN1_INTEGER *min, *max;
  603. } ASRange;
  604. # define ASIdOrRange_id 0
  605. # define ASIdOrRange_range 1
  606. typedef struct ASIdOrRange_st {
  607. int type;
  608. union {
  609. ASN1_INTEGER *id;
  610. ASRange *range;
  611. } u;
  612. } ASIdOrRange;
  613. typedef STACK_OF(ASIdOrRange) ASIdOrRanges;
  614. DEFINE_STACK_OF(ASIdOrRange)
  615. # define ASIdentifierChoice_inherit 0
  616. # define ASIdentifierChoice_asIdsOrRanges 1
  617. typedef struct ASIdentifierChoice_st {
  618. int type;
  619. union {
  620. ASN1_NULL *inherit;
  621. ASIdOrRanges *asIdsOrRanges;
  622. } u;
  623. } ASIdentifierChoice;
  624. typedef struct ASIdentifiers_st {
  625. ASIdentifierChoice *asnum, *rdi;
  626. } ASIdentifiers;
  627. DECLARE_ASN1_FUNCTIONS(ASRange)
  628. DECLARE_ASN1_FUNCTIONS(ASIdOrRange)
  629. DECLARE_ASN1_FUNCTIONS(ASIdentifierChoice)
  630. DECLARE_ASN1_FUNCTIONS(ASIdentifiers)
  631. typedef struct IPAddressRange_st {
  632. ASN1_BIT_STRING *min, *max;
  633. } IPAddressRange;
  634. # define IPAddressOrRange_addressPrefix 0
  635. # define IPAddressOrRange_addressRange 1
  636. typedef struct IPAddressOrRange_st {
  637. int type;
  638. union {
  639. ASN1_BIT_STRING *addressPrefix;
  640. IPAddressRange *addressRange;
  641. } u;
  642. } IPAddressOrRange;
  643. typedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;
  644. DEFINE_STACK_OF(IPAddressOrRange)
  645. # define IPAddressChoice_inherit 0
  646. # define IPAddressChoice_addressesOrRanges 1
  647. typedef struct IPAddressChoice_st {
  648. int type;
  649. union {
  650. ASN1_NULL *inherit;
  651. IPAddressOrRanges *addressesOrRanges;
  652. } u;
  653. } IPAddressChoice;
  654. typedef struct IPAddressFamily_st {
  655. ASN1_OCTET_STRING *addressFamily;
  656. IPAddressChoice *ipAddressChoice;
  657. } IPAddressFamily;
  658. typedef STACK_OF(IPAddressFamily) IPAddrBlocks;
  659. DEFINE_STACK_OF(IPAddressFamily)
  660. DECLARE_ASN1_FUNCTIONS(IPAddressRange)
  661. DECLARE_ASN1_FUNCTIONS(IPAddressOrRange)
  662. DECLARE_ASN1_FUNCTIONS(IPAddressChoice)
  663. DECLARE_ASN1_FUNCTIONS(IPAddressFamily)
  664. /*
  665. * API tag for elements of the ASIdentifer SEQUENCE.
  666. */
  667. # define V3_ASID_ASNUM 0
  668. # define V3_ASID_RDI 1
  669. /*
  670. * AFI values, assigned by IANA. It'd be nice to make the AFI
  671. * handling code totally generic, but there are too many little things
  672. * that would need to be defined for other address families for it to
  673. * be worth the trouble.
  674. */
  675. # define IANA_AFI_IPV4 1
  676. # define IANA_AFI_IPV6 2
  677. /*
  678. * Utilities to construct and extract values from RFC3779 extensions,
  679. * since some of the encodings (particularly for IP address prefixes
  680. * and ranges) are a bit tedious to work with directly.
  681. */
  682. int X509v3_asid_add_inherit(ASIdentifiers *asid, int which);
  683. int X509v3_asid_add_id_or_range(ASIdentifiers *asid, int which,
  684. ASN1_INTEGER *min, ASN1_INTEGER *max);
  685. int X509v3_addr_add_inherit(IPAddrBlocks *addr,
  686. const unsigned afi, const unsigned *safi);
  687. int X509v3_addr_add_prefix(IPAddrBlocks *addr,
  688. const unsigned afi, const unsigned *safi,
  689. unsigned char *a, const int prefixlen);
  690. int X509v3_addr_add_range(IPAddrBlocks *addr,
  691. const unsigned afi, const unsigned *safi,
  692. unsigned char *min, unsigned char *max);
  693. unsigned X509v3_addr_get_afi(const IPAddressFamily *f);
  694. int X509v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,
  695. unsigned char *min, unsigned char *max,
  696. const int length);
  697. /*
  698. * Canonical forms.
  699. */
  700. int X509v3_asid_is_canonical(ASIdentifiers *asid);
  701. int X509v3_addr_is_canonical(IPAddrBlocks *addr);
  702. int X509v3_asid_canonize(ASIdentifiers *asid);
  703. int X509v3_addr_canonize(IPAddrBlocks *addr);
  704. /*
  705. * Tests for inheritance and containment.
  706. */
  707. int X509v3_asid_inherits(ASIdentifiers *asid);
  708. int X509v3_addr_inherits(IPAddrBlocks *addr);
  709. int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b);
  710. int X509v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);
  711. /*
  712. * Check whether RFC 3779 extensions nest properly in chains.
  713. */
  714. int X509v3_asid_validate_path(X509_STORE_CTX *);
  715. int X509v3_addr_validate_path(X509_STORE_CTX *);
  716. int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain,
  717. ASIdentifiers *ext,
  718. int allow_inheritance);
  719. int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain,
  720. IPAddrBlocks *ext, int allow_inheritance);
  721. #endif /* OPENSSL_NO_RFC3779 */
  722. /* BEGIN ERROR CODES */
  723. /*
  724. * The following lines are auto generated by the script mkerr.pl. Any changes
  725. * made after this point may be overwritten when the script is next run.
  726. */
  727. int ERR_load_X509V3_strings(void);
  728. /* Error codes for the X509V3 functions. */
  729. /* Function codes. */
  730. # define X509V3_F_A2I_GENERAL_NAME 164
  731. # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166
  732. # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161
  733. # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162
  734. # define X509V3_F_BIGNUM_TO_STRING 167
  735. # define X509V3_F_COPY_EMAIL 122
  736. # define X509V3_F_COPY_ISSUER 123
  737. # define X509V3_F_DO_DIRNAME 144
  738. # define X509V3_F_DO_EXT_I2D 135
  739. # define X509V3_F_DO_EXT_NCONF 151
  740. # define X509V3_F_GNAMES_FROM_SECTNAME 156
  741. # define X509V3_F_I2S_ASN1_ENUMERATED 121
  742. # define X509V3_F_I2S_ASN1_IA5STRING 149
  743. # define X509V3_F_I2S_ASN1_INTEGER 120
  744. # define X509V3_F_I2V_AUTHORITY_INFO_ACCESS 138
  745. # define X509V3_F_NOTICE_SECTION 132
  746. # define X509V3_F_NREF_NOS 133
  747. # define X509V3_F_POLICY_SECTION 131
  748. # define X509V3_F_PROCESS_PCI_VALUE 150
  749. # define X509V3_F_R2I_CERTPOL 130
  750. # define X509V3_F_R2I_PCI 155
  751. # define X509V3_F_S2I_ASN1_IA5STRING 100
  752. # define X509V3_F_S2I_ASN1_INTEGER 108
  753. # define X509V3_F_S2I_ASN1_OCTET_STRING 112
  754. # define X509V3_F_S2I_SKEY_ID 115
  755. # define X509V3_F_SET_DIST_POINT_NAME 158
  756. # define X509V3_F_SXNET_ADD_ID_ASC 125
  757. # define X509V3_F_SXNET_ADD_ID_INTEGER 126
  758. # define X509V3_F_SXNET_ADD_ID_ULONG 127
  759. # define X509V3_F_SXNET_GET_ID_ASC 128
  760. # define X509V3_F_SXNET_GET_ID_ULONG 129
  761. # define X509V3_F_V2I_ASIDENTIFIERS 163
  762. # define X509V3_F_V2I_ASN1_BIT_STRING 101
  763. # define X509V3_F_V2I_AUTHORITY_INFO_ACCESS 139
  764. # define X509V3_F_V2I_AUTHORITY_KEYID 119
  765. # define X509V3_F_V2I_BASIC_CONSTRAINTS 102
  766. # define X509V3_F_V2I_CRLD 134
  767. # define X509V3_F_V2I_EXTENDED_KEY_USAGE 103
  768. # define X509V3_F_V2I_GENERAL_NAMES 118
  769. # define X509V3_F_V2I_GENERAL_NAME_EX 117
  770. # define X509V3_F_V2I_IDP 157
  771. # define X509V3_F_V2I_IPADDRBLOCKS 159
  772. # define X509V3_F_V2I_ISSUER_ALT 153
  773. # define X509V3_F_V2I_NAME_CONSTRAINTS 147
  774. # define X509V3_F_V2I_POLICY_CONSTRAINTS 146
  775. # define X509V3_F_V2I_POLICY_MAPPINGS 145
  776. # define X509V3_F_V2I_SUBJECT_ALT 154
  777. # define X509V3_F_V2I_TLS_FEATURE 165
  778. # define X509V3_F_V3_GENERIC_EXTENSION 116
  779. # define X509V3_F_X509V3_ADD1_I2D 140
  780. # define X509V3_F_X509V3_ADD_VALUE 105
  781. # define X509V3_F_X509V3_EXT_ADD 104
  782. # define X509V3_F_X509V3_EXT_ADD_ALIAS 106
  783. # define X509V3_F_X509V3_EXT_I2D 136
  784. # define X509V3_F_X509V3_EXT_NCONF 152
  785. # define X509V3_F_X509V3_GET_SECTION 142
  786. # define X509V3_F_X509V3_GET_STRING 143
  787. # define X509V3_F_X509V3_GET_VALUE_BOOL 110
  788. # define X509V3_F_X509V3_PARSE_LIST 109
  789. # define X509V3_F_X509_PURPOSE_ADD 137
  790. # define X509V3_F_X509_PURPOSE_SET 141
  791. /* Reason codes. */
  792. # define X509V3_R_BAD_IP_ADDRESS 118
  793. # define X509V3_R_BAD_OBJECT 119
  794. # define X509V3_R_BN_DEC2BN_ERROR 100
  795. # define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 101
  796. # define X509V3_R_DIRNAME_ERROR 149
  797. # define X509V3_R_DISTPOINT_ALREADY_SET 160
  798. # define X509V3_R_DUPLICATE_ZONE_ID 133
  799. # define X509V3_R_ERROR_CONVERTING_ZONE 131
  800. # define X509V3_R_ERROR_CREATING_EXTENSION 144
  801. # define X509V3_R_ERROR_IN_EXTENSION 128
  802. # define X509V3_R_EXPECTED_A_SECTION_NAME 137
  803. # define X509V3_R_EXTENSION_EXISTS 145
  804. # define X509V3_R_EXTENSION_NAME_ERROR 115
  805. # define X509V3_R_EXTENSION_NOT_FOUND 102
  806. # define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 103
  807. # define X509V3_R_EXTENSION_VALUE_ERROR 116
  808. # define X509V3_R_ILLEGAL_EMPTY_EXTENSION 151
  809. # define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 152
  810. # define X509V3_R_INVALID_ASNUMBER 162
  811. # define X509V3_R_INVALID_ASRANGE 163
  812. # define X509V3_R_INVALID_BOOLEAN_STRING 104
  813. # define X509V3_R_INVALID_EXTENSION_STRING 105
  814. # define X509V3_R_INVALID_INHERITANCE 165
  815. # define X509V3_R_INVALID_IPADDRESS 166
  816. # define X509V3_R_INVALID_MULTIPLE_RDNS 161
  817. # define X509V3_R_INVALID_NAME 106
  818. # define X509V3_R_INVALID_NULL_ARGUMENT 107
  819. # define X509V3_R_INVALID_NULL_NAME 108
  820. # define X509V3_R_INVALID_NULL_VALUE 109
  821. # define X509V3_R_INVALID_NUMBER 140
  822. # define X509V3_R_INVALID_NUMBERS 141
  823. # define X509V3_R_INVALID_OBJECT_IDENTIFIER 110
  824. # define X509V3_R_INVALID_OPTION 138
  825. # define X509V3_R_INVALID_POLICY_IDENTIFIER 134
  826. # define X509V3_R_INVALID_PROXY_POLICY_SETTING 153
  827. # define X509V3_R_INVALID_PURPOSE 146
  828. # define X509V3_R_INVALID_SAFI 164
  829. # define X509V3_R_INVALID_SECTION 135
  830. # define X509V3_R_INVALID_SYNTAX 143
  831. # define X509V3_R_ISSUER_DECODE_ERROR 126
  832. # define X509V3_R_MISSING_VALUE 124
  833. # define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 142
  834. # define X509V3_R_NO_CONFIG_DATABASE 136
  835. # define X509V3_R_NO_ISSUER_CERTIFICATE 121
  836. # define X509V3_R_NO_ISSUER_DETAILS 127
  837. # define X509V3_R_NO_POLICY_IDENTIFIER 139
  838. # define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 154
  839. # define X509V3_R_NO_PUBLIC_KEY 114
  840. # define X509V3_R_NO_SUBJECT_DETAILS 125
  841. # define X509V3_R_OPERATION_NOT_DEFINED 148
  842. # define X509V3_R_OTHERNAME_ERROR 147
  843. # define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 155
  844. # define X509V3_R_POLICY_PATH_LENGTH 156
  845. # define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 157
  846. # define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159
  847. # define X509V3_R_SECTION_NOT_FOUND 150
  848. # define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 122
  849. # define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 123
  850. # define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 111
  851. # define X509V3_R_UNKNOWN_EXTENSION 129
  852. # define X509V3_R_UNKNOWN_EXTENSION_NAME 130
  853. # define X509V3_R_UNKNOWN_OPTION 120
  854. # define X509V3_R_UNSUPPORTED_OPTION 117
  855. # define X509V3_R_UNSUPPORTED_TYPE 167
  856. # define X509V3_R_USER_TOO_LONG 132
  857. # ifdef __cplusplus
  858. }
  859. # endif
  860. #endif