diff --git a/openssl-sys/src/bio.rs b/openssl-sys/src/bio.rs index c1dc9356f..f6ec71d3b 100644 --- a/openssl-sys/src/bio.rs +++ b/openssl-sys/src/bio.rs @@ -89,7 +89,7 @@ cfg_if! { BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, ptr::null_mut()) as c_int } pub unsafe fn BIO_dgram_set_no_trunc(bio: *mut BIO, enable: c_int) -> c_int { - BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable, ptr::null_mut()) as c_int + BIO_ctrl(bio, BIO_CTRL_DGRAM_SET_NO_TRUNC, enable as c_long, ptr::null_mut()) as c_int } pub unsafe fn BIO_dgram_get_cap(bio: *mut BIO) -> u32 { BIO_ctrl(bio, BIO_CTRL_DGRAM_GET_CAPS, 0, ptr::null_mut()) as u32 diff --git a/openssl-sys/src/err.rs b/openssl-sys/src/err.rs index 4a6a2775e..a2c0f0fb9 100644 --- a/openssl-sys/src/err.rs +++ b/openssl-sys/src/err.rs @@ -9,8 +9,8 @@ pub const ERR_LIB_ASN1: c_int = 13; cfg_if! { if #[cfg(ossl300)] { - pub const ERR_SYSTEM_FLAG: c_ulong = c_int::max_value() as c_ulong + 1; - pub const ERR_SYSTEM_MASK: c_ulong = c_int::max_value() as c_ulong; + pub const ERR_SYSTEM_FLAG: c_ulong = c_int::MAX as c_ulong + 1; + pub const ERR_SYSTEM_MASK: c_ulong = c_int::MAX as c_ulong; pub const ERR_LIB_OFFSET: c_ulong = 23; pub const ERR_LIB_MASK: c_ulong = 0xff; diff --git a/openssl-sys/src/tls1.rs b/openssl-sys/src/tls1.rs index 2cb08a91f..7ff0b9df9 100644 --- a/openssl-sys/src/tls1.rs +++ b/openssl-sys/src/tls1.rs @@ -74,7 +74,16 @@ 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_callback_ctrl__fixed_rust( + ctx, + SSL_CTRL_SET_TLSEXT_SERVERNAME_CB, + mem::transmute::< + std::option::Option< + unsafe extern "C" fn(*mut SSL, *mut c_int, *mut libc::c_void) -> i32, + >, + std::option::Option, + >(cb), + ) } pub const SSL_TLSEXT_ERR_OK: c_int = 0; @@ -90,7 +99,14 @@ 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__fixed_rust( + ctx, + SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB, + mem::transmute::< + std::option::Option i32>, + std::option::Option, + >(cb), + ) } pub unsafe fn SSL_CTX_set_tlsext_status_arg(ctx: *mut SSL_CTX, arg: *mut c_void) -> c_long {