1 use libc::*;
2 
3 use *;
4 
5 pub enum CONF_METHOD {}
6 
7 pub const GEN_OTHERNAME: c_int = 0;
8 pub const GEN_EMAIL: c_int = 1;
9 pub const GEN_DNS: c_int = 2;
10 pub const GEN_X400: c_int = 3;
11 pub const GEN_DIRNAME: c_int = 4;
12 pub const GEN_EDIPARTY: c_int = 5;
13 pub const GEN_URI: c_int = 6;
14 pub const GEN_IPADD: c_int = 7;
15 pub const GEN_RID: c_int = 8;
16 
17 #[repr(C)]
18 pub struct GENERAL_NAME {
19     pub type_: c_int,
20     // FIXME should be a union
21     pub d: *mut c_void,
22 }
23 
24 stack!(stack_st_GENERAL_NAME);
25 
26 extern "C" {
GENERAL_NAME_free(name: *mut GENERAL_NAME)27     pub fn GENERAL_NAME_free(name: *mut GENERAL_NAME);
28 }
29 
30 #[cfg(any(ossl102, libressl261))]
31 pub const X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT: c_uint = 0x1;
32 #[cfg(any(ossl102, libressl261))]
33 pub const X509_CHECK_FLAG_NO_WILDCARDS: c_uint = 0x2;
34 #[cfg(any(ossl102, libressl261))]
35 pub const X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS: c_uint = 0x4;
36 #[cfg(any(ossl102, libressl261))]
37 pub const X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS: c_uint = 0x8;
38 #[cfg(any(ossl102, libressl261))]
39 pub const X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS: c_uint = 0x10;
40 #[cfg(ossl110)]
41 pub const X509_CHECK_FLAG_NEVER_CHECK_SUBJECT: c_uint = 0x20;
42 
43 cfg_if! {
44     if #[cfg(any(ossl110, libressl280))] {
45         extern "C" {
46             pub fn X509V3_EXT_nconf_nid(
47                 conf: *mut CONF,
48                 ctx: *mut X509V3_CTX,
49                 ext_nid: c_int,
50                 value: *const c_char,
51             ) -> *mut X509_EXTENSION;
52             pub fn X509V3_EXT_nconf(
53                 conf: *mut CONF,
54                 ctx: *mut X509V3_CTX,
55                 name: *const c_char,
56                 value: *const c_char,
57             ) -> *mut X509_EXTENSION;
58         }
59     } else {
60         extern "C" {
61             pub fn X509V3_EXT_nconf_nid(
62                 conf: *mut CONF,
63                 ctx: *mut X509V3_CTX,
64                 ext_nid: c_int,
65                 value: *mut c_char,
66             ) -> *mut X509_EXTENSION;
67             pub fn X509V3_EXT_nconf(
68                 conf: *mut CONF,
69                 ctx: *mut X509V3_CTX,
70                 name: *mut c_char,
71                 value: *mut c_char,
72             ) -> *mut X509_EXTENSION;
73         }
74     }
75 }
76 
77 extern "C" {
X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int78     pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int;
X509_verify(req: *mut X509, pkey: *mut EVP_PKEY) -> c_int79     pub fn X509_verify(req: *mut X509, pkey: *mut EVP_PKEY) -> c_int;
80 
X509V3_set_nconf(ctx: *mut X509V3_CTX, conf: *mut CONF)81     pub fn X509V3_set_nconf(ctx: *mut X509V3_CTX, conf: *mut CONF);
82 
X509V3_set_ctx( ctx: *mut X509V3_CTX, issuer: *mut X509, subject: *mut X509, req: *mut X509_REQ, crl: *mut X509_CRL, flags: c_int, )83     pub fn X509V3_set_ctx(
84         ctx: *mut X509V3_CTX,
85         issuer: *mut X509,
86         subject: *mut X509,
87         req: *mut X509_REQ,
88         crl: *mut X509_CRL,
89         flags: c_int,
90     );
91 
X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING92     pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING;
93 }
94