From d2c54348a58214613f7ed07270801a28ea58ee20 Mon Sep 17 00:00:00 2001 From: Hyeonu Park Date: Mon, 16 Nov 2020 20:13:31 +0900 Subject: [PATCH] Add AEAD SRTP protection profiles --- openssl-sys/src/srtp.rs | 6 ++++++ openssl/src/srtp.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/openssl-sys/src/srtp.rs b/openssl-sys/src/srtp.rs index d31aa06e7..d39b2ab6d 100644 --- a/openssl-sys/src/srtp.rs +++ b/openssl-sys/src/srtp.rs @@ -9,6 +9,12 @@ pub const SRTP_AES128_F8_SHA1_32: c_ulong = 0x0004; pub const SRTP_NULL_SHA1_80: c_ulong = 0x0005; pub const SRTP_NULL_SHA1_32: c_ulong = 0x0006; +/* AEAD SRTP protection profiles from RFC 7714 */ +#[cfg(ossl110)] +pub const SRTP_AEAD_AES_128_GCM: c_ulong = 0x0007; +#[cfg(ossl110)] +pub const SRTP_AEAD_AES_256_GCM: c_ulong = 0x0008; + extern "C" { pub fn SSL_CTX_set_tlsext_use_srtp(ctx: *mut SSL_CTX, profiles: *const c_char) -> c_int; pub fn SSL_set_tlsext_use_srtp(ssl: *mut SSL, profiles: *const c_char) -> c_int; diff --git a/openssl/src/srtp.rs b/openssl/src/srtp.rs index aef793c86..b5e38b7bc 100644 --- a/openssl/src/srtp.rs +++ b/openssl/src/srtp.rs @@ -44,6 +44,10 @@ impl SrtpProfileId { pub const SRTP_AES128_F8_SHA1_32: SrtpProfileId = SrtpProfileId(ffi::SRTP_AES128_F8_SHA1_32); pub const SRTP_NULL_SHA1_80: SrtpProfileId = SrtpProfileId(ffi::SRTP_NULL_SHA1_80); pub const SRTP_NULL_SHA1_32: SrtpProfileId = SrtpProfileId(ffi::SRTP_NULL_SHA1_32); + #[cfg(ossl110)] + pub const SRTP_AEAD_AES_128_GCM: SrtpProfileId = SrtpProfileId(ffi::SRTP_AEAD_AES_128_GCM); + #[cfg(ossl110)] + pub const SRTP_AEAD_AES_256_GCM: SrtpProfileId = SrtpProfileId(ffi::SRTP_AEAD_AES_256_GCM); /// Creates a `SrtpProfileId` from an integer representation. pub fn from_raw(value: c_ulong) -> SrtpProfileId { -- GitLab