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