1 | use super::super::*; |
2 | use libc::*; |
3 | |
4 | pub enum CONF_METHOD {} |
5 | |
6 | extern "C" { |
7 | pub fn GENERAL_NAME_new() -> *mut GENERAL_NAME; |
8 | pub fn GENERAL_NAME_free(name: *mut GENERAL_NAME); |
9 | pub fn GENERAL_NAME_set0_othername( |
10 | gen: *mut GENERAL_NAME, |
11 | oid: *mut ASN1_OBJECT, |
12 | value: *mut ASN1_TYPE, |
13 | ) -> c_int; |
14 | } |
15 | |
16 | #[repr (C)] |
17 | pub struct ACCESS_DESCRIPTION { |
18 | pub method: *mut ASN1_OBJECT, |
19 | pub location: *mut GENERAL_NAME, |
20 | } |
21 | |
22 | stack!(stack_st_ACCESS_DESCRIPTION); |
23 | |
24 | extern "C" { |
25 | pub fn ACCESS_DESCRIPTION_free(ad: *mut ACCESS_DESCRIPTION); |
26 | } |
27 | |
28 | #[repr (C)] |
29 | pub struct AUTHORITY_KEYID { |
30 | pub keyid: *mut ASN1_OCTET_STRING, |
31 | pub issuer: *mut stack_st_GENERAL_NAME, |
32 | pub serial: *mut ASN1_INTEGER, |
33 | } |
34 | |
35 | extern "C" { |
36 | pub fn AUTHORITY_KEYID_free(akid: *mut AUTHORITY_KEYID); |
37 | } |
38 | |
39 | const_ptr_api! { |
40 | extern "C" { |
41 | pub fn X509V3_EXT_nconf_nid( |
42 | conf: *mut CONF, |
43 | ctx: *mut X509V3_CTX, |
44 | ext_nid: c_int, |
45 | value: #[const_ptr_if(any(ossl110, libressl280))] c_char, |
46 | ) -> *mut X509_EXTENSION; |
47 | pub fn X509V3_EXT_nconf( |
48 | conf: *mut CONF, |
49 | ctx: *mut X509V3_CTX, |
50 | name: #[const_ptr_if(any(ossl110, libressl280))] c_char, |
51 | value: #[const_ptr_if(any(ossl110, libressl280))] c_char, |
52 | ) -> *mut X509_EXTENSION; |
53 | } |
54 | } |
55 | |
56 | extern "C" { |
57 | pub fn X509_check_issued(issuer: *mut X509, subject: *mut X509) -> c_int; |
58 | pub fn X509_verify(req: *mut X509, pkey: *mut EVP_PKEY) -> c_int; |
59 | |
60 | pub fn X509V3_set_nconf(ctx: *mut X509V3_CTX, conf: *mut CONF); |
61 | |
62 | pub fn X509V3_set_ctx( |
63 | ctx: *mut X509V3_CTX, |
64 | issuer: *mut X509, |
65 | subject: *mut X509, |
66 | req: *mut X509_REQ, |
67 | crl: *mut X509_CRL, |
68 | flags: c_int, |
69 | ); |
70 | |
71 | pub fn X509_get1_ocsp(x: *mut X509) -> *mut stack_st_OPENSSL_STRING; |
72 | } |
73 | |
74 | const_ptr_api! { |
75 | extern "C" { |
76 | pub fn X509V3_get_d2i( |
77 | x: #[const_ptr_if(any(ossl110, libressl280))] stack_st_X509_EXTENSION, |
78 | nid: c_int, |
79 | crit: *mut c_int, |
80 | idx: *mut c_int, |
81 | ) -> *mut c_void; |
82 | pub fn X509V3_extensions_print(out: *mut BIO, title: #[const_ptr_if(any(ossl110, libressl280))] c_char, exts: #[const_ptr_if(any(ossl110, libressl280))] stack_st_X509_EXTENSION, flag: c_ulong, indent: c_int) -> c_int; |
83 | } |
84 | } |
85 | |
86 | extern "C" { |
87 | #[cfg (not(libressl390))] |
88 | pub fn X509V3_EXT_add_alias(nid_to: c_int, nid_from: c_int) -> c_int; |
89 | pub fn X509V3_EXT_d2i(ext: *mut X509_EXTENSION) -> *mut c_void; |
90 | pub fn X509V3_EXT_i2d(ext_nid: c_int, crit: c_int, ext: *mut c_void) -> *mut X509_EXTENSION; |
91 | pub fn X509V3_add1_i2d( |
92 | x: *mut *mut stack_st_X509_EXTENSION, |
93 | nid: c_int, |
94 | value: *mut c_void, |
95 | crit: c_int, |
96 | flags: c_ulong, |
97 | ) -> c_int; |
98 | pub fn X509V3_EXT_print( |
99 | out: *mut BIO, |
100 | ext: *mut X509_EXTENSION, |
101 | flag: c_ulong, |
102 | indent: c_int, |
103 | ) -> c_int; |
104 | |
105 | #[cfg (ossl110)] |
106 | pub fn X509_get_pathlen(x: *mut X509) -> c_long; |
107 | #[cfg (ossl110)] |
108 | pub fn X509_get_extension_flags(x: *mut X509) -> u32; |
109 | #[cfg (ossl110)] |
110 | pub fn X509_get_key_usage(x: *mut X509) -> u32; |
111 | #[cfg (ossl110)] |
112 | pub fn X509_get_extended_key_usage(x: *mut X509) -> u32; |
113 | #[cfg (ossl110)] |
114 | pub fn X509_get0_subject_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING; |
115 | #[cfg (ossl110)] |
116 | pub fn X509_get0_authority_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING; |
117 | #[cfg (ossl111d)] |
118 | pub fn X509_get0_authority_issuer(x: *mut X509) -> *const stack_st_GENERAL_NAME; |
119 | #[cfg (ossl111d)] |
120 | pub fn X509_get0_authority_serial(x: *mut X509) -> *const ASN1_INTEGER; |
121 | } |
122 | |
123 | #[repr (C)] |
124 | pub struct DIST_POINT_NAME { |
125 | pub type_: c_int, |
126 | pub name: DIST_POINT_NAME_st_anon_union, |
127 | pub dpname: *mut X509_NAME, |
128 | } |
129 | |
130 | #[repr (C)] |
131 | pub union DIST_POINT_NAME_st_anon_union { |
132 | pub fullname: *mut stack_st_GENERAL_NAME, |
133 | pub relativename: *mut stack_st_X509_NAME_ENTRY, |
134 | } |
135 | |
136 | #[repr (C)] |
137 | pub struct DIST_POINT { |
138 | pub distpoint: *mut DIST_POINT_NAME, |
139 | pub reasons: *mut ASN1_BIT_STRING, |
140 | pub CRLissuer: *mut stack_st_GENERAL_NAME, |
141 | pub dp_reasons: c_int, |
142 | } |
143 | stack!(stack_st_DIST_POINT); |
144 | |
145 | extern "C" { |
146 | pub fn DIST_POINT_free(dist_point: *mut DIST_POINT); |
147 | pub fn DIST_POINT_NAME_free(dist_point: *mut DIST_POINT_NAME); |
148 | } |
149 | |
150 | #[cfg (ossl102)] |
151 | extern "C" { |
152 | pub fn X509_check_host( |
153 | x: *mut X509, |
154 | chk: *const c_char, |
155 | chklen: usize, |
156 | flags: c_uint, |
157 | peername: *mut *mut c_char, |
158 | ) -> c_int; |
159 | pub fn X509_check_email( |
160 | x: *mut X509, |
161 | chk: *const c_char, |
162 | chklen: usize, |
163 | flags: c_uint, |
164 | ) -> c_int; |
165 | pub fn X509_check_ip(x: *mut X509, chk: *const c_uchar, chklen: usize, flags: c_uint) -> c_int; |
166 | pub fn X509_check_ip_asc(x: *mut X509, ipasc: *const c_char, flags: c_uint) -> c_int; |
167 | } |
168 | |