aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2018-08-19 20:02:00 -0700
committerGitHub <[email protected]>2018-08-19 20:02:00 -0700
commitb1d01fbc0c8d3ea4742817139d022c6e53a60b19 (patch)
treef2ba96394bb573c5f9559ad66942159b7b109f8f /openssl-sys/src
parentMerge pull request #975 from eun-ice/master (diff)
parentSRTP cleanup (diff)
downloadrust-openssl-b1d01fbc0c8d3ea4742817139d022c6e53a60b19.tar.xz
rust-openssl-b1d01fbc0c8d3ea4742817139d022c6e53a60b19.zip
Merge pull request #978 from sfackler/srtp-cleanup
SRTP cleanup
Diffstat (limited to 'openssl-sys/src')
-rw-r--r--openssl-sys/src/lib.rs8
-rw-r--r--openssl-sys/src/libressl/mod.rs7
-rw-r--r--openssl-sys/src/openssl/v10x.rs101
-rw-r--r--openssl-sys/src/openssl/v110.rs13
4 files changed, 82 insertions, 47 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs
index eeb664d5..2433e624 100644
--- a/openssl-sys/src/lib.rs
+++ b/openssl-sys/src/lib.rs
@@ -197,9 +197,6 @@ pub struct SRTP_PROTECTION_PROFILE {
pub id: c_ulong,
}
-/// fake free method, since SRTP_PROTECTION_PROFILE is static
-pub unsafe fn SRTP_PROTECTION_PROFILE_free(_profile: *mut SRTP_PROTECTION_PROFILE) {}
-
pub type SHA_LONG = c_uint;
pub type SHA_LONG64 = u64;
@@ -2899,4 +2896,9 @@ extern "C" {
pub fn SSL_set_connect_state(s: *mut SSL);
pub fn SSL_set_accept_state(s: *mut SSL);
+
+ pub fn SSL_set_tlsext_use_srtp(ssl: *mut ::SSL, profiles: *const c_char) -> c_int;
+ pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut ::SSL_CTX, profiles: *const c_char) -> c_int;
+ pub fn SSL_get_srtp_profiles(ssl: *mut ::SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
+ pub fn SSL_get_selected_srtp_profile(ssl: *mut ::SSL) -> *mut SRTP_PROTECTION_PROFILE;
}
diff --git a/openssl-sys/src/libressl/mod.rs b/openssl-sys/src/libressl/mod.rs
index 6de87eba..8a77e55d 100644
--- a/openssl-sys/src/libressl/mod.rs
+++ b/openssl-sys/src/libressl/mod.rs
@@ -10,7 +10,6 @@ pub use libressl::v250::*;
pub use libressl::v251::*;
#[cfg(libressl273)]
pub use libressl::v273::*;
-use SRTP_PROTECTION_PROFILE;
#[cfg(not(libressl251))]
mod v250;
@@ -68,7 +67,6 @@ pub struct stack_st_SRTP_PROTECTION_PROFILE {
pub stack: _STACK,
}
-
#[repr(C)]
pub struct _STACK {
pub num: c_int,
@@ -639,9 +637,4 @@ extern "C" {
pub fn SSLeay() -> c_ulong;
pub fn SSLeay_version(key: c_int) -> *const c_char;
-
- pub fn SSL_set_tlsext_use_srtp(ssl: *mut ::SSL, profiles: *const c_char) -> c_int;
- pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut ::SSL_CTX, profiles: *const c_char) -> c_int;
- pub fn SSL_get_srtp_profiles(ssl: *mut ::SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
- pub fn SSL_get_selected_srtp_profile(ssl: *mut ::SSL) -> *mut SRTP_PROTECTION_PROFILE;
}
diff --git a/openssl-sys/src/openssl/v10x.rs b/openssl-sys/src/openssl/v10x.rs
index 6816f748..df127d30 100644
--- a/openssl-sys/src/openssl/v10x.rs
+++ b/openssl-sys/src/openssl/v10x.rs
@@ -4,7 +4,6 @@ use std::process;
use std::ptr;
use std::sync::{Mutex, MutexGuard};
use std::sync::{Once, ONCE_INIT};
-use SRTP_PROTECTION_PROFILE;
#[cfg(ossl102)]
use libc::time_t;
@@ -55,7 +54,6 @@ pub struct stack_st_OPENSSL_STRING {
pub stack: _STACK,
}
-
#[repr(C)]
pub struct stack_st_SRTP_PROTECTION_PROFILE {
pub stack: _STACK,
@@ -433,13 +431,25 @@ pub struct SSL {
tlsext_ocsp_resplen: c_int,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
tlsext_ticket_expected: c_int,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ecpointformatlist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ecpointformatlist: *mut c_uchar,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ellipticcurvelist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ellipticcurvelist: *mut c_uchar,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
tlsext_opaque_prf_input: *mut c_void,
@@ -457,9 +467,15 @@ pub struct SSL {
tls_session_secret_cb_arg: *mut c_void,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
initial_ctx: *mut ::SSL_CTX,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_proto_negotiated: *mut c_uchar,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_proto_negotiated_len: c_uchar,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
srtp_profiles: *mut c_void,
@@ -569,13 +585,25 @@ pub struct SSL_CTX {
#[cfg(not(osslconf = "OPENSSL_NO_SRP"))]
srp_ctx: SRP_CTX,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_protos_advertised_cb: *mut c_void,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_protos_advertised_cb_arg: *mut c_void,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_proto_select_cb: *mut c_void,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_NEXTPROTONEG")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_NEXTPROTONEG")
+ ))]
next_proto_select_cb_arg: *mut c_void,
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl101))]
@@ -589,13 +617,29 @@ pub struct SSL_CTX {
#[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), ossl102))]
alpn_client_proto_list_len: c_uint,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC"), ossl102))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC"),
+ ossl102
+ ))]
tlsext_ecpointformatlist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC"), ossl102))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC"),
+ ossl102
+ ))]
tlsext_ecpointformatlist: *mut c_uchar,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC"), ossl102))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC"),
+ ossl102
+ ))]
tlsext_ellipticcurvelist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC"), ossl102))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC"),
+ ossl102
+ ))]
tlsext_ellipticcurvelist: *mut c_uchar,
}
@@ -634,13 +678,25 @@ pub struct SSL_SESSION {
next: *mut c_void,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
tlsext_hostname: *mut c_char,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ecpointformatlist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ecpointformatlist: *mut c_uchar,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ellipticcurvelist_length: size_t,
- #[cfg(all(not(osslconf = "OPENSSL_NO_TLSEXT"), not(osslconf = "OPENSSL_NO_EC")))]
+ #[cfg(all(
+ not(osslconf = "OPENSSL_NO_TLSEXT"),
+ not(osslconf = "OPENSSL_NO_EC")
+ ))]
tlsext_ellipticcurvelist: *mut c_uchar,
#[cfg(not(osslconf = "OPENSSL_NO_TLSEXT"))]
tlsext_tick: *mut c_uchar,
@@ -1009,9 +1065,4 @@ extern "C" {
#[cfg(ossl102)]
pub fn SSL_extension_supported(ext_type: c_uint) -> c_int;
-
- pub fn SSL_set_tlsext_use_srtp(ssl: *mut ::SSL, profiles: *const c_char) -> c_int;
- pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut ::SSL_CTX, profiles: *const c_char) -> c_int;
- pub fn SSL_get_srtp_profiles(ssl: *mut ::SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
- pub fn SSL_get_selected_srtp_profile(ssl: *mut ::SSL) -> *mut SRTP_PROTECTION_PROFILE;
}
diff --git a/openssl-sys/src/openssl/v110.rs b/openssl-sys/src/openssl/v110.rs
index b3bca4a2..c86a863a 100644
--- a/openssl-sys/src/openssl/v110.rs
+++ b/openssl-sys/src/openssl/v110.rs
@@ -1,7 +1,6 @@
use libc::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_void, size_t};
use std::ptr;
use std::sync::{Once, ONCE_INIT};
-use SRTP_PROTECTION_PROFILE;
pub enum BIGNUM {}
pub enum BIO {}
@@ -142,7 +141,6 @@ pub unsafe fn SSL_get_max_proto_version(s: *mut ::SSL) -> c_int {
::SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, ptr::null_mut()) as c_int
}
-
extern "C" {
pub fn BIO_new(type_: *const BIO_METHOD) -> *mut BIO;
pub fn BIO_s_file() -> *const BIO_METHOD;
@@ -251,11 +249,7 @@ extern "C" {
pub_key: *mut *const ::BIGNUM,
priv_key: *mut *const ::BIGNUM,
);
- pub fn DSA_set0_key(
- d: *mut ::DSA,
- pub_key: *mut ::BIGNUM,
- priv_key: *mut ::BIGNUM,
- ) -> c_int;
+ pub fn DSA_set0_key(d: *mut ::DSA, pub_key: *mut ::BIGNUM, priv_key: *mut ::BIGNUM) -> c_int;
pub fn RSA_get0_key(
r: *const ::RSA,
n: *mut *const ::BIGNUM,
@@ -395,9 +389,4 @@ extern "C" {
pub fn SSL_CIPHER_get_cipher_nid(c: *const ::SSL_CIPHER) -> c_int;
pub fn SSL_CIPHER_get_digest_nid(c: *const ::SSL_CIPHER) -> c_int;
-
- pub fn SSL_set_tlsext_use_srtp(ssl: *mut ::SSL, profiles: *const c_char) -> c_int;
- pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut ::SSL_CTX, profiles: *const c_char) -> c_int;
- pub fn SSL_get_srtp_profiles(ssl: *mut ::SSL) -> *mut stack_st_SRTP_PROTECTION_PROFILE;
- pub fn SSL_get_selected_srtp_profile(ssl: *mut ::SSL) -> *mut SRTP_PROTECTION_PROFILE;
}