diff options
author | Steven Fackler <sfackler@palantir.com> | 2016-11-13 16:52:19 +0000 |
---|---|---|
committer | Steven Fackler <sfackler@palantir.com> | 2016-11-13 16:52:19 +0000 |
commit | b0415f466c4b62f949b1e47e6b1e703d1b24122b (patch) | |
tree | 4cbe8cb2d812d10f22c7ed6ae2617f8fe50ecf62 /openssl/src/dh.rs | |
parent | ed9f600e2889906bb928150d7e892370062f6ca1 (diff) | |
download | rust-openssl-b0415f466c4b62f949b1e47e6b1e703d1b24122b.zip |
Macroise to_der
Diffstat (limited to 'openssl/src/dh.rs')
-rw-r--r-- | openssl/src/dh.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/openssl/src/dh.rs b/openssl/src/dh.rs index ad1ebf9f..2b0a1508 100644 --- a/openssl/src/dh.rs +++ b/openssl/src/dh.rs @@ -22,15 +22,7 @@ impl DhRef { Ok(mem_bio.get_buf().to_owned()) } - /// Encodes the parameters to DER. - pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack> { - unsafe { - let len = try!(cvt(ffi::i2d_DHparams(self.as_ptr(), ptr::null_mut()))); - let mut buf = vec![0; len as usize]; - try!(cvt(ffi::i2d_DHparams(self.as_ptr(), &mut buf.as_mut_ptr()))); - Ok(buf) - } - } + to_der!(ffi::i2d_DHparams); } impl Dh { |