aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2018-03-29 10:20:18 +0200
committerSteven Fackler <[email protected]>2018-03-29 10:20:18 +0200
commit1bbe1b6a8f104cc9694a5e65d9b58ad2e3af9740 (patch)
treec37af48b1656cff5356bb764301b56d4439686b1 /openssl/src/ssl
parentMerge pull request #888 from sfackler/version-bumps (diff)
downloadrust-openssl-1bbe1b6a8f104cc9694a5e65d9b58ad2e3af9740.tar.xz
rust-openssl-1bbe1b6a8f104cc9694a5e65d9b58ad2e3af9740.zip
Clean up a couple of holdovers from old features
Diffstat (limited to 'openssl/src/ssl')
-rw-r--r--openssl/src/ssl/connector.rs16
-rw-r--r--openssl/src/ssl/mod.rs8
2 files changed, 10 insertions, 14 deletions
diff --git a/openssl/src/ssl/connector.rs b/openssl/src/ssl/connector.rs
index 89eb0ac3..9966a5a0 100644
--- a/openssl/src/ssl/connector.rs
+++ b/openssl/src/ssl/connector.rs
@@ -192,11 +192,7 @@ impl SslAcceptor {
pub fn mozilla_intermediate(method: SslMethod) -> Result<SslAcceptorBuilder, ErrorStack> {
let mut ctx = ctx(method)?;
#[cfg(ossl111)]
- {
- ctx.set_options(SslOptions {
- bits: ::ffi::SSL_OP_NO_TLSv1_3,
- });
- }
+ ctx.set_options(SslOptions::NO_TLSV1_3);
let dh = Dh::params_from_pem(
b"
-----BEGIN DH PARAMETERS-----
@@ -236,11 +232,7 @@ ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
let mut ctx = ctx(method)?;
ctx.set_options(SslOptions::NO_TLSV1 | SslOptions::NO_TLSV1_1);
#[cfg(ossl111)]
- {
- ctx.set_options(SslOptions {
- bits: ::ffi::SSL_OP_NO_TLSv1_3,
- });
- }
+ ctx.set_options(SslOptions::NO_TLSV1_3);
setup_curves(&mut ctx)?;
ctx.set_cipher_list(
"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:\
@@ -316,8 +308,10 @@ fn setup_verify(ctx: &mut SslContextBuilder) {
#[cfg(any(ossl102, ossl110))]
fn setup_verify_hostname(ssl: &mut Ssl, domain: &str) -> Result<(), ErrorStack> {
+ use x509::verify::X509CheckFlags;
+
let param = ssl.param_mut();
- param.set_hostflags(::verify::X509CheckFlags::NO_PARTIAL_WILDCARDS);
+ param.set_hostflags(X509CheckFlags::NO_PARTIAL_WILDCARDS);
match domain.parse() {
Ok(ip) => param.set_ip(ip),
Err(_) => param.set_host(domain),
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index f3c4ed3a..c1021b8b 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -87,7 +87,7 @@ use x509::store::{X509StoreBuilderRef, X509StoreRef};
#[cfg(any(ossl102, ossl110))]
use x509::store::X509Store;
#[cfg(any(ossl102, ossl110))]
-use verify::X509VerifyParamRef;
+use x509::verify::X509VerifyParamRef;
use pkey::{HasPrivate, PKeyRef, Params, Private};
use error::ErrorStack;
use ex_data::Index;
@@ -1512,12 +1512,14 @@ impl SslContextBuilder {
parse_cb: ParseFn,
) -> Result<(), ErrorStack>
where
- AddFn: Fn(&mut SslRef, ExtensionContext, Option<(usize, &X509Ref)>) -> Result<Option<T>, SslAlert>
+ AddFn: Fn(&mut SslRef, ExtensionContext, Option<(usize, &X509Ref)>)
+ -> Result<Option<T>, SslAlert>
+ 'static
+ Sync
+ Send,
T: AsRef<[u8]> + 'static + Sync + Send,
- ParseFn: Fn(&mut SslRef, ExtensionContext, &[u8], Option<(usize, &X509Ref)>) -> Result<(), SslAlert>
+ ParseFn: Fn(&mut SslRef, ExtensionContext, &[u8], Option<(usize, &X509Ref)>)
+ -> Result<(), SslAlert>
+ 'static
+ Sync
+ Send,