gmssl_sys/handwritten/
types.rs

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