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