Skip to content

Commit

Permalink
chore: simplify cfg attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 19, 2023
1 parent 8ab3c3f commit 9784356
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions openssl/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ impl AlpnError {
/// Terminate the handshake with a fatal alert.
///
/// Requires OpenSSL 1.1.0 or newer.
#[cfg(any(ossl110))]
#[cfg(ossl110)]
pub const ALERT_FATAL: AlpnError = AlpnError(ffi::SSL_TLSEXT_ERR_ALERT_FATAL);

/// Do not select a protocol, but continue the handshake.
Expand Down Expand Up @@ -2413,7 +2413,7 @@ impl SslRef {
///
/// Requires OpenSSL 1.0.1 or 1.0.2.
#[corresponds(SSL_set_tmp_ecdh_callback)]
#[cfg(any(all(ossl101, not(ossl110))))]
#[cfg(all(ossl101, not(ossl110)))]
#[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")]
pub fn set_tmp_ecdh_callback<F>(&mut self, callback: F)
where
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/ssl/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ fn test_alpn_server_advertise_multiple() {
}

#[test]
#[cfg(any(ossl110))]
#[cfg(ossl110)]
fn test_alpn_server_select_none_fatal() {
let mut server = Server::builder();
server.ctx().set_alpn_select_callback(|_, client| {
Expand Down
4 changes: 2 additions & 2 deletions openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ mod tests {
}

#[test]
#[cfg(any(ossl110))]
#[cfg(ossl110)]
fn test_chacha20() {
let key = "0000000000000000000000000000000000000000000000000000000000000000";
let iv = "00000000000000000000000000000000";
Expand All @@ -1493,7 +1493,7 @@ mod tests {
}

#[test]
#[cfg(any(ossl110))]
#[cfg(ossl110)]
fn test_chacha20_poly1305() {
let key = "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f";
let iv = "070000004041424344454647";
Expand Down

0 comments on commit 9784356

Please sign in to comment.