1use libc::*;
2
3use super::*;
4
5#[repr(C)]
6pub struct GENERAL_NAME {
7 pub type_: c_int,
8 // FIXME should be a union
9 pub d: *mut c_void,
10}
11
12stack!(stack_st_GENERAL_NAME);
13
14pub const GEN_OTHERNAME: c_int = 0;
15pub const GEN_EMAIL: c_int = 1;
16pub const GEN_DNS: c_int = 2;
17pub const GEN_X400: c_int = 3;
18pub const GEN_DIRNAME: c_int = 4;
19pub const GEN_EDIPARTY: c_int = 5;
20pub const GEN_URI: c_int = 6;
21pub const GEN_IPADD: c_int = 7;
22pub const GEN_RID: c_int = 8;
23
24#[cfg(any(ossl102, libressl261))]
25pub const X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT: c_uint = 0x1;
26#[cfg(any(ossl102, libressl261))]
27pub const X509_CHECK_FLAG_NO_WILDCARDS: c_uint = 0x2;
28#[cfg(any(ossl102, libressl261))]
29pub const X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS: c_uint = 0x4;
30#[cfg(any(ossl102, libressl261))]
31pub const X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS: c_uint = 0x8;
32#[cfg(any(ossl102, libressl261))]
33pub const X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS: c_uint = 0x10;
34#[cfg(ossl110)]
35pub const X509_CHECK_FLAG_NEVER_CHECK_SUBJECT: c_uint = 0x20;
36
37pub const X509V3_ADD_DEFAULT: c_ulong = 0;
38pub const X509V3_ADD_APPEND: c_ulong = 1;
39pub const X509V3_ADD_REPLACE: c_ulong = 2;
40pub const X509V3_ADD_REPLACE_EXISTING: c_ulong = 3;
41pub const X509V3_ADD_KEEP_EXISTING: c_ulong = 4;
42pub const X509V3_ADD_DELETE: c_ulong = 5;
43pub const X509V3_ADD_SILENT: c_ulong = 0x10;
44
45pub const EXFLAG_BCONS: u32 = 0x1;
46pub const EXFLAG_KUSAGE: u32 = 0x2;
47pub const EXFLAG_XKUSAGE: u32 = 0x4;
48pub const EXFLAG_NSCERT: u32 = 0x8;
49pub const EXFLAG_CA: u32 = 0x10;
50pub const EXFLAG_SI: u32 = 0x20;
51pub const EXFLAG_V1: u32 = 0x40;
52pub const EXFLAG_INVALID: u32 = 0x80;
53pub const EXFLAG_SET: u32 = 0x100;
54pub const EXFLAG_CRITICAL: u32 = 0x200;
55pub const EXFLAG_PROXY: u32 = 0x400;
56pub const EXFLAG_INVALID_POLICY: u32 = 0x800;
57pub const EXFLAG_FRESHEST: u32 = 0x1000;
58#[cfg(any(ossl102, libressl261))]
59pub const EXFLAG_SS: u32 = 0x2000;
60
61pub const X509v3_KU_DIGITAL_SIGNATURE: u32 = 0x0080;
62pub const X509v3_KU_NON_REPUDIATION: u32 = 0x0040;
63pub const X509v3_KU_KEY_ENCIPHERMENT: u32 = 0x0020;
64pub const X509v3_KU_DATA_ENCIPHERMENT: u32 = 0x0010;
65pub const X509v3_KU_KEY_AGREEMENT: u32 = 0x0008;
66pub const X509v3_KU_KEY_CERT_SIGN: u32 = 0x0004;
67pub const X509v3_KU_CRL_SIGN: u32 = 0x0002;
68pub const X509v3_KU_ENCIPHER_ONLY: u32 = 0x0001;
69pub const X509v3_KU_DECIPHER_ONLY: u32 = 0x8000;
70pub const X509v3_KU_UNDEF: u32 = 0xffff;
71
72pub const XKU_SSL_SERVER: u32 = 0x1;
73pub const XKU_SSL_CLIENT: u32 = 0x2;
74pub const XKU_SMIME: u32 = 0x4;
75pub const XKU_CODE_SIGN: u32 = 0x8;
76pub const XKU_SGC: u32 = 0x10;
77pub const XKU_OCSP_SIGN: u32 = 0x20;
78pub const XKU_TIMESTAMP: u32 = 0x40;
79pub const XKU_DVCS: u32 = 0x80;
80#[cfg(ossl110)]
81pub const XKU_ANYEKU: u32 = 0x100;
82
83pub const X509_PURPOSE_SSL_CLIENT: c_int = 1;
84pub const X509_PURPOSE_SSL_SERVER: c_int = 2;
85pub const X509_PURPOSE_NS_SSL_SERVER: c_int = 3;
86pub const X509_PURPOSE_SMIME_SIGN: c_int = 4;
87pub const X509_PURPOSE_SMIME_ENCRYPT: c_int = 5;
88pub const X509_PURPOSE_CRL_SIGN: c_int = 6;
89pub const X509_PURPOSE_ANY: c_int = 7;
90pub const X509_PURPOSE_OCSP_HELPER: c_int = 8;
91pub const X509_PURPOSE_TIMESTAMP_SIGN: c_int = 9;
92#[cfg(ossl320)]
93pub const X509_PURPOSE_CODE_SIGN: c_int = 10;
94pub const X509_PURPOSE_MIN: c_int = 1;
95cfg_if! {
96 if #[cfg(ossl320)] {
97 pub const X509_PURPOSE_MAX: c_int = 10;
98 } else {
99 pub const X509_PURPOSE_MAX: c_int = 9;
100 }
101}
102
103pub const CRL_REASON_UNSPECIFIED: c_int = 0;
104pub const CRL_REASON_KEY_COMPROMISE: c_int = 1;
105pub const CRL_REASON_CA_COMPROMISE: c_int = 2;
106pub const CRL_REASON_AFFILIATION_CHANGED: c_int = 3;
107pub const CRL_REASON_SUPERSEDED: c_int = 4;
108pub const CRL_REASON_CESSATION_OF_OPERATION: c_int = 5;
109pub const CRL_REASON_CERTIFICATE_HOLD: c_int = 6;
110pub const CRL_REASON_REMOVE_FROM_CRL: c_int = 8;
111pub const CRL_REASON_PRIVILEGE_WITHDRAWN: c_int = 9;
112pub const CRL_REASON_AA_COMPROMISE: c_int = 10;
113