1 use libc::*;
2 
3 use *;
4 
5 pub const OCSP_REVOKED_STATUS_NOSTATUS: c_int = -1;
6 pub const OCSP_REVOKED_STATUS_UNSPECIFIED: c_int = 0;
7 pub const OCSP_REVOKED_STATUS_KEYCOMPROMISE: c_int = 1;
8 pub const OCSP_REVOKED_STATUS_CACOMPROMISE: c_int = 2;
9 pub const OCSP_REVOKED_STATUS_AFFILIATIONCHANGED: c_int = 3;
10 pub const OCSP_REVOKED_STATUS_SUPERSEDED: c_int = 4;
11 pub const OCSP_REVOKED_STATUS_CESSATIONOFOPERATION: c_int = 5;
12 pub const OCSP_REVOKED_STATUS_CERTIFICATEHOLD: c_int = 6;
13 pub const OCSP_REVOKED_STATUS_REMOVEFROMCRL: c_int = 8;
14 
15 pub const OCSP_NOCERTS: c_ulong = 0x1;
16 pub const OCSP_NOINTERN: c_ulong = 0x2;
17 pub const OCSP_NOSIGS: c_ulong = 0x4;
18 pub const OCSP_NOCHAIN: c_ulong = 0x8;
19 pub const OCSP_NOVERIFY: c_ulong = 0x10;
20 pub const OCSP_NOEXPLICIT: c_ulong = 0x20;
21 pub const OCSP_NOCASIGN: c_ulong = 0x40;
22 pub const OCSP_NODELEGATED: c_ulong = 0x80;
23 pub const OCSP_NOCHECKS: c_ulong = 0x100;
24 pub const OCSP_TRUSTOTHER: c_ulong = 0x200;
25 pub const OCSP_RESPID_KEY: c_ulong = 0x400;
26 pub const OCSP_NOTIME: c_ulong = 0x800;
27 
28 pub enum OCSP_CERTID {}
29 
30 pub enum OCSP_ONEREQ {}
31 
32 pub enum OCSP_REQUEST {}
33 
34 pub const OCSP_RESPONSE_STATUS_SUCCESSFUL: c_int = 0;
35 pub const OCSP_RESPONSE_STATUS_MALFORMEDREQUEST: c_int = 1;
36 pub const OCSP_RESPONSE_STATUS_INTERNALERROR: c_int = 2;
37 pub const OCSP_RESPONSE_STATUS_TRYLATER: c_int = 3;
38 pub const OCSP_RESPONSE_STATUS_SIGREQUIRED: c_int = 5;
39 pub const OCSP_RESPONSE_STATUS_UNAUTHORIZED: c_int = 6;
40 
41 pub const V_OCSP_CERTSTATUS_GOOD: c_int = 0;
42 pub const V_OCSP_CERTSTATUS_REVOKED: c_int = 1;
43 pub const V_OCSP_CERTSTATUS_UNKNOWN: c_int = 2;
44 
45 pub enum OCSP_BASICRESP {}
46 
47 cfg_if! {
48     if #[cfg(any(ossl110, libressl281))] {
49         extern "C" {
50             pub fn OCSP_cert_to_id(
51                 dgst: *const EVP_MD,
52                 subject: *const X509,
53                 issuer: *const X509,
54             ) -> *mut OCSP_CERTID;
55         }
56     } else {
57         extern "C" {
58             pub fn OCSP_cert_to_id(
59                 dgst: *const EVP_MD,
60                 subject: *mut X509,
61                 issuer: *mut X509,
62             ) -> *mut ::OCSP_CERTID;
63         }
64     }
65 }
66 
67 extern "C" {
OCSP_request_add0_id(r: *mut OCSP_REQUEST, id: *mut OCSP_CERTID) -> *mut OCSP_ONEREQ68     pub fn OCSP_request_add0_id(r: *mut OCSP_REQUEST, id: *mut OCSP_CERTID) -> *mut OCSP_ONEREQ;
69 
OCSP_resp_find_status( bs: *mut OCSP_BASICRESP, id: *mut OCSP_CERTID, status: *mut c_int, reason: *mut c_int, revtime: *mut *mut ASN1_GENERALIZEDTIME, thisupd: *mut *mut ASN1_GENERALIZEDTIME, nextupd: *mut *mut ASN1_GENERALIZEDTIME, ) -> c_int70     pub fn OCSP_resp_find_status(
71         bs: *mut OCSP_BASICRESP,
72         id: *mut OCSP_CERTID,
73         status: *mut c_int,
74         reason: *mut c_int,
75         revtime: *mut *mut ASN1_GENERALIZEDTIME,
76         thisupd: *mut *mut ASN1_GENERALIZEDTIME,
77         nextupd: *mut *mut ASN1_GENERALIZEDTIME,
78     ) -> c_int;
OCSP_check_validity( thisupd: *mut ASN1_GENERALIZEDTIME, nextupd: *mut ASN1_GENERALIZEDTIME, sec: c_long, maxsec: c_long, ) -> c_int79     pub fn OCSP_check_validity(
80         thisupd: *mut ASN1_GENERALIZEDTIME,
81         nextupd: *mut ASN1_GENERALIZEDTIME,
82         sec: c_long,
83         maxsec: c_long,
84     ) -> c_int;
85 
OCSP_response_status(resp: *mut OCSP_RESPONSE) -> c_int86     pub fn OCSP_response_status(resp: *mut OCSP_RESPONSE) -> c_int;
OCSP_response_get1_basic(resp: *mut OCSP_RESPONSE) -> *mut OCSP_BASICRESP87     pub fn OCSP_response_get1_basic(resp: *mut OCSP_RESPONSE) -> *mut OCSP_BASICRESP;
88 
OCSP_response_create(status: c_int, bs: *mut OCSP_BASICRESP) -> *mut OCSP_RESPONSE89     pub fn OCSP_response_create(status: c_int, bs: *mut OCSP_BASICRESP) -> *mut OCSP_RESPONSE;
90 
OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP91     pub fn OCSP_BASICRESP_new() -> *mut OCSP_BASICRESP;
OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP)92     pub fn OCSP_BASICRESP_free(r: *mut OCSP_BASICRESP);
OCSP_RESPONSE_new() -> *mut OCSP_RESPONSE93     pub fn OCSP_RESPONSE_new() -> *mut OCSP_RESPONSE;
OCSP_RESPONSE_free(r: *mut OCSP_RESPONSE)94     pub fn OCSP_RESPONSE_free(r: *mut OCSP_RESPONSE);
i2d_OCSP_RESPONSE(a: *mut OCSP_RESPONSE, pp: *mut *mut c_uchar) -> c_int95     pub fn i2d_OCSP_RESPONSE(a: *mut OCSP_RESPONSE, pp: *mut *mut c_uchar) -> c_int;
d2i_OCSP_RESPONSE( a: *mut *mut OCSP_RESPONSE, pp: *mut *const c_uchar, length: c_long, ) -> *mut OCSP_RESPONSE96     pub fn d2i_OCSP_RESPONSE(
97         a: *mut *mut OCSP_RESPONSE,
98         pp: *mut *const c_uchar,
99         length: c_long,
100     ) -> *mut OCSP_RESPONSE;
OCSP_ONEREQ_free(r: *mut OCSP_ONEREQ)101     pub fn OCSP_ONEREQ_free(r: *mut OCSP_ONEREQ);
OCSP_CERTID_free(id: *mut OCSP_CERTID)102     pub fn OCSP_CERTID_free(id: *mut OCSP_CERTID);
OCSP_REQUEST_new() -> *mut OCSP_REQUEST103     pub fn OCSP_REQUEST_new() -> *mut OCSP_REQUEST;
OCSP_REQUEST_free(r: *mut OCSP_REQUEST)104     pub fn OCSP_REQUEST_free(r: *mut OCSP_REQUEST);
i2d_OCSP_REQUEST(a: *mut OCSP_REQUEST, pp: *mut *mut c_uchar) -> c_int105     pub fn i2d_OCSP_REQUEST(a: *mut OCSP_REQUEST, pp: *mut *mut c_uchar) -> c_int;
d2i_OCSP_REQUEST( a: *mut *mut OCSP_REQUEST, pp: *mut *const c_uchar, length: c_long, ) -> *mut OCSP_REQUEST106     pub fn d2i_OCSP_REQUEST(
107         a: *mut *mut OCSP_REQUEST,
108         pp: *mut *const c_uchar,
109         length: c_long,
110     ) -> *mut OCSP_REQUEST;
111 
OCSP_basic_verify( bs: *mut OCSP_BASICRESP, certs: *mut stack_st_X509, st: *mut X509_STORE, flags: c_ulong, ) -> c_int112     pub fn OCSP_basic_verify(
113         bs: *mut OCSP_BASICRESP,
114         certs: *mut stack_st_X509,
115         st: *mut X509_STORE,
116         flags: c_ulong,
117     ) -> c_int;
118 }
119