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