Skip to content

Commit f27a037

Browse files
committed
remove some deprecated methods
1 parent 788fc5f commit f27a037

File tree

4 files changed

+0
-147
lines changed

4 files changed

+0
-147
lines changed

openssl/Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ keywords = ["crypto", "tls", "ssl", "dtls"]
99
categories = ["cryptography", "api-bindings"]
1010
edition = "2021"
1111

12-
# these are deprecated and don't do anything anymore
1312
[features]
14-
v101 = []
15-
v102 = []
16-
v110 = []
17-
v111 = []
18-
1913
vendored = ['ffi/vendored']
2014
tongsuo = ['ffi/tongsuo']
2115
bindgen = ['ffi/bindgen']

openssl/src/ssl/mod.rs

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,27 +1047,6 @@ impl SslContextBuilder {
10471047
unsafe { cvt(ffi::SSL_CTX_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) as c_int).map(|_| ()) }
10481048
}
10491049

1050-
/// Sets the callback which will generate parameters to be used during ephemeral elliptic curve
1051-
/// Diffie-Hellman key exchange.
1052-
///
1053-
/// The callback is provided with a reference to the `Ssl` for the session, as well as a boolean
1054-
/// indicating if the selected cipher is export-grade, and the key length. The export and key
1055-
/// length options are archaic and should be ignored in almost all cases.
1056-
///
1057-
/// Requires OpenSSL 1.0.1 or 1.0.2.
1058-
#[corresponds(SSL_CTX_set_tmp_ecdh_callback)]
1059-
#[cfg(all(ossl101, not(ossl110)))]
1060-
#[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")]
1061-
pub fn set_tmp_ecdh_callback<F>(&mut self, callback: F)
1062-
where
1063-
F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
1064-
{
1065-
unsafe {
1066-
self.set_ex_data(SslContext::cached_ex_index::<F>(), callback);
1067-
ffi::SSL_CTX_set_tmp_ecdh_callback(self.as_ptr(), Some(raw_tmp_ecdh::<F>));
1068-
}
1069-
}
1070-
10711050
/// Use the default locations of trusted certificates for verification.
10721051
///
10731052
/// These locations are read from the `SSL_CERT_FILE` and `SSL_CERT_DIR` environment variables
@@ -1766,18 +1745,6 @@ impl SslContextBuilder {
17661745
}
17671746
}
17681747

1769-
#[deprecated(since = "0.10.10", note = "renamed to `set_psk_client_callback`")]
1770-
#[cfg(not(osslconf = "OPENSSL_NO_PSK"))]
1771-
pub fn set_psk_callback<F>(&mut self, callback: F)
1772-
where
1773-
F: Fn(&mut SslRef, Option<&[u8]>, &mut [u8], &mut [u8]) -> Result<usize, ErrorStack>
1774-
+ 'static
1775-
+ Sync
1776-
+ Send,
1777-
{
1778-
self.set_psk_client_callback(callback)
1779-
}
1780-
17811748
/// Sets the callback for providing an identity and pre-shared key for a TLS-PSK server.
17821749
///
17831750
/// The callback will be called with the SSL context, an identity provided by the client,
@@ -2946,23 +2913,6 @@ impl SslRef {
29462913
unsafe { cvt(ffi::SSL_set_tmp_ecdh(self.as_ptr(), key.as_ptr()) as c_int).map(|_| ()) }
29472914
}
29482915

2949-
/// Like [`SslContextBuilder::set_tmp_ecdh_callback`].
2950-
///
2951-
/// Requires OpenSSL 1.0.1 or 1.0.2.
2952-
#[corresponds(SSL_set_tmp_ecdh_callback)]
2953-
#[cfg(all(ossl101, not(ossl110)))]
2954-
#[deprecated(note = "this function leaks memory and does not exist on newer OpenSSL versions")]
2955-
pub fn set_tmp_ecdh_callback<F>(&mut self, callback: F)
2956-
where
2957-
F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
2958-
{
2959-
unsafe {
2960-
// this needs to be in an Arc since the callback can register a new callback!
2961-
self.set_ex_data(Ssl::cached_ex_index(), Arc::new(callback));
2962-
ffi::SSL_set_tmp_ecdh_callback(self.as_ptr(), Some(raw_tmp_ecdh_ssl::<F>));
2963-
}
2964-
}
2965-
29662916
/// Like [`SslContextBuilder::set_ecdh_auto`].
29672917
///
29682918
/// Requires OpenSSL 1.0.2 or LibreSSL.
@@ -3098,11 +3048,6 @@ impl SslRef {
30983048
}
30993049
}
31003050

3101-
#[deprecated(since = "0.10.5", note = "renamed to `version_str`")]
3102-
pub fn version(&self) -> &str {
3103-
self.version_str()
3104-
}
3105-
31063051
/// Returns the protocol version of the session.
31073052
#[corresponds(SSL_version)]
31083053
pub fn version2(&self) -> Option<SslVersion> {
@@ -4276,22 +4221,6 @@ impl<S: Read + Write> SslStream<S> {
42764221
})
42774222
}
42784223

