Unverified Commit 1325ecf4 authored by Steven Fackler's avatar Steven Fackler
Browse files

deprecate ffi functions with bad signatures

parent 705a0224
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -33,32 +33,37 @@ pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long {
}

extern "C" {
    // FIXME should wrap in Option
    #[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,
+2 −0
Original line number Diff line number Diff line
@@ -2,11 +2,13 @@ use libc::*;
use *;

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);
}
+0 −1
Original line number Diff line number Diff line
@@ -343,7 +343,6 @@ extern "C" {
    pub fn SSL_CTX_set_alpn_protos(s: *mut SSL_CTX, data: *const c_uchar, len: c_uint) -> c_int;
    #[cfg(any(ossl102, libressl261))]
    pub fn SSL_set_alpn_protos(s: *mut SSL, data: *const c_uchar, len: c_uint) -> c_int;
    // FIXME should take an Option<unsafe extern "C" fn>
    #[cfg(any(ossl102, libressl261))]
    #[link_name = "SSL_CTX_set_alpn_select_cb"]
    pub fn SSL_CTX_set_alpn_select_cb__fixed_rust(
+6 −0
Original line number Diff line number Diff line
@@ -551,14 +551,17 @@ pub unsafe fn SSL_CTX_set_read_ahead(ctx: *mut SSL_CTX, m: c_long) -> c_long {

#[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,
@@ -568,6 +571,7 @@ extern "C" {
            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,
@@ -578,12 +582,14 @@ extern "C" {
        ) -> *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<extern "C" fn()>,
    ) -> c_long;

    #[deprecated(note = "use SSL_CTX_set_alpn_select_cb instead")]
    #[cfg(any(ossl102, libressl261))]
    pub fn SSL_CTX_set_alpn_select_cb(
        ssl: *mut SSL_CTX,
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ 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