diff --git a/openssl-sys/build/run_bindgen.rs b/openssl-sys/build/run_bindgen.rs index 4fa9ec66f2..8d810112fc 100644 --- a/openssl-sys/build/run_bindgen.rs +++ b/openssl-sys/build/run_bindgen.rs @@ -208,28 +208,4 @@ impl ParseCallbacks for OpensslCallbacks { fn will_parse_macro(&self, _name: &str) -> MacroParsingBehavior { MacroParsingBehavior::Ignore } - - fn item_name(&self, original_item_name: &str) -> Option { - match original_item_name { - // Our original definitions of these are wrong, so rename to avoid breakage - "CRYPTO_EX_new" - | "CRYPTO_EX_dup" - | "CRYPTO_EX_free" - | "BIO_meth_set_write" - | "BIO_meth_set_read" - | "BIO_meth_set_puts" - | "BIO_meth_set_ctrl" - | "BIO_meth_set_create" - | "BIO_meth_set_destroy" - | "CRYPTO_set_locking_callback" - | "CRYPTO_set_id_callback" - | "SSL_CTX_set_tmp_dh_callback" - | "SSL_set_tmp_dh_callback" - | "SSL_CTX_set_tmp_ecdh_callback" - | "SSL_set_tmp_ecdh_callback" - | "SSL_CTX_callback_ctrl" - | "SSL_CTX_set_alpn_select_cb" => Some(format!("{}__fixed_rust", original_item_name)), - _ => None, - } - } } diff --git a/openssl-sys/src/bio.rs b/openssl-sys/src/bio.rs index ea6053b592..f2dea27e89 100644 --- a/openssl-sys/src/bio.rs +++ b/openssl-sys/src/bio.rs @@ -32,41 +32,54 @@ pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long { BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void) } -extern "C" { - #[deprecated(note = "use BIO_meth_set_write__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_write( - biom: *mut BIO_METHOD, - write: unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int, - ) -> c_int; - #[deprecated(note = "use BIO_meth_set_read__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_read( - biom: *mut BIO_METHOD, - read: unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int, - ) -> c_int; - #[deprecated(note = "use BIO_meth_set_puts__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_puts( - biom: *mut BIO_METHOD, - read: unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int, - ) -> c_int; - #[deprecated(note = "use BIO_meth_set_ctrl__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_ctrl( - biom: *mut BIO_METHOD, - read: unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long, - ) -> c_int; - #[deprecated(note = "use BIO_meth_set_create__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_create( - biom: *mut BIO_METHOD, - create: unsafe extern "C" fn(*mut BIO) -> c_int, - ) -> c_int; - #[deprecated(note = "use BIO_meth_set_destroy__fixed_rust instead")] - #[cfg(any(ossl110, libressl273))] - pub fn BIO_meth_set_destroy( - biom: *mut BIO_METHOD, - destroy: unsafe extern "C" fn(*mut BIO) -> c_int, - ) -> c_int; +// These symbols were originally bound with the wrong signatures. They were then +// deprecated in favor of `__fixed_rust`-suffixed versions. The unsuffixed +// symbols are now fixed, so the suffixed ones are deprecated aliases. +#[deprecated(note = "use BIO_meth_set_write instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_write__fixed_rust( + biom: *mut BIO_METHOD, + write: Option c_int>, +) -> c_int { + BIO_meth_set_write(biom, write) +} +#[deprecated(note = "use BIO_meth_set_read instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_read__fixed_rust( + biom: *mut BIO_METHOD, + read: Option c_int>, +) -> c_int { + BIO_meth_set_read(biom, read) +} +#[deprecated(note = "use BIO_meth_set_puts instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_puts__fixed_rust( + biom: *mut BIO_METHOD, + puts: Option c_int>, +) -> c_int { + BIO_meth_set_puts(biom, puts) +} +#[deprecated(note = "use BIO_meth_set_ctrl instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_ctrl__fixed_rust( + biom: *mut BIO_METHOD, + ctrl: Option c_long>, +) -> c_int { + BIO_meth_set_ctrl(biom, ctrl) +} +#[deprecated(note = "use BIO_meth_set_create instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_create__fixed_rust( + biom: *mut BIO_METHOD, + create: Option c_int>, +) -> c_int { + BIO_meth_set_create(biom, create) +} +#[deprecated(note = "use BIO_meth_set_destroy instead")] +#[cfg(any(ossl110, libressl273))] +pub unsafe fn BIO_meth_set_destroy__fixed_rust( + biom: *mut BIO_METHOD, + destroy: Option c_int>, +) -> c_int { + BIO_meth_set_destroy(biom, destroy) } diff --git a/openssl-sys/src/crypto.rs b/openssl-sys/src/crypto.rs index 35be07eada..17b07cd6ea 100644 --- a/openssl-sys/src/crypto.rs +++ b/openssl-sys/src/crypto.rs @@ -1,16 +1,20 @@ use super::*; use libc::*; -extern "C" { - #[deprecated(note = "use CRYPTO_set_locking_callback__fixed_rust instead")] - #[cfg(not(ossl110))] - pub fn CRYPTO_set_locking_callback( - func: unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int), - ); - - #[deprecated(note = "use CRYPTO_set_id_callback__fixed_rust instead")] - #[cfg(not(ossl110))] - pub fn CRYPTO_set_id_callback(func: unsafe extern "C" fn() -> c_ulong); +// These symbols were originally bound with the wrong signatures. They were then +// deprecated in favor of `__fixed_rust`-suffixed versions. The unsuffixed +// symbols are now fixed, so the suffixed ones are deprecated aliases. +#[cfg(not(ossl110))] +#[deprecated(note = "use CRYPTO_set_locking_callback instead")] +pub fn CRYPTO_set_locking_callback__fixed_rust( + func: Option, +) { + CRYPTO_set_locking_callback(func) +} +#[cfg(not(ossl110))] +#[deprecated(note = "use CRYPTO_set_id_callback instead")] +pub fn CRYPTO_set_id_callback__fixed_rust(func: Option c_ulong>) { + CRYPTO_set_id_callback(func) } cfg_if! { diff --git a/openssl-sys/src/handwritten/bio.rs b/openssl-sys/src/handwritten/bio.rs index 7d97522251..7e0e66b7aa 100644 --- a/openssl-sys/src/handwritten/bio.rs +++ b/openssl-sys/src/handwritten/bio.rs @@ -69,38 +69,32 @@ extern "C" { #[allow(clashing_extern_declarations)] extern "C" { #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_write"] - pub fn BIO_meth_set_write__fixed_rust( + pub fn BIO_meth_set_write( biom: *mut BIO_METHOD, write: Option c_int>, ) -> c_int; #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_read"] - pub fn BIO_meth_set_read__fixed_rust( + pub fn BIO_meth_set_read( biom: *mut BIO_METHOD, read: Option c_int>, ) -> c_int; #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_puts"] - pub fn BIO_meth_set_puts__fixed_rust( + pub fn BIO_meth_set_puts( biom: *mut BIO_METHOD, read: Option c_int>, ) -> c_int; #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_ctrl"] - pub fn BIO_meth_set_ctrl__fixed_rust( + pub fn BIO_meth_set_ctrl( biom: *mut BIO_METHOD, read: Option c_long>, ) -> c_int; #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_create"] - pub fn BIO_meth_set_create__fixed_rust( + pub fn BIO_meth_set_create( biom: *mut BIO_METHOD, create: Option c_int>, ) -> c_int; #[cfg(any(ossl110, libressl273))] - #[link_name = "BIO_meth_set_destroy"] - pub fn BIO_meth_set_destroy__fixed_rust( + pub fn BIO_meth_set_destroy( biom: *mut BIO_METHOD, destroy: Option c_int>, ) -> c_int; diff --git a/openssl-sys/src/handwritten/crypto.rs b/openssl-sys/src/handwritten/crypto.rs index 62ccbce1ec..4384057859 100644 --- a/openssl-sys/src/handwritten/crypto.rs +++ b/openssl-sys/src/handwritten/crypto.rs @@ -35,14 +35,12 @@ extern "C" { #[allow(clashing_extern_declarations)] extern "C" { #[cfg(not(ossl110))] - #[link_name = "CRYPTO_set_locking_callback"] - pub fn CRYPTO_set_locking_callback__fixed_rust( + pub fn CRYPTO_set_locking_callback( func: Option, ); #[cfg(not(ossl110))] - #[link_name = "CRYPTO_set_id_callback"] - pub fn CRYPTO_set_id_callback__fixed_rust(func: Option c_ulong>); + pub fn CRYPTO_set_id_callback(func: Option c_ulong>); } extern "C" { diff --git a/openssl-sys/src/handwritten/ssl.rs b/openssl-sys/src/handwritten/ssl.rs index d4f4b619f4..75efaf9a24 100644 --- a/openssl-sys/src/handwritten/ssl.rs +++ b/openssl-sys/src/handwritten/ssl.rs @@ -344,8 +344,7 @@ extern "C" { #[cfg(any(ossl102, libressl261))] pub fn SSL_set_alpn_protos(s: *mut SSL, data: *const c_uchar, len: c_uint) -> c_int; #[cfg(any(ossl102, libressl261))] - #[link_name = "SSL_CTX_set_alpn_select_cb"] - pub fn SSL_CTX_set_alpn_select_cb__fixed_rust( + pub fn SSL_CTX_set_alpn_select_cb( ssl: *mut SSL_CTX, cb: Option< unsafe extern "C" fn( @@ -670,8 +669,7 @@ extern "C" { ) -> c_int; pub fn SSL_ctrl(ssl: *mut SSL, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long; pub fn SSL_CTX_ctrl(ctx: *mut SSL_CTX, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long; - #[link_name = "SSL_CTX_callback_ctrl"] - pub fn SSL_CTX_callback_ctrl__fixed_rust( + pub fn SSL_CTX_callback_ctrl( ctx: *mut SSL_CTX, cmd: c_int, fp: Option, @@ -818,31 +816,27 @@ extern "C" { } extern "C" { - #[link_name = "SSL_CTX_set_tmp_dh_callback"] - pub fn SSL_CTX_set_tmp_dh_callback__fixed_rust( + pub fn SSL_CTX_set_tmp_dh_callback( ctx: *mut SSL_CTX, dh: Option< unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, >, ); - #[link_name = "SSL_set_tmp_dh_callback"] - pub fn SSL_set_tmp_dh_callback__fixed_rust( + pub fn SSL_set_tmp_dh_callback( ctx: *mut SSL, dh: Option< unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, >, ); #[cfg(not(ossl110))] - #[link_name = "SSL_CTX_set_tmp_ecdh_callback"] - pub fn SSL_CTX_set_tmp_ecdh_callback__fixed_rust( + pub fn SSL_CTX_set_tmp_ecdh_callback( ctx: *mut SSL_CTX, ecdh: Option< unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY, >, ); #[cfg(not(ossl110))] - #[link_name = "SSL_set_tmp_ecdh_callback"] - pub fn SSL_set_tmp_ecdh_callback__fixed_rust( + pub fn SSL_set_tmp_ecdh_callback( ssl: *mut SSL, ecdh: Option< unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY, diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index c3084755cc..b8d1e7d563 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -167,7 +167,7 @@ mod openssl { } unsafe { - CRYPTO_set_id_callback__fixed_rust(Some(thread_id)); + CRYPTO_set_id_callback(Some(thread_id)); } } } else { @@ -190,7 +190,7 @@ mod openssl { Box::new((0..num_locks).map(|_| None).collect()); GUARDS = mem::transmute(guards); - CRYPTO_set_locking_callback__fixed_rust(Some(locking_function)); + CRYPTO_set_locking_callback(Some(locking_function)); set_id_callback(); }) } diff --git a/openssl-sys/src/ssl.rs b/openssl-sys/src/ssl.rs index e812673333..9ed3a7a208 100644 --- a/openssl-sys/src/ssl.rs +++ b/openssl-sys/src/ssl.rs @@ -564,51 +564,57 @@ pub unsafe fn SSL_CTX_set_read_ahead(ctx: *mut SSL_CTX, m: c_long) -> c_long { SSL_CTX_ctrl(ctx, SSL_CTRL_SET_READ_AHEAD, m, ptr::null_mut()) } -#[allow(clashing_extern_declarations)] -extern "C" { - #[deprecated(note = "use SSL_CTX_set_tmp_dh_callback__fixed_rust instead")] - pub fn SSL_CTX_set_tmp_dh_callback( - ctx: *mut SSL_CTX, - dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, - ); - #[deprecated(note = "use SSL_set_tmp_dh_callback__fixed_rust instead")] - pub fn SSL_set_tmp_dh_callback( - ctx: *mut SSL, - dh: unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut DH, - ); - #[deprecated(note = "use SSL_CTX_set_tmp_ecdh_callback__fixed_rust instead")] - #[cfg(not(ossl110))] - pub fn SSL_CTX_set_tmp_ecdh_callback( - ctx: *mut SSL_CTX, - ecdh: unsafe extern "C" fn( - ssl: *mut SSL, - is_export: c_int, - keylength: c_int, - ) -> *mut EC_KEY, - ); - #[deprecated(note = "use SSL_set_tmp_ecdh_callback__fixed_rust instead")] - #[cfg(not(ossl110))] - pub fn SSL_set_tmp_ecdh_callback( - ssl: *mut SSL, - ecdh: unsafe extern "C" fn( - ssl: *mut SSL, - is_export: c_int, - keylength: c_int, - ) -> *mut EC_KEY, - ); - - #[deprecated(note = "use SSL_CTX_callback_ctrl__fixed_rust instead")] - pub fn SSL_CTX_callback_ctrl( - ctx: *mut SSL_CTX, - cmd: c_int, - fp: Option, - ) -> c_long; - - #[deprecated(note = "use SSL_CTX_set_alpn_select_cb__fixed_rust instead")] - #[cfg(any(ossl102, libressl261))] - pub fn SSL_CTX_set_alpn_select_cb( - ssl: *mut SSL_CTX, - cb: extern "C" fn( +// These symbols were originally bound with the wrong signatures. They were then +// deprecated in favor of `__fixed_rust`-suffixed versions. The unsuffixed +// symbols are now fixed, so the suffixed ones are deprecated aliases. +#[deprecated(note = "use SSL_CTX_set_tmp_dh_callback instead")] +pub unsafe fn SSL_CTX_set_tmp_dh_callback__fixed_rust( + ctx: *mut SSL_CTX, + dh: Option *mut DH>, +) { + SSL_CTX_set_tmp_dh_callback(ctx, dh) +} +#[deprecated(note = "use SSL_set_tmp_dh_callback instead")] +pub unsafe fn SSL_set_tmp_dh_callback__fixed_rust( + ctx: *mut SSL, + dh: Option *mut DH>, +) { + SSL_set_tmp_dh_callback(ctx, dh) +} +#[deprecated(note = "use SSL_CTX_set_tmp_ecdh_callback instead")] +#[cfg(not(ossl110))] +pub unsafe fn SSL_CTX_set_tmp_ecdh_callback__fixed_rust( + ctx: *mut SSL_CTX, + ecdh: Option< + unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY, + >, +) { + SSL_CTX_set_tmp_ecdh_callback(ctx, ecdh) +} +#[deprecated(note = "use SSL_set_tmp_ecdh_callback instead")] +#[cfg(not(ossl110))] +pub unsafe fn SSL_set_tmp_ecdh_callback__fixed_rust( + ssl: *mut SSL, + ecdh: Option< + unsafe extern "C" fn(ssl: *mut SSL, is_export: c_int, keylength: c_int) -> *mut EC_KEY, + >, +) { + SSL_set_tmp_ecdh_callback(ssl, ecdh) +} +#[deprecated(note = "use SSL_CTX_callback_ctrl instead")] +pub unsafe fn SSL_CTX_callback_ctrl__fixed_rust( + ctx: *mut SSL_CTX, + cmd: c_int, + fp: Option, +) -> c_long { + SSL_CTX_callback_ctrl(ctx, cmd, fp) +} +#[deprecated(note = "use SSL_CTX_set_alpn_select_cb instead")] +#[cfg(any(ossl102, libressl261))] +pub unsafe fn SSL_CTX_set_alpn_select_cb__fixed_rust( + ssl: *mut SSL_CTX, + cb: Option< + unsafe extern "C" fn( ssl: *mut SSL, out: *mut *const c_uchar, outlen: *mut c_uchar, @@ -616,8 +622,10 @@ extern "C" { inlen: c_uint, arg: *mut c_void, ) -> c_int, - arg: *mut c_void, - ); + >, + arg: *mut c_void, +) { + SSL_CTX_set_alpn_select_cb(ssl, cb, arg) } #[cfg(not(ossl110))] diff --git a/openssl-sys/src/tls1.rs b/openssl-sys/src/tls1.rs index 2cb08a91f3..169e935456 100644 --- a/openssl-sys/src/tls1.rs +++ b/openssl-sys/src/tls1.rs @@ -60,21 +60,19 @@ pub unsafe fn SSL_set_tlsext_status_ocsp_resp( ) } -#[deprecated(note = "use SSL_CTX_set_tlsext_servername_callback__fixed_rust instead")] -#[allow(deprecated)] pub unsafe fn SSL_CTX_set_tlsext_servername_callback( ctx: *mut SSL_CTX, - // FIXME should have the right signature - cb: Option, + cb: Option c_int>, ) -> c_long { - SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, cb) + SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, mem::transmute(cb)) } +#[deprecated(note = "use SSL_CTX_set_tlsext_servername_callback instead")] pub unsafe fn SSL_CTX_set_tlsext_servername_callback__fixed_rust( ctx: *mut SSL_CTX, cb: Option c_int>, ) -> c_long { - SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, mem::transmute(cb)) + SSL_CTX_set_tlsext_servername_callback(ctx, cb) } pub const SSL_TLSEXT_ERR_OK: c_int = 0; @@ -90,7 +88,7 @@ pub unsafe fn SSL_CTX_set_tlsext_status_cb( ctx: *mut SSL_CTX, cb: Option c_int>, ) -> c_long { - SSL_CTX_callback_ctrl__fixed_rust(ctx, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, mem::transmute(cb)) + SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, mem::transmute(cb)) } pub unsafe fn SSL_CTX_set_tlsext_status_arg(ctx: *mut SSL_CTX, arg: *mut c_void) -> c_long { diff --git a/openssl/src/ssl/bio.rs b/openssl/src/ssl/bio.rs index 36cea23fdc..be3c48a3db 100644 --- a/openssl/src/ssl/bio.rs +++ b/openssl/src/ssl/bio.rs @@ -205,12 +205,12 @@ cfg_if! { unsafe { let ptr = cvt_p(ffi::BIO_meth_new(ffi::BIO_TYPE_NONE, b"rust\0".as_ptr() as *const _))?; let method = BIO_METHOD(ptr); - cvt(ffi::BIO_meth_set_write__fixed_rust(method.0, Some(bwrite::)))?; - cvt(ffi::BIO_meth_set_read__fixed_rust(method.0, Some(bread::)))?; - cvt(ffi::BIO_meth_set_puts__fixed_rust(method.0, Some(bputs::)))?; - cvt(ffi::BIO_meth_set_ctrl__fixed_rust(method.0, Some(ctrl::)))?; - cvt(ffi::BIO_meth_set_create__fixed_rust(method.0, Some(create)))?; - cvt(ffi::BIO_meth_set_destroy__fixed_rust(method.0, Some(destroy::)))?; + cvt(ffi::BIO_meth_set_write(method.0, Some(bwrite::)))?; + cvt(ffi::BIO_meth_set_read(method.0, Some(bread::)))?; + cvt(ffi::BIO_meth_set_puts(method.0, Some(bputs::)))?; + cvt(ffi::BIO_meth_set_ctrl(method.0, Some(ctrl::)))?; + cvt(ffi::BIO_meth_set_create(method.0, Some(create)))?; + cvt(ffi::BIO_meth_set_destroy(method.0, Some(destroy::)))?; Ok(method) } } diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 0feaced213..b2559aec30 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -777,13 +777,7 @@ impl SslContextBuilder { // still stored in ex data to manage the lifetime. let arg = self.set_ex_data_inner(SslContext::cached_ex_index::(), callback); ffi::SSL_CTX_set_tlsext_servername_arg(self.as_ptr(), arg); - #[cfg(boringssl)] ffi::SSL_CTX_set_tlsext_servername_callback(self.as_ptr(), Some(raw_sni::)); - #[cfg(not(boringssl))] - ffi::SSL_CTX_set_tlsext_servername_callback__fixed_rust( - self.as_ptr(), - Some(raw_sni::), - ); } } @@ -863,9 +857,6 @@ impl SslContextBuilder { unsafe { self.set_ex_data(SslContext::cached_ex_index::(), callback); - #[cfg(not(boringssl))] - ffi::SSL_CTX_set_tmp_dh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_dh::)); - #[cfg(boringssl)] ffi::SSL_CTX_set_tmp_dh_callback(self.as_ptr(), Some(raw_tmp_dh::)); } } @@ -893,7 +884,7 @@ impl SslContextBuilder { { unsafe { self.set_ex_data(SslContext::cached_ex_index::(), callback); - ffi::SSL_CTX_set_tmp_ecdh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_ecdh::)); + ffi::SSL_CTX_set_tmp_ecdh_callback(self.as_ptr(), Some(raw_tmp_ecdh::)); } } @@ -1266,7 +1257,7 @@ impl SslContextBuilder { { unsafe { self.set_ex_data(SslContext::cached_ex_index::(), callback); - ffi::SSL_CTX_set_alpn_select_cb__fixed_rust( + ffi::SSL_CTX_set_alpn_select_cb( self.as_ptr(), Some(callbacks::raw_alpn_select::), ptr::null_mut(), @@ -2394,10 +2385,7 @@ impl SslRef { unsafe { // this needs to be in an Arc since the callback can register a new callback! self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback)); - #[cfg(boringssl)] ffi::SSL_set_tmp_dh_callback(self.as_ptr(), Some(raw_tmp_dh_ssl::)); - #[cfg(not(boringssl))] - ffi::SSL_set_tmp_dh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_dh_ssl::)); } } @@ -2422,7 +2410,7 @@ impl SslRef { unsafe { // this needs to be in an Arc since the callback can register a new callback! self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback)); - ffi::SSL_set_tmp_ecdh_callback__fixed_rust(self.as_ptr(), Some(raw_tmp_ecdh_ssl::)); + ffi::SSL_set_tmp_ecdh_callback(self.as_ptr(), Some(raw_tmp_ecdh_ssl::)); } }