4279-
/// Constructs an `SslStream` from a pointer to the underlying OpenSSL `SSL` struct.
4280-
///
4281-
/// This is useful if the handshake has already been completed elsewhere.
4282-
///
4283-
/// # Safety
4284-
///
4285-
/// The caller must ensure the pointer is valid.
4286-
#[deprecated(
4287-
since = "0.10.32",
4288-
note = "use Ssl::from_ptr and SslStream::new instead"
4289-
)]
4290-
pub unsafe fn from_raw_parts(ssl: *mut ffi::SSL, stream: S) -> Self {
4291-
let ssl = Ssl::from_ptr(ssl);
4292-
Self::new(ssl, stream).unwrap()
4293-
}
4294-
42954224
/// Read application data transmitted by a client before handshake completion.
42964225
///
42974226
/// Useful for reducing latency, but vulnerable to replay attacks. Call
@@ -4902,21 +4831,6 @@ impl<S> SslStreamBuilder<S> {
49024831
pub fn ssl_mut(&mut self) -> &mut SslRef {
49034832
&mut self.inner.ssl
49044833
}
4905-
4906-
/// Set the DTLS MTU size.
4907-
///
4908-
/// It will be ignored if the value is smaller than the minimum packet size
4909-
/// the DTLS protocol requires.
4910-
///
4911-
/// # Panics
4912-
/// This function panics if the given mtu size can't be represented in a positive `c_long` range
4913-
#[deprecated(note = "Use SslRef::set_mtu instead", since = "0.10.30")]
4914-
pub fn set_dtls_mtu_size(&mut self, mtu_size: usize) {
4915-
unsafe {
4916-
let bio = self.inner.ssl.get_raw_rbio();
4917-
bio::set_dtls_mtu_size::<S>(bio, mtu_size);
4918-
}
4919-
}
49204834
}
49214835

49224836
/// The result of a shutdown request.

openssl/src/ssl/test/mod.rs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -981,30 +981,6 @@ fn tmp_dh_callback() {
981981
assert!(CALLED_BACK.load(Ordering::SeqCst));
982982
}
983983

984-
#[test]
985-
#[cfg(all(ossl101, not(ossl110)))]
986-
#[allow(deprecated)]
987-
fn tmp_ecdh_callback() {
988-
use crate::ec::EcKey;
989-
use crate::nid::Nid;
990-
991-
static CALLED_BACK: AtomicBool = AtomicBool::new(false);
992-
993-
let mut server = Server::builder();
994-
server.ctx().set_tmp_ecdh_callback(|_, _, _| {
995-
CALLED_BACK.store(true, Ordering::SeqCst);
996-
EcKey::from_curve_name(Nid::X9_62_PRIME256V1)
997-
});
998-
999-
let server = server.build();
1000-
1001-
let mut client = server.client();
1002-
client.ctx().set_cipher_list("ECDH").unwrap();
1003-
client.connect();
1004-
1005-
assert!(CALLED_BACK.load(Ordering::SeqCst));
1006-
}
1007-
1008984
#[test]
1009985
#[cfg_attr(any(all(libressl321, not(libressl340)), boringssl), ignore)]
1010986
fn tmp_dh_callback_ssl() {
@@ -1031,32 +1007,6 @@ fn tmp_dh_callback_ssl() {
10311007
assert!(CALLED_BACK.load(Ordering::SeqCst));
10321008
}
10331009

1034-
#[test]
1035-
#[cfg(all(ossl101, not(ossl110)))]
1036-
#[allow(deprecated)]
1037-
fn tmp_ecdh_callback_ssl() {
1038-
use crate::ec::EcKey;
1039-
use crate::nid::Nid;
1040-
1041-
static CALLED_BACK: AtomicBool = AtomicBool::new(false);
1042-
1043-
let mut server = Server::builder();
1044-
server.ssl_cb(|ssl| {
1045-
ssl.set_tmp_ecdh_callback(|_, _, _| {
1046-
CALLED_BACK.store(true, Ordering::SeqCst);
1047-
EcKey::from_curve_name(Nid::X9_62_PRIME256V1)
1048-
});
1049-
});
1050-
1051-
let server = server.build();
1052-
1053-
let mut client = server.client();
1054-
client.ctx().set_cipher_list("ECDH").unwrap();
1055-
client.connect();
1056-
1057-
assert!(CALLED_BACK.load(Ordering::SeqCst));
1058-
}
1059-
10601010
#[test]
10611011
fn idle_session() {
10621012
let ctx = SslContext::builder(SslMethod::tls()).unwrap().build();

openssl/src/x509/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,6 @@ impl X509Ref {
563563
ffi::X509_pubkey_digest
564564
}
565565

566-
#[deprecated(since = "0.10.9", note = "renamed to digest")]
567-
pub fn fingerprint(&self, hash_type: MessageDigest) -> Result<Vec<u8>, ErrorStack> {
568-
self.digest(hash_type).map(|b| b.to_vec())
569-
}
570-
571566
/// Returns the certificate's Not After validity period.
572567
#[corresponds(X509_getm_notAfter)]
573568
pub fn not_after(&self) -> &Asn1TimeRef {

0 commit comments

Comments
 (0)