diff options
| author | Steven Fackler <[email protected]> | 2016-10-25 23:12:56 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-25 23:12:56 -0700 |
| commit | f4b70067719a6724658a2b67e80eaf9b38ab89bc (patch) | |
| tree | 83ff953158aac04d09ab0258e2e68334c1ab894d /openssl/src/dh.rs | |
| parent | Merge pull request #492 from sfackler/gcm (diff) | |
| download | rust-openssl-f4b70067719a6724658a2b67e80eaf9b38ab89bc.tar.xz rust-openssl-f4b70067719a6724658a2b67e80eaf9b38ab89bc.zip | |
Don't allow mutation of SslContexts
SslContext is reference counted and the various setter methods don't
take out locks where necessary. Fix this by adding a builder for the
context.
Diffstat (limited to 'openssl/src/dh.rs')
| -rw-r--r-- | openssl/src/dh.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/openssl/src/dh.rs b/openssl/src/dh.rs index 3b06951e..7111a068 100644 --- a/openssl/src/dh.rs +++ b/openssl/src/dh.rs @@ -101,7 +101,7 @@ mod tests { #[test] #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] fn test_dh_rfc5114() { - let mut ctx = SslContext::new(SslMethod::tls()).unwrap(); + let mut ctx = SslContext::builder(SslMethod::tls()).unwrap(); let dh1 = DH::get_1024_160().unwrap(); ctx.set_tmp_dh(&dh1).unwrap(); let dh2 = DH::get_2048_224().unwrap(); @@ -112,7 +112,7 @@ mod tests { #[test] fn test_dh() { - let mut ctx = SslContext::new(SslMethod::tls()).unwrap(); + let mut ctx = SslContext::builder(SslMethod::tls()).unwrap(); let p = BigNum::from_hex_str("87A8E61DB4B6663CFFBBD19C651959998CEEF608660DD0F25D2CEED4435\ E3B00E00DF8F1D61957D4FAF7DF4561B2AA3016C3D91134096FAA3BF429\ 6D830E9A7C209E0C6497517ABD5A8A9D306BCF67ED91F9E6725B4758C02\ @@ -142,7 +142,7 @@ mod tests { #[test] fn test_dh_from_pem() { - let mut ctx = SslContext::new(SslMethod::tls()).unwrap(); + let mut ctx = SslContext::builder(SslMethod::tls()).unwrap(); let params = include_bytes!("../test/dhparams.pem"); let dh = DH::from_pem(params).ok().expect("Failed to load PEM"); ctx.set_tmp_dh(&dh).unwrap(); |