Skip to content

Commit

Permalink
Add NO RENEGOTIATION option
Browse files Browse the repository at this point in the history
SSL_OP_NO_RENEGOTIATION was added in OpenSSLv1.1.1 and backported to
v1.1.0h.
  • Loading branch information
kubo39 committed Jan 27, 2020
1 parent bb1cf5e commit 9189b67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openssl-sys/build/cfgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if openssl_version >= 0x1_01_00_07_0 {
cfgs.push("ossl110g");
}
if openssl_version >= 0x1_01_00_08_0 {
cfgs.push("ossl110h");
}
if openssl_version >= 0x1_01_01_00_0 {
cfgs.push("ossl111");
}
Expand Down
3 changes: 3 additions & 0 deletions openssl-sys/src/ssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x08000000;
#[cfg(ossl111)]
pub const SSL_OP_NO_TLSv1_3: c_ulong = 0x20000000;

#[cfg(ossl110h)]
pub const SSL_OP_NO_RENEGOTIATION: c_ulong = 0x40000000;

cfg_if! {
if #[cfg(ossl111)] {
pub const SSL_OP_NO_SSL_MASK: c_ulong = SSL_OP_NO_SSLv2
Expand Down
6 changes: 6 additions & 0 deletions openssl/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ bitflags! {
#[cfg(any(ossl102, ossl110))]
const NO_SSL_MASK = ffi::SSL_OP_NO_SSL_MASK;

/// Disallow all renegotiation in TLSv1.2 and earlier.
///
/// Requires OpenSSL 1.1.0h or newer.
#[cfg(ossl110h)]
const NO_RENEGOTIATION = ffi::SSL_OP_NO_RENEGOTIATION;

/// Enable TLSv1.3 Compatibility mode.
///
/// Requires OpenSSL 1.1.1 or newer. This is on by default in 1.1.1, but a future version
Expand Down

0 comments on commit 9189b67

Please sign in to comment.