1 | use libc::*; |
2 | |
3 | #[allow (unused_imports)] |
4 | use super::super::*; |
5 | |
6 | pub enum ASN1_OBJECT {} |
7 | pub enum ASN1_VALUE {} |
8 | |
9 | pub type ASN1_BOOLEAN = c_int; |
10 | pub enum ASN1_INTEGER {} |
11 | pub enum ASN1_ENUMERATED {} |
12 | pub enum ASN1_GENERALIZEDTIME {} |
13 | pub enum ASN1_STRING {} |
14 | pub enum ASN1_BIT_STRING {} |
15 | pub enum ASN1_TIME {} |
16 | pub enum ASN1_OCTET_STRING {} |
17 | pub enum ASN1_NULL {} |
18 | pub enum ASN1_PRINTABLESTRING {} |
19 | pub enum ASN1_T61STRING {} |
20 | pub enum ASN1_IA5STRING {} |
21 | pub enum ASN1_GENERALSTRING {} |
22 | pub enum ASN1_BMPSTRING {} |
23 | pub enum ASN1_UNIVERSALSTRING {} |
24 | pub enum ASN1_UTCTIME {} |
25 | pub enum ASN1_VISIBLESTRING {} |
26 | pub enum ASN1_UTF8STRING {} |
27 | |
28 | pub enum bio_st {} // FIXME remove |
29 | cfg_if! { |
30 | if #[cfg(any(ossl110, libressl280))] { |
31 | pub enum BIO {} |
32 | } else { |
33 | #[repr (C)] |
34 | pub struct BIO { |
35 | pub method: *mut BIO_METHOD, |
36 | pub callback: Option< |
37 | unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long) -> c_long, |
38 | >, |
39 | pub cb_arg: *mut c_char, |
40 | pub init: c_int, |
41 | pub shutdown: c_int, |
42 | pub flags: c_int, |
43 | pub retry_reason: c_int, |
44 | pub num: c_int, |
45 | pub ptr: *mut c_void, |
46 | pub next_bio: *mut BIO, |
47 | pub prev_bio: *mut BIO, |
48 | pub references: c_int, |
49 | pub num_read: c_ulong, |
50 | pub num_write: c_ulong, |
51 | pub ex_data: CRYPTO_EX_DATA, |
52 | } |
53 | } |
54 | } |
55 | cfg_if! { |
56 | if #[cfg(ossl320)] { |
57 | pub enum BIO_ADDR {} |
58 | pub enum BIO_POLL_DESCRIPTOR {} |
59 | #[repr (C)] |
60 | pub struct BIO_MSG { |
61 | pub data: *mut c_void, |
62 | pub data_len: usize, |
63 | pub peer: *mut BIO_ADDR, |
64 | pub local: *mut BIO_ADDR, |
65 | pub flags: u64, |
66 | } |
67 | } |
68 | } |
69 | cfg_if! { |
70 | if #[cfg(any(ossl110, libressl350))] { |
71 | pub enum BIGNUM {} |
72 | } else { |
73 | #[repr (C)] |
74 | pub struct BIGNUM { |
75 | pub d: *mut BN_ULONG, |
76 | pub top: c_int, |
77 | pub dmax: c_int, |
78 | pub neg: c_int, |
79 | pub flags: c_int, |
80 | } |
81 | } |
82 | } |
83 | pub enum BN_BLINDING {} |
84 | pub enum BN_MONT_CTX {} |
85 | |
86 | pub enum BN_CTX {} |
87 | pub enum BN_GENCB {} |
88 | |
89 | cfg_if! { |
90 | if #[cfg(any(ossl110, libressl280))] { |
91 | pub enum EVP_CIPHER {} |
92 | } else { |
93 | #[repr (C)] |
94 | pub struct EVP_CIPHER { |
95 | pub nid: c_int, |
96 | pub block_size: c_int, |
97 | pub key_len: c_int, |
98 | pub iv_len: c_int, |
99 | pub flags: c_ulong, |
100 | pub init: Option< |
101 | unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *const c_uchar, *const c_uchar, c_int) -> c_int, |
102 | >, |
103 | pub do_cipher: Option< |
104 | unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut c_uchar, *const c_uchar, size_t) -> c_int, |
105 | >, |
106 | pub cleanup: Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX) -> c_int>, |
107 | pub ctx_size: c_int, |
108 | pub set_asn1_parameters: |
109 | Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>, |
110 | pub get_asn1_parameters: |
111 | Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, *mut ASN1_TYPE) -> c_int>, |
112 | pub ctrl: |
113 | Option<unsafe extern "C" fn(*mut EVP_CIPHER_CTX, c_int, c_int, *mut c_void) -> c_int>, |
114 | pub app_data: *mut c_void, |
115 | } |
116 | } |
117 | } |
118 | pub enum EVP_CIPHER_CTX {} |
119 | pub enum EVP_MD {} |
120 | cfg_if! { |
121 | if #[cfg(any(ossl110, libressl280))] { |
122 | pub enum EVP_MD_CTX {} |
123 | } else { |
124 | #[repr (C)] |
125 | pub struct EVP_MD_CTX { |
126 | digest: *mut EVP_MD, |
127 | engine: *mut ENGINE, |
128 | flags: c_ulong, |
129 | md_data: *mut c_void, |
130 | pctx: *mut EVP_PKEY_CTX, |
131 | update: *mut c_void, |
132 | } |
133 | } |
134 | } |
135 | |
136 | pub enum PKCS8_PRIV_KEY_INFO {} |
137 | |
138 | pub enum EVP_PKEY_ASN1_METHOD {} |
139 | |
140 | pub enum EVP_PKEY_CTX {} |
141 | |
142 | pub enum CMAC_CTX {} |
143 | |
144 | cfg_if! { |
145 | if #[cfg(any(ossl110, libressl280))] { |
146 | pub enum HMAC_CTX {} |
147 | } else { |
148 | #[repr (C)] |
149 | pub struct HMAC_CTX { |
150 | md: *mut EVP_MD, |
151 | md_ctx: EVP_MD_CTX, |
152 | i_ctx: EVP_MD_CTX, |
153 | o_ctx: EVP_MD_CTX, |
154 | key_length: c_uint, |
155 | key: [c_uchar; 128], |
156 | } |
157 | } |
158 | } |
159 | |
160 | cfg_if! { |
161 | if #[cfg(any(ossl110, libressl280))] { |
162 | pub enum DH {} |
163 | } else { |
164 | #[repr (C)] |
165 | pub struct DH { |
166 | pub pad: c_int, |
167 | pub version: c_int, |
168 | pub p: *mut BIGNUM, |
169 | pub g: *mut BIGNUM, |
170 | pub length: c_long, |
171 | pub pub_key: *mut BIGNUM, |
172 | pub priv_key: *mut BIGNUM, |
173 | pub flags: c_int, |
174 | pub method_mont_p: *mut BN_MONT_CTX, |
175 | pub q: *mut BIGNUM, |
176 | pub j: *mut BIGNUM, |
177 | pub seed: *mut c_uchar, |
178 | pub seedlen: c_int, |
179 | pub counter: *mut BIGNUM, |
180 | pub references: c_int, |
181 | pub ex_data: CRYPTO_EX_DATA, |
182 | pub meth: *const DH_METHOD, |
183 | pub engine: *mut ENGINE, |
184 | } |
185 | } |
186 | } |
187 | pub enum DH_METHOD {} |
188 | |
189 | cfg_if! { |
190 | if #[cfg(any(ossl110, libressl280))] { |
191 | pub enum DSA {} |
192 | } else { |
193 | #[repr (C)] |
194 | pub struct DSA { |
195 | pub pad: c_int, |
196 | pub version: c_long, |
197 | pub write_params: c_int, |
198 | |
199 | pub p: *mut BIGNUM, |
200 | pub q: *mut BIGNUM, |
201 | pub g: *mut BIGNUM, |
202 | pub pub_key: *mut BIGNUM, |
203 | pub priv_key: *mut BIGNUM, |
204 | pub kinv: *mut BIGNUM, |
205 | pub r: *mut BIGNUM, |
206 | |
207 | pub flags: c_int, |
208 | pub method_mont_p: *mut BN_MONT_CTX, |
209 | pub references: c_int, |
210 | pub ex_data: CRYPTO_EX_DATA, |
211 | pub meth: *const DSA_METHOD, |
212 | pub engine: *mut ENGINE, |
213 | } |
214 | } |
215 | } |
216 | pub enum DSA_METHOD {} |
217 | |
218 | cfg_if! { |
219 | if #[cfg(any(ossl110, libressl280))] { |
220 | pub enum RSA {} |
221 | } else if #[cfg(libressl)] { |
222 | #[repr (C)] |
223 | pub struct RSA { |
224 | pub pad: c_int, |
225 | pub version: c_long, |
226 | pub meth: *const RSA_METHOD, |
227 | |
228 | pub engine: *mut ENGINE, |
229 | pub n: *mut BIGNUM, |
230 | pub e: *mut BIGNUM, |
231 | pub d: *mut BIGNUM, |
232 | pub p: *mut BIGNUM, |
233 | pub q: *mut BIGNUM, |
234 | pub dmp1: *mut BIGNUM, |
235 | pub dmq1: *mut BIGNUM, |
236 | pub iqmp: *mut BIGNUM, |
237 | |
238 | pub ex_data: CRYPTO_EX_DATA, |
239 | pub references: c_int, |
240 | pub flags: c_int, |
241 | |
242 | pub _method_mod_n: *mut BN_MONT_CTX, |
243 | pub _method_mod_p: *mut BN_MONT_CTX, |
244 | pub _method_mod_q: *mut BN_MONT_CTX, |
245 | |
246 | pub blinding: *mut BN_BLINDING, |
247 | pub mt_blinding: *mut BN_BLINDING, |
248 | } |
249 | } else { |
250 | #[repr (C)] |
251 | pub struct RSA { |
252 | pub pad: c_int, |
253 | pub version: c_long, |
254 | pub meth: *const RSA_METHOD, |
255 | |
256 | pub engine: *mut ENGINE, |
257 | pub n: *mut BIGNUM, |
258 | pub e: *mut BIGNUM, |
259 | pub d: *mut BIGNUM, |
260 | pub p: *mut BIGNUM, |
261 | pub q: *mut BIGNUM, |
262 | pub dmp1: *mut BIGNUM, |
263 | pub dmq1: *mut BIGNUM, |
264 | pub iqmp: *mut BIGNUM, |
265 | |
266 | pub ex_data: CRYPTO_EX_DATA, |
267 | pub references: c_int, |
268 | pub flags: c_int, |
269 | |
270 | pub _method_mod_n: *mut BN_MONT_CTX, |
271 | pub _method_mod_p: *mut BN_MONT_CTX, |
272 | pub _method_mod_q: *mut BN_MONT_CTX, |
273 | |
274 | pub bignum_data: *mut c_char, |
275 | pub blinding: *mut BN_BLINDING, |
276 | pub mt_blinding: *mut BN_BLINDING, |
277 | } |
278 | } |
279 | } |
280 | pub enum RSA_METHOD {} |
281 | |
282 | pub enum EC_KEY {} |
283 | |
284 | cfg_if! { |
285 | if #[cfg(any(ossl110, libressl280))] { |
286 | pub enum X509 {} |
287 | } else if #[cfg(libressl)] { |
288 | #[repr (C)] |
289 | pub struct X509 { |
290 | pub cert_info: *mut X509_CINF, |
291 | pub sig_alg: *mut X509_ALGOR, |
292 | pub signature: *mut ASN1_BIT_STRING, |
293 | pub valid: c_int, |
294 | pub references: c_int, |
295 | pub name: *mut c_char, |
296 | pub ex_data: CRYPTO_EX_DATA, |
297 | pub ex_pathlen: c_long, |
298 | pub ex_pcpathlen: c_long, |
299 | pub ex_flags: c_ulong, |
300 | pub ex_kusage: c_ulong, |
301 | pub ex_xkusage: c_ulong, |
302 | pub ex_nscert: c_ulong, |
303 | skid: *mut c_void, |
304 | akid: *mut c_void, |
305 | policy_cache: *mut c_void, |
306 | crldp: *mut c_void, |
307 | altname: *mut c_void, |
308 | nc: *mut c_void, |
309 | #[cfg (not(osslconf = "OPENSSL_NO_SHA" ))] |
310 | sha1_hash: [c_uchar; 20], |
311 | aux: *mut c_void, |
312 | } |
313 | } else { |
314 | #[repr (C)] |
315 | pub struct X509 { |
316 | pub cert_info: *mut X509_CINF, |
317 | pub sig_alg: *mut X509_ALGOR, |
318 | pub signature: *mut ASN1_BIT_STRING, |
319 | pub valid: c_int, |
320 | pub references: c_int, |
321 | pub name: *mut c_char, |
322 | pub ex_data: CRYPTO_EX_DATA, |
323 | pub ex_pathlen: c_long, |
324 | pub ex_pcpathlen: c_long, |
325 | pub ex_flags: c_ulong, |
326 | pub ex_kusage: c_ulong, |
327 | pub ex_xkusage: c_ulong, |
328 | pub ex_nscert: c_ulong, |
329 | skid: *mut c_void, |
330 | akid: *mut c_void, |
331 | policy_cache: *mut c_void, |
332 | crldp: *mut c_void, |
333 | altname: *mut c_void, |
334 | nc: *mut c_void, |
335 | #[cfg (not(osslconf = "OPENSSL_NO_RFC3779" ))] |
336 | rfc3779_addr: *mut c_void, |
337 | #[cfg (not(osslconf = "OPENSSL_NO_RFC3779" ))] |
338 | rfc3779_asid: *mut c_void, |
339 | #[cfg (not(osslconf = "OPENSSL_NO_SHA" ))] |
340 | sha1_hash: [c_uchar; 20], |
341 | aux: *mut c_void, |
342 | } |
343 | } |
344 | } |
345 | cfg_if! { |
346 | if #[cfg(any(ossl110, libressl382))] { |
347 | pub enum X509_ALGOR {} |
348 | } else { |
349 | #[repr (C)] |
350 | pub struct X509_ALGOR { |
351 | pub algorithm: *mut ASN1_OBJECT, |
352 | parameter: *mut c_void, |
353 | } |
354 | } |
355 | } |
356 | |
357 | stack!(stack_st_X509_ALGOR); |
358 | |
359 | pub enum X509_LOOKUP_METHOD {} |
360 | |
361 | pub enum X509_NAME {} |
362 | |
363 | cfg_if! { |
364 | if #[cfg(any(ossl110, libressl270))] { |
365 | pub enum X509_STORE {} |
366 | } else { |
367 | #[repr (C)] |
368 | pub struct X509_STORE { |
369 | cache: c_int, |
370 | pub objs: *mut stack_st_X509_OBJECT, |
371 | get_cert_methods: *mut stack_st_X509_LOOKUP, |
372 | param: *mut X509_VERIFY_PARAM, |
373 | verify: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>, |
374 | verify_cb: Option<extern "C" fn(ok: c_int, ctx: *mut X509_STORE_CTX) -> c_int>, |
375 | get_issuer: Option< |
376 | extern "C" fn(issuer: *mut *mut X509, ctx: *mut X509_STORE_CTX, x: *mut X509) -> c_int, |
377 | >, |
378 | check_issued: |
379 | Option<extern "C" fn(ctx: *mut X509_STORE_CTX, x: *mut X509, issuer: *mut X509) -> c_int>, |
380 | check_revocation: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>, |
381 | get_crl: Option< |
382 | extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut *mut X509_CRL, x: *mut X509) -> c_int, |
383 | >, |
384 | check_crl: Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL) -> c_int>, |
385 | cert_crl: |
386 | Option<extern "C" fn(ctx: *mut X509_STORE_CTX, crl: *mut X509_CRL, x: *mut X509) -> c_int>, |
387 | lookup_certs: |
388 | Option<extern "C" fn(ctx: *mut X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509>, |
389 | lookup_crls: Option< |
390 | extern "C" fn(ctx: *const X509_STORE_CTX, nm: *const X509_NAME) -> *mut stack_st_X509_CRL, |
391 | >, |
392 | cleanup: Option<extern "C" fn(ctx: *mut X509_STORE_CTX) -> c_int>, |
393 | ex_data: CRYPTO_EX_DATA, |
394 | references: c_int, |
395 | } |
396 | } |
397 | } |
398 | |
399 | pub enum X509_STORE_CTX {} |
400 | |
401 | cfg_if! { |
402 | if #[cfg(any(ossl110, libressl280))] { |
403 | pub enum X509_VERIFY_PARAM {} |
404 | } else if #[cfg(libressl251)] { |
405 | #[repr (C)] |
406 | pub struct X509_VERIFY_PARAM { |
407 | pub name: *mut c_char, |
408 | pub check_time: time_t, |
409 | pub inh_flags: c_ulong, |
410 | pub flags: c_ulong, |
411 | pub purpose: c_int, |
412 | pub trust: c_int, |
413 | pub depth: c_int, |
414 | pub policies: *mut stack_st_ASN1_OBJECT, |
415 | id: *mut c_void, |
416 | } |
417 | } else if #[cfg(libressl)] { |
418 | #[repr (C)] |
419 | pub struct X509_VERIFY_PARAM { |
420 | pub name: *mut c_char, |
421 | pub check_time: time_t, |
422 | pub inh_flags: c_ulong, |
423 | pub flags: c_ulong, |
424 | pub purpose: c_int, |
425 | pub trust: c_int, |
426 | pub depth: c_int, |
427 | pub policies: *mut stack_st_ASN1_OBJECT, |
428 | //pub id: *mut X509_VERIFY_PARAM_ID, |
429 | } |
430 | } else { |
431 | #[repr (C)] |
432 | pub struct X509_VERIFY_PARAM { |
433 | pub name: *mut c_char, |
434 | pub check_time: time_t, |
435 | pub inh_flags: c_ulong, |
436 | pub flags: c_ulong, |
437 | pub purpose: c_int, |
438 | pub trust: c_int, |
439 | pub depth: c_int, |
440 | pub policies: *mut stack_st_ASN1_OBJECT, |
441 | #[cfg (ossl102)] |
442 | pub id: *mut X509_VERIFY_PARAM_ID, |
443 | } |
444 | } |
445 | } |
446 | |
447 | cfg_if! { |
448 | if #[cfg(any(ossl110, libressl270))] { |
449 | pub enum X509_OBJECT {} |
450 | } else { |
451 | #[repr (C)] |
452 | pub struct X509_OBJECT { |
453 | pub type_: c_int, |
454 | pub data: X509_OBJECT_data, |
455 | } |
456 | #[repr (C)] |
457 | pub union X509_OBJECT_data { |
458 | pub ptr: *mut c_char, |
459 | pub x509: *mut X509, |
460 | pub crl: *mut X509_CRL, |
461 | pub pkey: *mut EVP_PKEY, |
462 | } |
463 | } |
464 | } |
465 | |
466 | pub enum X509_LOOKUP {} |
467 | |
468 | #[repr (C)] |
469 | pub struct X509V3_CTX { |
470 | flags: c_int, |
471 | issuer_cert: *mut c_void, |
472 | subject_cert: *mut c_void, |
473 | subject_req: *mut c_void, |
474 | crl: *mut c_void, |
475 | #[cfg (not(libressl400))] |
476 | db_meth: *mut c_void, |
477 | db: *mut c_void, |
478 | #[cfg (ossl300)] |
479 | issuer_pkey: *mut c_void, |
480 | // I like the last comment line, it is copied from OpenSSL sources: |
481 | // Maybe more here |
482 | } |
483 | pub enum CONF {} |
484 | #[cfg (ossl110)] |
485 | pub enum OPENSSL_INIT_SETTINGS {} |
486 | |
487 | pub enum ENGINE {} |
488 | cfg_if! { |
489 | if #[cfg(any(ossl110, libressl280))] { |
490 | pub enum SSL {} |
491 | } else if #[cfg(libressl251)] { |
492 | #[repr (C)] |
493 | pub struct SSL { |
494 | version: c_int, |
495 | method: *const SSL_METHOD, |
496 | rbio: *mut BIO, |
497 | wbio: *mut BIO, |
498 | bbio: *mut BIO, |
499 | pub server: c_int, |
500 | s3: *mut c_void, |
501 | d1: *mut c_void, |
502 | param: *mut c_void, |
503 | cipher_list: *mut stack_st_SSL_CIPHER, |
504 | cert: *mut c_void, |
505 | sid_ctx_length: c_uint, |
506 | sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize], |
507 | session: *mut SSL_SESSION, |
508 | verify_mode: c_int, |
509 | error: c_int, |
510 | error_code: c_int, |
511 | ctx: *mut SSL_CTX, |
512 | verify_result: c_long, |
513 | references: c_int, |
514 | client_version: c_int, |
515 | max_send_fragment: c_uint, |
516 | tlsext_hostname: *mut c_char, |
517 | tlsext_status_type: c_int, |
518 | initial_ctx: *mut SSL_CTX, |
519 | enc_read_ctx: *mut EVP_CIPHER_CTX, |
520 | read_hash: *mut EVP_MD_CTX, |
521 | internal: *mut c_void, |
522 | } |
523 | } else if #[cfg(libressl)] { |
524 | #[repr (C)] |
525 | pub struct SSL { |
526 | version: c_int, |
527 | type_: c_int, |
528 | method: *const SSL_METHOD, |
529 | rbio: *mut c_void, |
530 | wbio: *mut c_void, |
531 | bbio: *mut c_void, |
532 | rwstate: c_int, |
533 | in_handshake: c_int, |
534 | handshake_func: Option<unsafe extern "C" fn(*mut SSL) -> c_int>, |
535 | pub server: c_int, |
536 | new_session: c_int, |
537 | quiet_shutdown: c_int, |
538 | shutdown: c_int, |
539 | state: c_int, |
540 | rstate: c_int, |
541 | init_buf: *mut c_void, |
542 | init_msg: *mut c_void, |
543 | init_num: c_int, |
544 | init_off: c_int, |
545 | packet: *mut c_uchar, |
546 | packet_length: c_uint, |
547 | s3: *mut c_void, |
548 | d1: *mut c_void, |
549 | read_ahead: c_int, |
550 | msg_callback: Option< |
551 | unsafe extern "C" fn(c_int, |
552 | c_int, |
553 | c_int, |
554 | *const c_void, |
555 | size_t, |
556 | *mut SSL, |
557 | *mut c_void), |
558 | >, |
559 | msg_callback_arg: *mut c_void, |
560 | hit: c_int, |
561 | param: *mut c_void, |
562 | cipher_list: *mut stack_st_SSL_CIPHER, |
563 | cipher_list_by_id: *mut stack_st_SSL_CIPHER, |
564 | mac_flags: c_int, |
565 | aead_read_ctx: *mut c_void, |
566 | enc_read_ctx: *mut EVP_CIPHER_CTX, |
567 | read_hash: *mut EVP_MD_CTX, |
568 | aead_write_ctx: *mut c_void, |
569 | enc_write_ctx: *mut EVP_CIPHER_CTX, |
570 | write_hash: *mut EVP_MD_CTX, |
571 | cert: *mut c_void, |
572 | sid_ctx_length: c_uint, |
573 | sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize], |
574 | session: *mut SSL_SESSION, |
575 | generate_session_id: GEN_SESSION_CB, |
576 | verify_mode: c_int, |
577 | verify_callback: Option<unsafe extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>, |
578 | info_callback: Option<unsafe extern "C" fn(*mut SSL, c_int, c_int)>, |
579 | error: c_int, |
580 | error_code: c_int, |
581 | ctx: *mut SSL_CTX, |
582 | debug: c_int, |
583 | verify_result: c_long, |
584 | ex_data: CRYPTO_EX_DATA, |
585 | client_CA: *mut stack_st_X509_NAME, |
586 | references: c_int, |
587 | options: c_ulong, |
588 | mode: c_ulong, |
589 | max_cert_list: c_long, |
590 | first_packet: c_int, |
591 | client_version: c_int, |
592 | max_send_fragment: c_uint, |
593 | tlsext_debug_cb: |
594 | Option<unsafe extern "C" fn(*mut SSL, c_int, c_int, *mut c_uchar, c_int, *mut c_void)>, |
595 | tlsext_debug_arg: *mut c_void, |
596 | tlsext_hostname: *mut c_char, |
597 | servername_done: c_int, |
598 | tlsext_status_type: c_int, |
599 | tlsext_status_expected: c_int, |
600 | tlsext_ocsp_ids: *mut c_void, |
601 | tlsext_ocsp_exts: *mut c_void, |
602 | tlsext_ocsp_resp: *mut c_uchar, |
603 | tlsext_ocsp_resplen: c_int, |
604 | tlsext_ticket_expected: c_int, |
605 | tlsext_ecpointformatlist_length: size_t, |
606 | tlsext_ecpointformatlist: *mut c_uchar, |
607 | tlsext_ellipticcurvelist_length: size_t, |
608 | tlsext_ellipticcurvelist: *mut c_uchar, |
609 | tlsext_session_ticket: *mut c_void, |
610 | tlsext_session_ticket_ext_cb: tls_session_ticket_ext_cb_fn, |
611 | tls_session_ticket_ext_cb_arg: *mut c_void, |
612 | tls_session_secret_cb: tls_session_secret_cb_fn, |
613 | tls_session_secret_cb_arg: *mut c_void, |
614 | initial_ctx: *mut SSL_CTX, |
615 | next_proto_negotiated: *mut c_uchar, |
616 | next_proto_negotiated_len: c_uchar, |
617 | srtp_profiles: *mut c_void, |
618 | srtp_profile: *mut c_void, |
619 | tlsext_heartbeat: c_uint, |
620 | tlsext_hb_pending: c_uint, |
621 | tlsext_hb_seq: c_uint, |
622 | alpn_client_proto_list: *mut c_uchar, |
623 | alpn_client_proto_list_len: c_uint, |
624 | renegotiate: c_int, |
625 | } |
626 | } else { |
627 | #[repr (C)] |
628 | pub struct SSL { |
629 | version: c_int, |
630 | type_: c_int, |
631 | method: *const SSL_METHOD, |
632 | rbio: *mut c_void, |
633 | wbio: *mut c_void, |
634 | bbio: *mut c_void, |
635 | rwstate: c_int, |
636 | in_handshake: c_int, |
637 | handshake_func: Option<unsafe extern "C" fn(*mut SSL) -> c_int>, |
638 | pub server: c_int, |
639 | new_session: c_int, |
640 | quiet_session: c_int, |
641 | shutdown: c_int, |
642 | state: c_int, |
643 | rstate: c_int, |
644 | init_buf: *mut c_void, |
645 | init_msg: *mut c_void, |
646 | init_num: c_int, |
647 | init_off: c_int, |
648 | packet: *mut c_uchar, |
649 | packet_length: c_uint, |
650 | s2: *mut c_void, |
651 | s3: *mut c_void, |
652 | d1: *mut c_void, |
653 | read_ahead: c_int, |
654 | msg_callback: Option< |
655 | unsafe extern "C" fn(c_int, c_int, c_int, *const c_void, size_t, *mut SSL, *mut c_void), |
656 | >, |
657 | msg_callback_arg: *mut c_void, |
658 | hit: c_int, |
659 | param: *mut c_void, |
660 | cipher_list: *mut stack_st_SSL_CIPHER, |
661 | cipher_list_by_id: *mut stack_st_SSL_CIPHER, |
662 | mac_flags: c_int, |
663 | enc_read_ctx: *mut EVP_CIPHER_CTX, |
664 | read_hash: *mut EVP_MD_CTX, |
665 | expand: *mut c_void, |
666 | enc_write_ctx: *mut EVP_CIPHER_CTX, |
667 | write_hash: *mut EVP_MD_CTX, |
668 | compress: *mut c_void, |
669 | cert: *mut c_void, |
670 | sid_ctx_length: c_uint, |
671 | sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize], |
672 | session: *mut SSL_SESSION, |
673 | generate_session_id: GEN_SESSION_CB, |
674 | verify_mode: c_int, |
675 | verify_callback: Option<unsafe extern "C" fn(c_int, *mut X509_STORE_CTX) -> c_int>, |
676 | info_callback: Option<unsafe extern "C" fn(*mut SSL, c_int, c_int)>, |
677 | error: c_int, |
678 | error_code: c_int, |
679 | #[cfg (not(osslconf = "OPENSSL_NO_KRB5" ))] |
680 | kssl_ctx: *mut c_void, |
681 | #[cfg (not(osslconf = "OPENSSL_NO_PSK" ))] |
682 | psk_client_callback: Option< |
683 | unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_char, c_uint, *mut c_uchar, c_uint) |
684 | -> c_uint, |
685 | >, |
686 | #[cfg (not(osslconf = "OPENSSL_NO_PSK" ))] |
687 | psk_server_callback: |
688 | Option<unsafe extern "C" fn(*mut SSL, *const c_char, *mut c_uchar, c_uint) -> c_uint>, |
689 | ctx: *mut SSL_CTX, |
690 | debug: c_int, |
691 | verify_result: c_long, |
692 | ex_data: CRYPTO_EX_DATA, |
693 | client_CA: *mut stack_st_X509_NAME, |
694 | references: c_int, |
695 | options: c_ulong, |
696 | mode: c_ulong, |
697 | max_cert_list: c_long, |
698 | first_packet: c_int, |
699 | client_version: c_int, |
700 | max_send_fragment: c_uint, |
701 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
702 | tlsext_debug_cb: |
703 | Option<unsafe extern "C" fn(*mut SSL, c_int, c_int, *mut c_uchar, c_int, *mut c_void)>, |
704 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
705 | tlsext_debug_arg: *mut c_void, |
706 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
707 | tlsext_hostname: *mut c_char, |
708 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
709 | servername_done: c_int, |
710 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
711 | tlsext_status_type: c_int, |
712 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
713 | tlsext_status_expected: c_int, |
714 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
715 | tlsext_ocsp_ids: *mut c_void, |
716 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
717 | tlsext_ocsp_exts: *mut c_void, |
718 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
719 | tlsext_ocsp_resp: *mut c_uchar, |
720 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
721 | tlsext_ocsp_resplen: c_int, |
722 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
723 | tlsext_ticket_expected: c_int, |
724 | #[cfg (all( |
725 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
726 | not(osslconf = "OPENSSL_NO_EC" ) |
727 | ))] |
728 | tlsext_ecpointformatlist_length: size_t, |
729 | #[cfg (all( |
730 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
731 | not(osslconf = "OPENSSL_NO_EC" ) |
732 | ))] |
733 | tlsext_ecpointformatlist: *mut c_uchar, |
734 | #[cfg (all( |
735 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
736 | not(osslconf = "OPENSSL_NO_EC" ) |
737 | ))] |
738 | tlsext_ellipticcurvelist_length: size_t, |
739 | #[cfg (all( |
740 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
741 | not(osslconf = "OPENSSL_NO_EC" ) |
742 | ))] |
743 | tlsext_ellipticcurvelist: *mut c_uchar, |
744 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
745 | tlsext_opaque_prf_input: *mut c_void, |
746 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
747 | tlsext_opaque_prf_input_len: size_t, |
748 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
749 | tlsext_session_ticket: *mut c_void, |
750 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
751 | tlsext_session_ticket_ext_cb: tls_session_ticket_ext_cb_fn, |
752 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
753 | tls_session_ticket_ext_cb_arg: *mut c_void, |
754 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
755 | tls_session_secret_cb: tls_session_secret_cb_fn, |
756 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
757 | tls_session_secret_cb_arg: *mut c_void, |
758 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
759 | initial_ctx: *mut SSL_CTX, |
760 | #[cfg (all( |
761 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
762 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
763 | ))] |
764 | next_proto_negotiated: *mut c_uchar, |
765 | #[cfg (all( |
766 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
767 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
768 | ))] |
769 | next_proto_negotiated_len: c_uchar, |
770 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
771 | srtp_profiles: *mut c_void, |
772 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
773 | srtp_profile: *mut c_void, |
774 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
775 | tlsext_heartbeat: c_uint, |
776 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
777 | tlsext_hb_pending: c_uint, |
778 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
779 | tlsext_hb_seq: c_uint, |
780 | renegotiate: c_int, |
781 | #[cfg (not(osslconf = "OPENSSL_NO_SRP" ))] |
782 | srp_ctx: SRP_CTX, |
783 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
784 | alpn_client_proto_list: *mut c_uchar, |
785 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
786 | alpn_client_proto_list_len: c_uint, |
787 | } |
788 | } |
789 | } |
790 | cfg_if! { |
791 | if #[cfg(any(ossl110, libressl280))] { |
792 | pub enum SSL_CTX {} |
793 | } else if #[cfg(libressl251)] { |
794 | #[repr (C)] |
795 | pub struct SSL_CTX { |
796 | method: *const SSL_METHOD, |
797 | cipher_list: *mut stack_st_SSL_CIPHER, |
798 | cert_store: *mut c_void, |
799 | session_timeout: c_long, |
800 | pub references: c_int, |
801 | extra_certs: *mut stack_st_X509, |
802 | verify_mode: c_int, |
803 | sid_ctx_length: c_uint, |
804 | sid_ctx: [c_uchar; SSL_MAX_SID_CTX_LENGTH as usize], |
805 | param: *mut X509_VERIFY_PARAM, |
806 | default_passwd_callback: *mut c_void, |
807 | default_passwd_callback_userdata: *mut c_void, |
808 | internal: *mut c_void, |
809 | } |
810 | } else if #[cfg(libressl)] { |
811 | #[repr (C)] |
812 | pub struct SSL_CTX { |
813 | method: *mut c_void, |
814 | cipher_list: *mut c_void, |
815 | cipher_list_by_id: *mut c_void, |
816 | cert_store: *mut c_void, |
817 | sessions: *mut c_void, |
818 | session_cache_size: c_ulong, |
819 | session_cache_head: *mut c_void, |
820 | session_cache_tail: *mut c_void, |
821 | session_cache_mode: c_int, |
822 | session_timeout: c_long, |
823 | new_session_cb: *mut c_void, |
824 | remove_session_cb: *mut c_void, |
825 | get_session_cb: *mut c_void, |
826 | stats: [c_int; 11], |
827 | pub references: c_int, |
828 | app_verify_callback: *mut c_void, |
829 | app_verify_arg: *mut c_void, |
830 | default_passwd_callback: *mut c_void, |
831 | default_passwd_callback_userdata: *mut c_void, |
832 | client_cert_cb: *mut c_void, |
833 | app_gen_cookie_cb: *mut c_void, |
834 | app_verify_cookie_cb: *mut c_void, |
835 | ex_dat: CRYPTO_EX_DATA, |
836 | rsa_md5: *mut c_void, |
837 | md5: *mut c_void, |
838 | sha1: *mut c_void, |
839 | extra_certs: *mut c_void, |
840 | comp_methods: *mut c_void, |
841 | info_callback: *mut c_void, |
842 | client_CA: *mut c_void, |
843 | options: c_ulong, |
844 | mode: c_ulong, |
845 | max_cert_list: c_long, |
846 | cert: *mut c_void, |
847 | read_ahead: c_int, |
848 | msg_callback: *mut c_void, |
849 | msg_callback_arg: *mut c_void, |
850 | verify_mode: c_int, |
851 | sid_ctx_length: c_uint, |
852 | sid_ctx: [c_uchar; 32], |
853 | default_verify_callback: *mut c_void, |
854 | generate_session_id: *mut c_void, |
855 | param: *mut c_void, |
856 | quiet_shutdown: c_int, |
857 | max_send_fragment: c_uint, |
858 | |
859 | #[cfg (not(osslconf = "OPENSSL_NO_ENGINE" ))] |
860 | client_cert_engine: *mut c_void, |
861 | |
862 | tlsext_servername_callback: *mut c_void, |
863 | tlsect_servername_arg: *mut c_void, |
864 | tlsext_tick_key_name: [c_uchar; 16], |
865 | tlsext_tick_hmac_key: [c_uchar; 16], |
866 | tlsext_tick_aes_key: [c_uchar; 16], |
867 | tlsext_ticket_key_cb: *mut c_void, |
868 | tlsext_status_cb: *mut c_void, |
869 | tlsext_status_arg: *mut c_void, |
870 | tlsext_opaque_prf_input_callback: *mut c_void, |
871 | tlsext_opaque_prf_input_callback_arg: *mut c_void, |
872 | |
873 | next_protos_advertised_cb: *mut c_void, |
874 | next_protos_advertised_cb_arg: *mut c_void, |
875 | next_proto_select_cb: *mut c_void, |
876 | next_proto_select_cb_arg: *mut c_void, |
877 | |
878 | srtp_profiles: *mut c_void, |
879 | } |
880 | } else { |
881 | #[repr (C)] |
882 | pub struct SSL_CTX { |
883 | method: *mut c_void, |
884 | cipher_list: *mut c_void, |
885 | cipher_list_by_id: *mut c_void, |
886 | cert_store: *mut c_void, |
887 | sessions: *mut c_void, |
888 | session_cache_size: c_ulong, |
889 | session_cache_head: *mut c_void, |
890 | session_cache_tail: *mut c_void, |
891 | session_cache_mode: c_int, |
892 | session_timeout: c_long, |
893 | new_session_cb: *mut c_void, |
894 | remove_session_cb: *mut c_void, |
895 | get_session_cb: *mut c_void, |
896 | stats: [c_int; 11], |
897 | pub references: c_int, |
898 | app_verify_callback: *mut c_void, |
899 | app_verify_arg: *mut c_void, |
900 | default_passwd_callback: *mut c_void, |
901 | default_passwd_callback_userdata: *mut c_void, |
902 | client_cert_cb: *mut c_void, |
903 | app_gen_cookie_cb: *mut c_void, |
904 | app_verify_cookie_cb: *mut c_void, |
905 | ex_dat: CRYPTO_EX_DATA, |
906 | rsa_md5: *mut c_void, |
907 | md5: *mut c_void, |
908 | sha1: *mut c_void, |
909 | extra_certs: *mut c_void, |
910 | comp_methods: *mut c_void, |
911 | info_callback: *mut c_void, |
912 | client_CA: *mut c_void, |
913 | options: c_ulong, |
914 | mode: c_ulong, |
915 | max_cert_list: c_long, |
916 | cert: *mut c_void, |
917 | read_ahead: c_int, |
918 | msg_callback: *mut c_void, |
919 | msg_callback_arg: *mut c_void, |
920 | verify_mode: c_int, |
921 | sid_ctx_length: c_uint, |
922 | sid_ctx: [c_uchar; 32], |
923 | default_verify_callback: *mut c_void, |
924 | generate_session_id: *mut c_void, |
925 | param: *mut c_void, |
926 | quiet_shutdown: c_int, |
927 | max_send_fragment: c_uint, |
928 | |
929 | #[cfg (not(osslconf = "OPENSSL_NO_ENGINE" ))] |
930 | client_cert_engine: *mut c_void, |
931 | |
932 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
933 | tlsext_servername_callback: *mut c_void, |
934 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
935 | tlsect_servername_arg: *mut c_void, |
936 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
937 | tlsext_tick_key_name: [c_uchar; 16], |
938 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
939 | tlsext_tick_hmac_key: [c_uchar; 16], |
940 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
941 | tlsext_tick_aes_key: [c_uchar; 16], |
942 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
943 | tlsext_ticket_key_cb: *mut c_void, |
944 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
945 | tlsext_status_cb: *mut c_void, |
946 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
947 | tlsext_status_arg: *mut c_void, |
948 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
949 | tlsext_opaque_prf_input_callback: *mut c_void, |
950 | #[cfg (not(osslconf = "OPENSSL_NO_TLSEXT" ))] |
951 | tlsext_opaque_prf_input_callback_arg: *mut c_void, |
952 | |
953 | #[cfg (not(osslconf = "OPENSSL_NO_PSK" ))] |
954 | psk_identity_hint: *mut c_void, |
955 | #[cfg (not(osslconf = "OPENSSL_NO_PSK" ))] |
956 | psk_client_callback: *mut c_void, |
957 | #[cfg (not(osslconf = "OPENSSL_NO_PSK" ))] |
958 | psk_server_callback: *mut c_void, |
959 | |
960 | #[cfg (not(osslconf = "OPENSSL_NO_BUF_FREELISTS" ))] |
961 | freelist_max_len: c_uint, |
962 | #[cfg (not(osslconf = "OPENSSL_NO_BUF_FREELISTS" ))] |
963 | wbuf_freelist: *mut c_void, |
964 | #[cfg (not(osslconf = "OPENSSL_NO_BUF_FREELISTS" ))] |
965 | rbuf_freelist: *mut c_void, |
966 | |
967 | #[cfg (not(osslconf = "OPENSSL_NO_SRP" ))] |
968 | srp_ctx: SRP_CTX, |
969 | |
970 | #[cfg (all( |
971 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
972 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
973 | ))] |
974 | next_protos_advertised_cb: *mut c_void, |
975 | #[cfg (all( |
976 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
977 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
978 | ))] |
979 | next_protos_advertised_cb_arg: *mut c_void, |
980 | #[cfg (all( |
981 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
982 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
983 | ))] |
984 | next_proto_select_cb: *mut c_void, |
985 | #[cfg (all( |
986 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
987 | not(osslconf = "OPENSSL_NO_NEXTPROTONEG" ) |
988 | ))] |
989 | next_proto_select_cb_arg: *mut c_void, |
990 | |
991 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl101))] |
992 | srtp_profiles: *mut c_void, |
993 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
994 | alpn_select_cb: *mut c_void, |
995 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
996 | alpn_select_cb_arg: *mut c_void, |
997 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
998 | alpn_client_proto_list: *mut c_void, |
999 | #[cfg (all(not(osslconf = "OPENSSL_NO_TLSEXT" ), ossl102))] |
1000 | alpn_client_proto_list_len: c_uint, |
1001 | |
1002 | #[cfg (all( |
1003 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
1004 | not(osslconf = "OPENSSL_NO_EC" ), |
1005 | ossl102 |
1006 | ))] |
1007 | tlsext_ecpointformatlist_length: size_t, |
1008 | #[cfg (all( |
1009 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
1010 | not(osslconf = "OPENSSL_NO_EC" ), |
1011 | ossl102 |
1012 | ))] |
1013 | tlsext_ecpointformatlist: *mut c_uchar, |
1014 | #[cfg (all( |
1015 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
1016 | not(osslconf = "OPENSSL_NO_EC" ), |
1017 | ossl102 |
1018 | ))] |
1019 | tlsext_ellipticcurvelist_length: size_t, |
1020 | #[cfg (all( |
1021 | not(osslconf = "OPENSSL_NO_TLSEXT" ), |
1022 | not(osslconf = "OPENSSL_NO_EC" ), |
1023 | ossl102 |
1024 | ))] |
1025 | tlsext_ellipticcurvelist: *mut c_uchar, |
1026 | } |
1027 | |
1028 | #[repr (C)] |
1029 | #[cfg (not(osslconf = "OPENSSL_NO_SRP" ))] |
1030 | pub struct SRP_CTX { |
1031 | SRP_cb_arg: *mut c_void, |
1032 | TLS_ext_srp_username_callback: *mut c_void, |
1033 | SRP_verify_param_callback: *mut c_void, |
1034 | SRP_give_srp_client_pwd_callback: *mut c_void, |
1035 | login: *mut c_void, |
1036 | N: *mut c_void, |
1037 | g: *mut c_void, |
1038 | s: *mut c_void, |
1039 | B: *mut c_void, |
1040 | A: *mut c_void, |
1041 | a: *mut c_void, |
1042 | b: *mut c_void, |
1043 | v: *mut c_void, |
1044 | info: *mut c_void, |
1045 | stringth: c_int, |
1046 | srp_Mask: c_ulong, |
1047 | } |
1048 | } |
1049 | } |
1050 | cfg_if! { |
1051 | if #[cfg(ossl320)] { |
1052 | #[repr (C)] |
1053 | pub struct SSL_CONN_CLOSE_INFO { |
1054 | pub error_code: u64, |
1055 | pub frame_type: u64, |
1056 | pub reason: *const ::libc::c_char, |
1057 | pub reason_len: usize, |
1058 | pub flags: u32, |
1059 | } |
1060 | #[repr (C)] |
1061 | pub struct SSL_SHUTDOWN_EX_ARGS { |
1062 | pub quic_error_code: u64, |
1063 | pub quic_reason: *const c_char, |
1064 | } |
1065 | #[repr (C)] |
1066 | pub struct SSL_STREAM_RESET_ARGS { |
1067 | pub quic_error_code: u64, |
1068 | } |
1069 | } |
1070 | } |
1071 | |
1072 | pub enum COMP_CTX {} |
1073 | |
1074 | cfg_if! { |
1075 | if #[cfg(any(ossl110, libressl350))] { |
1076 | pub enum COMP_METHOD {} |
1077 | } else { |
1078 | #[repr (C)] |
1079 | pub struct COMP_METHOD { |
1080 | pub type_: c_int, |
1081 | pub name: *const c_char, |
1082 | init: Option<unsafe extern "C" fn(*mut COMP_CTX) -> c_int>, |
1083 | finish: Option<unsafe extern "C" fn(*mut COMP_CTX)>, |
1084 | compress: Option< |
1085 | unsafe extern "C" fn( |
1086 | *mut COMP_CTX, |
1087 | *mut c_uchar, |
1088 | c_uint, |
1089 | *mut c_uchar, |
1090 | c_uint, |
1091 | ) -> c_int, |
1092 | >, |
1093 | expand: Option< |
1094 | unsafe extern "C" fn( |
1095 | *mut COMP_CTX, |
1096 | *mut c_uchar, |
1097 | c_uint, |
1098 | *mut c_uchar, |
1099 | c_uint, |
1100 | ) -> c_int, |
1101 | >, |
1102 | ctrl: Option<unsafe extern "C" fn() -> c_long>, |
1103 | callback_ctrl: Option<unsafe extern "C" fn() -> c_long>, |
1104 | } |
1105 | } |
1106 | } |
1107 | |
1108 | cfg_if! { |
1109 | if #[cfg(any(ossl110, libressl280))] { |
1110 | pub enum CRYPTO_EX_DATA {} |
1111 | } else if #[cfg(libressl)] { |
1112 | #[repr (C)] |
1113 | pub struct CRYPTO_EX_DATA { |
1114 | pub sk: *mut stack_st_void, |
1115 | } |
1116 | } else { |
1117 | #[repr (C)] |
1118 | pub struct CRYPTO_EX_DATA { |
1119 | pub sk: *mut stack_st_void, |
1120 | pub dummy: c_int, |
1121 | } |
1122 | } |
1123 | } |
1124 | |
1125 | pub enum OCSP_RESPONSE {} |
1126 | |
1127 | #[cfg (ossl300)] |
1128 | pub enum OSSL_PROVIDER {} |
1129 | |
1130 | #[cfg (ossl300)] |
1131 | pub enum OSSL_LIB_CTX {} |
1132 | |
1133 | #[cfg (ossl300)] |
1134 | #[repr (C)] |
1135 | pub struct OSSL_PARAM { |
1136 | key: *const c_char, |
1137 | data_type: c_uchar, |
1138 | data: *mut c_void, |
1139 | data_size: size_t, |
1140 | return_size: size_t, |
1141 | } |
1142 | |
1143 | #[cfg (ossl300)] |
1144 | pub enum EVP_KDF {} |
1145 | #[cfg (ossl300)] |
1146 | pub enum EVP_KDF_CTX {} |
1147 | |