From ccef9e339dc3717761fc9e70c34f1df86b608579 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 13 Nov 2016 17:56:48 +0000 Subject: Macroise from_pem --- openssl/src/dh.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'openssl/src/dh.rs') 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 { - 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. -- cgit v1.2.3