aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/rsa.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2017-02-04 08:54:25 -0800
committerGitHub <[email protected]>2017-02-04 08:54:25 -0800
commit084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a (patch)
tree6c3e0f158d3cf63e5ae8229126e3430847398ad3 /openssl/src/rsa.rs
parentMerge pull request #571 from sfackler/build-script-cleanup (diff)
parentSwitch to foreign_types (diff)
downloadrust-openssl-084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a.tar.xz
rust-openssl-084cf3c66b7cc3d24cb23d2bb548fa0fa4ee040a.zip
Merge pull request #572 from sfackler/foreign-types
Switch to foreign_types
Diffstat (limited to 'openssl/src/rsa.rs')
-rw-r--r--openssl/src/rsa.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/openssl/src/rsa.rs b/openssl/src/rsa.rs
index dc760f7a..792f7070 100644
--- a/openssl/src/rsa.rs
+++ b/openssl/src/rsa.rs
@@ -3,13 +3,13 @@ use std::fmt;
use std::ptr;
use std::mem;
use libc::{c_int, c_void, c_char};
+use foreign_types::ForeignTypeRef;
use {cvt, cvt_p, cvt_n};
use bn::{BigNum, BigNumRef};
use bio::MemBioSlice;
use error::ErrorStack;
use util::{CallbackState, invoke_passwd_cb_old};
-use types::OpenSslTypeRef;
/// Type of encryption padding to use.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
@@ -29,7 +29,13 @@ pub const NO_PADDING: Padding = Padding(ffi::RSA_NO_PADDING);
pub const PKCS1_PADDING: Padding = Padding(ffi::RSA_PKCS1_PADDING);
pub const PKCS1_OAEP_PADDING: Padding = Padding(ffi::RSA_PKCS1_OAEP_PADDING);
-type_!(Rsa, RsaRef, ffi::RSA, ffi::RSA_free);
+foreign_type! {
+ type CType = ffi::RSA;
+ fn drop = ffi::RSA_free;
+
+ pub struct Rsa;
+ pub struct RsaRef;
+}
impl RsaRef {
private_key_to_pem!(ffi::PEM_write_bio_RSAPrivateKey);