summaryrefslogtreecommitdiff
path: root/openssl/src/dh.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@palantir.com>2016-11-13 16:52:19 +0000
committerSteven Fackler <sfackler@palantir.com>2016-11-13 16:52:19 +0000
commitb0415f466c4b62f949b1e47e6b1e703d1b24122b (patch)
tree4cbe8cb2d812d10f22c7ed6ae2617f8fe50ecf62 /openssl/src/dh.rs
parented9f600e2889906bb928150d7e892370062f6ca1 (diff)
downloadrust-openssl-b0415f466c4b62f949b1e47e6b1e703d1b24122b.zip
Macroise to_der
Diffstat (limited to 'openssl/src/dh.rs')
-rw-r--r--openssl/src/dh.rs10
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 {