diff --git a/openssl-sys/src/handwritten/ssl.rs b/openssl-sys/src/handwritten/ssl.rs index 367d9c976a..13d0e59f6d 100644 --- a/openssl-sys/src/handwritten/ssl.rs +++ b/openssl-sys/src/handwritten/ssl.rs @@ -520,6 +520,7 @@ const_ptr_api! { } } extern "C" { + #[cfg(any(not(ossl102), libressl273, not(boringssl)))] pub fn SSL_CIPHER_find(ssl: *mut SSL, ptr: *const c_uchar) -> *const SSL_CIPHER; #[cfg(ossl111)] pub fn SSL_CIPHER_get_handshake_digest(cipher: *const SSL_CIPHER) -> *const EVP_MD; @@ -576,6 +577,7 @@ extern "C" { pub fn SSL_state_string(ssl: *const SSL) -> *const c_char; pub fn SSL_state_string_long(ssl: *const SSL) -> *const c_char; + #[cfg(not(boringssl))] pub fn SSL_SESSION_new() -> *mut SSL_SESSION; pub fn SSL_SESSION_get_time(s: *const SSL_SESSION) -> c_long; pub fn SSL_SESSION_get_timeout(s: *const SSL_SESSION) -> c_long; @@ -835,7 +837,7 @@ extern "C" { out: *mut c_uchar, outlen: size_t, ) -> size_t; - #[cfg(any(ossl110, libressl273))] + #[cfg(ossl111)] pub fn SSL_SESSION_set1_master_key( session: *mut SSL_SESSION, key: *const c_uchar, diff --git a/openssl/src/ssl/callbacks.rs b/openssl/src/ssl/callbacks.rs index 0e9a19b080..c313cf3cfb 100644 --- a/openssl/src/ssl/callbacks.rs +++ b/openssl/src/ssl/callbacks.rs @@ -274,6 +274,7 @@ where } } +#[cfg(ossl111)] struct Psk(Vec); #[cfg(ossl111)] diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 6f257611d8..8e40c17273 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -2028,6 +2028,7 @@ impl SslCipherRef { /// Returns an SslCipher matching the two-byte TLS cipher ID (allocated by the IANA, in network /// byte order). #[corresponds(SSL_CIPHER_find)] + #[cfg(not(boringssl))] pub fn find<'a>(ssl: &'a SslRef, cipher_id: &[u8]) -> Option<&'a SslCipherRef> { if cipher_id.len() != 2 { return None; @@ -2182,8 +2183,10 @@ impl SslSession { } /// A builder for `SslSession`s. +#[cfg(not(boringssl))] pub struct SslSessionBuilder(SslSession); +#[cfg(not(boringssl))] impl SslSessionBuilder { /// Creates a new `SslSessionBuilder`. #[corresponds(SSL_SESSION_new)] @@ -2221,6 +2224,7 @@ impl SslSessionBuilder { /// This could be used to set up a session-based PSK. You must ensure the length of the key is /// suitable for the ciphersuite associated with the session. #[corresponds(SSL_SESSION_set1_master_key)] + #[cfg(ossl111)] pub fn set_master_key(&mut self, key: &[u8]) -> Result<(), ErrorStack> { unsafe { cvt(ffi::SSL_SESSION_set1_master_key( diff --git a/openssl/src/ssl/test/mod.rs b/openssl/src/ssl/test/mod.rs index 84c3d3c9ab..7f2b9425a8 100644 --- a/openssl/src/ssl/test/mod.rs +++ b/openssl/src/ssl/test/mod.rs @@ -1424,7 +1424,7 @@ fn psk_ciphers() { } #[test] -#[cfg(ossl111)] +#[cfg(all(ossl111, not(libressl380), not(boringssl)))] fn psk_tls13_callbacks() { use crate::ssl::{SslCipherRef, SslSession, SslSessionBuilder, SslVersion}; @@ -1651,6 +1651,7 @@ fn set_num_tickets() { } #[test] +#[cfg(any(ossl110, libressl273))] fn ssl_cipher_find() { use crate::ssl::SslCipherRef;