summaryrefslogtreecommitdiff
path: root/openssl/src/dh.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@palantir.com>2016-11-13 17:56:48 +0000
committerSteven Fackler <sfackler@palantir.com>2016-11-13 17:56:48 +0000
commitccef9e339dc3717761fc9e70c34f1df86b608579 (patch)
tree83778d79877e81416f67ed06c5d0b0d01a309c04 /openssl/src/dh.rs
parentdf9666c334f29d4d0887919c2b35c45092960d3a (diff)
downloadrust-openssl-ccef9e339dc3717761fc9e70c34f1df86b608579.zip
Macroise from_pem
Diffstat (limited to 'openssl/src/dh.rs')
-rw-r--r--openssl/src/dh.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/openssl/src/dh.rs b/openssl/src/dh.rs
index 37663ac0..64494f95 100644
--- a/openssl/src/dh.rs
+++ b/openssl/src/dh.rs
@@ -4,7 +4,6 @@ use std::mem;
use std::ptr;
use {cvt, cvt_p, init};
-use bio::MemBioSlice;
use bn::BigNum;
use types::OpenSslTypeRef;
@@ -26,19 +25,7 @@ impl Dh {
}
}
- /// Reads Diffie-Hellman parameters from PEM.
- pub fn from_pem(buf: &[u8]) -> Result<Dh, ErrorStack> {
- unsafe {
- init();
- let mem_bio = try!(MemBioSlice::new(buf));
- cvt_p(ffi::PEM_read_bio_DHparams(mem_bio.as_ptr(),
- ptr::null_mut(),
- None,
- ptr::null_mut()))
- .map(Dh)
- }
- }
-
+ from_pem!(Dh, ffi::PEM_read_bio_DHparams);
from_der!(Dh, ffi::d2i_DHparams);
/// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0.