diff options
| author | Steven Fackler <[email protected]> | 2018-02-15 19:55:20 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-02-15 19:55:20 -0800 |
| commit | 3db28a1e1279c1117d439d52dc2a159d94353222 (patch) | |
| tree | 7fae739c5340afb3ce177f782f8b9c5c8c104283 /openssl-sys | |
| parent | Merge pull request #838 from olehermanse/master (diff) | |
| parent | Tweak features (diff) | |
| download | rust-openssl-3db28a1e1279c1117d439d52dc2a159d94353222.tar.xz rust-openssl-3db28a1e1279c1117d439d52dc2a159d94353222.zip | |
Merge pull request #839 from sfackler/openssl111
OpenSSL 1.1.1 support
Diffstat (limited to 'openssl-sys')
| -rw-r--r-- | openssl-sys/build.rs | 15 | ||||
| -rw-r--r-- | openssl-sys/src/lib.rs | 18 |
2 files changed, 23 insertions, 10 deletions
diff --git a/openssl-sys/build.rs b/openssl-sys/build.rs index 3d682962..7df226f2 100644 --- a/openssl-sys/build.rs +++ b/openssl-sys/build.rs @@ -343,8 +343,10 @@ RUST_LIBRESSL_251 RUST_LIBRESSL_250 #elif defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20500000 RUST_LIBRESSL_OLD -#elif OPENSSL_VERSION_NUMBER >= 0x10101000 +#elif OPENSSL_VERSION_NUMBER >= 0x10102000 RUST_OPENSSL_NEW +#elif OPENSSL_VERSION_NUMBER >= 0x10101000 +RUST_OPENSSL_111 #elif OPENSSL_VERSION_NUMBER >= 0x10100060 RUST_OPENSSL_110F #elif OPENSSL_VERSION_NUMBER >= 0x10100000 @@ -471,6 +473,11 @@ See rust-openssl README for more information: println!("cargo:libressl_version=26x"); println!("cargo:version=101"); Version::Libressl + } else if expanded.contains("RUST_OPENSSL_111") { + println!("cargo:rustc-cfg=ossl111"); + println!("cargo:rustc-cfg=ossl110"); + println!("cargo:version=111"); + Version::Openssl110 } else if expanded.contains("RUST_OPENSSL_110F") { println!("cargo:rustc-cfg=ossl110"); println!("cargo:rustc-cfg=ossl110f"); @@ -493,9 +500,9 @@ See rust-openssl README for more information: panic!( " -This crate is only compatible with OpenSSL 1.0.1, 1.0.2, and 1.1.0, or LibreSSL -2.5 and 2.6.0, but a different version of OpenSSL was found. The build is now -aborting due to this version mismatch. +This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 +and 2.6, but a different version of OpenSSL was found. The build is now aborting +due to this version mismatch. " ); diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 52b5eda4..c26d254c 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -1255,9 +1255,9 @@ pub const SSL_OP_CRYPTOPRO_TLSEXT_BUG: c_ulong = 0x0; pub const SSL_OP_LEGACY_SERVER_CONNECT: c_ulong = 0x00000004; #[cfg(not(libressl))] pub const SSL_OP_SAFARI_ECDHE_ECDSA_BUG: c_ulong = 0x00000040; -#[cfg(not(any(libressl, ossl110f)))] +#[cfg(not(any(libressl, ossl110f, ossl111)))] pub const SSL_OP_ALL: c_ulong = 0x80000BFF; -#[cfg(ossl110f)] +#[cfg(any(ossl110f, ossl111))] pub const SSL_OP_ALL: c_ulong = SSL_OP_CRYPTOPRO_TLSEXT_BUG | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | SSL_OP_LEGACY_SERVER_CONNECT | SSL_OP_TLSEXT_PADDING | SSL_OP_SAFARI_ECDHE_ECDSA_BUG; @@ -1276,16 +1276,22 @@ pub const SSL_OP_TLS_ROLLBACK_BUG: c_ulong = 0x00800000; #[cfg(not(libressl))] pub const SSL_OP_NO_SSLv3: c_ulong = 0x02000000; pub const SSL_OP_NO_TLSv1: c_ulong = 0x04000000; -pub const SSL_OP_NO_TLSv1_2: c_ulong = 0x08000000; pub const SSL_OP_NO_TLSv1_1: c_ulong = 0x10000000; +pub const SSL_OP_NO_TLSv1_2: c_ulong = 0x08000000; +#[cfg(ossl111)] +pub const SSL_OP_NO_TLSv1_3: c_ulong = 0x20000000; #[cfg(not(any(ossl101, libressl)))] pub const SSL_OP_NO_DTLSv1: c_ulong = 0x04000000; #[cfg(not(any(ossl101, libressl)))] pub const SSL_OP_NO_DTLSv1_2: c_ulong = 0x08000000; -#[cfg(not(any(ossl101, libressl)))] +#[cfg(not(any(ossl101, libressl, ossl111)))] pub const SSL_OP_NO_SSL_MASK: c_ulong = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2; +#[cfg(ossl111)] +pub const SSL_OP_NO_SSL_MASK: c_ulong = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 + | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2 + | SSL_OP_NO_TLSv1_3; pub const SSL_FILETYPE_PEM: c_int = X509_FILETYPE_PEM; pub const SSL_FILETYPE_ASN1: c_int = X509_FILETYPE_ASN1; @@ -2498,9 +2504,9 @@ extern "C" { ); pub fn SSL_get_session(s: *const SSL) -> *mut SSL_SESSION; pub fn SSL_set_session(ssl: *mut SSL, session: *mut SSL_SESSION) -> c_int; - #[cfg(not(any(ossl101, libressl, ossl110f)))] + #[cfg(not(any(ossl101, libressl, ossl110f, ossl111)))] pub fn SSL_is_server(s: *mut SSL) -> c_int; - #[cfg(ossl110f)] + #[cfg(any(ossl110f, ossl111))] pub fn SSL_is_server(s: *const SSL) -> c_int; pub fn SSL_SESSION_free(s: *mut SSL_SESSION); |