diff options
| author | Steven Fackler <[email protected]> | 2016-01-30 12:55:22 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-05-03 20:24:07 -0700 |
| commit | fa622326490e1dd27df4d42b4097ca574deedb3f (patch) | |
| tree | f6b60233b5f71847a3fbd87aa13a74f16fe79ddf /openssl/src/dh | |
| parent | Remove deprecated methods (diff) | |
| download | rust-openssl-fa622326490e1dd27df4d42b4097ca574deedb3f.tar.xz rust-openssl-fa622326490e1dd27df4d42b4097ca574deedb3f.zip | |
Error reform
Diffstat (limited to 'openssl/src/dh')
| -rw-r--r-- | openssl/src/dh/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/openssl/src/dh/mod.rs b/openssl/src/dh/mod.rs index d2f26c3f..14bf076d 100644 --- a/openssl/src/dh/mod.rs +++ b/openssl/src/dh/mod.rs @@ -1,7 +1,7 @@ use ffi; use std::io; use std::io::prelude::*; -use ssl::error::{SslError, StreamError}; +use error::ErrorStack; use bio::MemBio; use bn::BigNum; use std::mem; @@ -10,7 +10,7 @@ use std::ptr; pub struct DH(*mut ffi::DH); impl DH { - pub fn from_params(p: BigNum, g: BigNum, q: BigNum) -> Result<DH, SslError> { + pub fn from_params(p: BigNum, g: BigNum, q: BigNum) -> Result<DH, ErrorStack> { let dh = try_ssl_null!(unsafe { ffi::DH_new_from_params(p.raw(), g.raw(), q.raw()) }); mem::forget(p); mem::forget(g); @@ -18,11 +18,11 @@ impl DH { Ok(DH(dh)) } - pub fn from_pem<R>(reader: &mut R) -> Result<DH, SslError> + pub fn from_pem<R>(reader: &mut R) -> io::Result<DH> where R: Read { let mut mem_bio = try!(MemBio::new()); - try!(io::copy(reader, &mut mem_bio).map_err(StreamError)); + try!(io::copy(reader, &mut mem_bio)); let dh = unsafe { ffi::PEM_read_bio_DHparams(mem_bio.get_handle(), ptr::null_mut(), None, ptr::null_mut()) }; @@ -31,19 +31,19 @@ impl DH { } #[cfg(feature = "rfc5114")] - pub fn get_1024_160() -> Result<DH, SslError> { + pub fn get_1024_160() -> Result<DH, ErrorStack> { let dh = try_ssl_null!(unsafe { ffi::DH_get_1024_160() }); Ok(DH(dh)) } #[cfg(feature = "rfc5114")] - pub fn get_2048_224() -> Result<DH, SslError> { + pub fn get_2048_224() -> Result<DH, ErrorStack> { let dh = try_ssl_null!(unsafe { ffi::DH_get_2048_224() }); Ok(DH(dh)) } #[cfg(feature = "rfc5114")] - pub fn get_2048_256() -> Result<DH, SslError> { + pub fn get_2048_256() -> Result<DH, ErrorStack> { let dh = try_ssl_null!(unsafe { ffi::DH_get_2048_256() }); Ok(DH(dh)) } |