Loading openssl/src/dsa.rs +6 −5 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use std::ptr; use bn::{BigNum, BigNumRef}; use error::ErrorStack; use pkey::{HasParams, HasPrivate, HasPublic, Private, Public}; use util::ForeignTypeRefExt; use {cvt, cvt_p}; generic_foreign_type_and_impl_send_sync! { Loading Loading @@ -107,7 +108,7 @@ where unsafe { let mut pub_key = ptr::null(); DSA_get0_key(self.as_ptr(), &mut pub_key, ptr::null_mut()); BigNumRef::from_ptr(pub_key as *mut _) BigNumRef::from_const_ptr(pub_key) } } } Loading Loading @@ -141,7 +142,7 @@ where unsafe { let mut priv_key = ptr::null(); DSA_get0_key(self.as_ptr(), ptr::null_mut(), &mut priv_key); BigNumRef::from_ptr(priv_key as *mut _) BigNumRef::from_const_ptr(priv_key) } } } Loading @@ -164,7 +165,7 @@ where unsafe { let mut p = ptr::null(); DSA_get0_pqg(self.as_ptr(), &mut p, ptr::null_mut(), ptr::null_mut()); BigNumRef::from_ptr(p as *mut _) BigNumRef::from_const_ptr(p) } } Loading @@ -173,7 +174,7 @@ where unsafe { let mut q = ptr::null(); DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), &mut q, ptr::null_mut()); BigNumRef::from_ptr(q as *mut _) BigNumRef::from_const_ptr(q) } } Loading @@ -182,7 +183,7 @@ where unsafe { let mut g = ptr::null(); DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut g); BigNumRef::from_ptr(g as *mut _) BigNumRef::from_const_ptr(g) } } } Loading openssl/src/ec.rs +5 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ use bn::{BigNumContextRef, BigNumRef}; use error::ErrorStack; use nid::Nid; use pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public}; use util::ForeignTypeRefExt; use {cvt, cvt_n, cvt_p, init}; /// Compressed or Uncompressed conversion Loading Loading @@ -230,7 +231,7 @@ impl EcGroupRef { pub fn generator(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_GROUP_get0_generator(self.as_ptr()); EcPointRef::from_ptr(ptr as *mut _) EcPointRef::from_const_ptr(ptr) } } Loading Loading @@ -622,7 +623,7 @@ where pub fn private_key(&self) -> &BigNumRef { unsafe { let ptr = ffi::EC_KEY_get0_private_key(self.as_ptr()); BigNumRef::from_ptr(ptr as *mut _) BigNumRef::from_const_ptr(ptr) } } } Loading @@ -639,7 +640,7 @@ where pub fn public_key(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_KEY_get0_public_key(self.as_ptr()); EcPointRef::from_ptr(ptr as *mut _) EcPointRef::from_const_ptr(ptr) } } Loading Loading @@ -678,7 +679,7 @@ where pub fn group(&self) -> &EcGroupRef { unsafe { let ptr = ffi::EC_KEY_get0_group(self.as_ptr()); EcGroupRef::from_ptr(ptr as *mut _) EcGroupRef::from_const_ptr(ptr) } } Loading openssl/src/ecdsa.rs +5 −4 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use bn::{BigNum, BigNumRef}; use ec::EcKeyRef; use error::ErrorStack; use pkey::{HasPrivate, HasPublic}; use util::ForeignTypeRefExt; use {cvt_n, cvt_p}; foreign_type_and_impl_send_sync! { Loading Loading @@ -45,7 +46,7 @@ impl EcdsaSig { data.len() as c_int, eckey.as_ptr(), ))?; Ok(EcdsaSig::from_ptr(sig as *mut _)) Ok(EcdsaSig::from_ptr(sig)) } } Loading @@ -60,7 +61,7 @@ impl EcdsaSig { let sig = cvt_p(ffi::ECDSA_SIG_new())?; ECDSA_SIG_set0(sig, r.as_ptr(), s.as_ptr()); mem::forget((r, s)); Ok(EcdsaSig::from_ptr(sig as *mut _)) Ok(EcdsaSig::from_ptr(sig)) } } Loading Loading @@ -117,7 +118,7 @@ impl EcdsaSigRef { unsafe { let mut r = ptr::null(); ECDSA_SIG_get0(self.as_ptr(), &mut r, ptr::null_mut()); BigNumRef::from_ptr(r as *mut _) BigNumRef::from_const_ptr(r) } } Loading @@ -130,7 +131,7 @@ impl EcdsaSigRef { unsafe { let mut s = ptr::null(); ECDSA_SIG_get0(self.as_ptr(), ptr::null_mut(), &mut s); BigNumRef::from_ptr(s as *mut _) BigNumRef::from_const_ptr(s) } } } Loading openssl/src/ocsp.rs +2 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use asn1::Asn1GeneralizedTimeRef; use error::ErrorStack; use hash::MessageDigest; use stack::StackRef; use util::ForeignTypeRefExt; use x509::store::X509StoreRef; use x509::{X509Ref, X509}; use {cvt, cvt_p}; Loading Loading @@ -188,11 +189,7 @@ impl OcspBasicResponseRef { &mut next_update, ); if r == 1 { let revocation_time = if revocation_time.is_null() { None } else { Some(Asn1GeneralizedTimeRef::from_ptr(revocation_time)) }; let revocation_time = Asn1GeneralizedTimeRef::from_const_ptr_opt(revocation_time); Some(OcspStatus { status: OcspCertStatus(status), Loading openssl/src/pkcs12.rs +2 −5 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use error::ErrorStack; use nid::Nid; use pkey::{HasPrivate, PKey, PKeyRef, Private}; use stack::Stack; use util::ForeignTypeExt; use x509::{X509Ref, X509}; use {cvt, cvt_p}; Loading Loading @@ -52,11 +53,7 @@ impl Pkcs12Ref { let pkey = PKey::from_ptr(pkey); let cert = X509::from_ptr(cert); let chain = if chain.is_null() { None } else { Some(Stack::from_ptr(chain)) }; let chain = Stack::from_ptr_opt(chain); Ok(ParsedPkcs12 { pkey, cert, chain }) } Loading Loading
openssl/src/dsa.rs +6 −5 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ use std::ptr; use bn::{BigNum, BigNumRef}; use error::ErrorStack; use pkey::{HasParams, HasPrivate, HasPublic, Private, Public}; use util::ForeignTypeRefExt; use {cvt, cvt_p}; generic_foreign_type_and_impl_send_sync! { Loading Loading @@ -107,7 +108,7 @@ where unsafe { let mut pub_key = ptr::null(); DSA_get0_key(self.as_ptr(), &mut pub_key, ptr::null_mut()); BigNumRef::from_ptr(pub_key as *mut _) BigNumRef::from_const_ptr(pub_key) } } } Loading Loading @@ -141,7 +142,7 @@ where unsafe { let mut priv_key = ptr::null(); DSA_get0_key(self.as_ptr(), ptr::null_mut(), &mut priv_key); BigNumRef::from_ptr(priv_key as *mut _) BigNumRef::from_const_ptr(priv_key) } } } Loading @@ -164,7 +165,7 @@ where unsafe { let mut p = ptr::null(); DSA_get0_pqg(self.as_ptr(), &mut p, ptr::null_mut(), ptr::null_mut()); BigNumRef::from_ptr(p as *mut _) BigNumRef::from_const_ptr(p) } } Loading @@ -173,7 +174,7 @@ where unsafe { let mut q = ptr::null(); DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), &mut q, ptr::null_mut()); BigNumRef::from_ptr(q as *mut _) BigNumRef::from_const_ptr(q) } } Loading @@ -182,7 +183,7 @@ where unsafe { let mut g = ptr::null(); DSA_get0_pqg(self.as_ptr(), ptr::null_mut(), ptr::null_mut(), &mut g); BigNumRef::from_ptr(g as *mut _) BigNumRef::from_const_ptr(g) } } } Loading
openssl/src/ec.rs +5 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ use bn::{BigNumContextRef, BigNumRef}; use error::ErrorStack; use nid::Nid; use pkey::{HasParams, HasPrivate, HasPublic, Params, Private, Public}; use util::ForeignTypeRefExt; use {cvt, cvt_n, cvt_p, init}; /// Compressed or Uncompressed conversion Loading Loading @@ -230,7 +231,7 @@ impl EcGroupRef { pub fn generator(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_GROUP_get0_generator(self.as_ptr()); EcPointRef::from_ptr(ptr as *mut _) EcPointRef::from_const_ptr(ptr) } } Loading Loading @@ -622,7 +623,7 @@ where pub fn private_key(&self) -> &BigNumRef { unsafe { let ptr = ffi::EC_KEY_get0_private_key(self.as_ptr()); BigNumRef::from_ptr(ptr as *mut _) BigNumRef::from_const_ptr(ptr) } } } Loading @@ -639,7 +640,7 @@ where pub fn public_key(&self) -> &EcPointRef { unsafe { let ptr = ffi::EC_KEY_get0_public_key(self.as_ptr()); EcPointRef::from_ptr(ptr as *mut _) EcPointRef::from_const_ptr(ptr) } } Loading Loading @@ -678,7 +679,7 @@ where pub fn group(&self) -> &EcGroupRef { unsafe { let ptr = ffi::EC_KEY_get0_group(self.as_ptr()); EcGroupRef::from_ptr(ptr as *mut _) EcGroupRef::from_const_ptr(ptr) } } Loading
openssl/src/ecdsa.rs +5 −4 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use bn::{BigNum, BigNumRef}; use ec::EcKeyRef; use error::ErrorStack; use pkey::{HasPrivate, HasPublic}; use util::ForeignTypeRefExt; use {cvt_n, cvt_p}; foreign_type_and_impl_send_sync! { Loading Loading @@ -45,7 +46,7 @@ impl EcdsaSig { data.len() as c_int, eckey.as_ptr(), ))?; Ok(EcdsaSig::from_ptr(sig as *mut _)) Ok(EcdsaSig::from_ptr(sig)) } } Loading @@ -60,7 +61,7 @@ impl EcdsaSig { let sig = cvt_p(ffi::ECDSA_SIG_new())?; ECDSA_SIG_set0(sig, r.as_ptr(), s.as_ptr()); mem::forget((r, s)); Ok(EcdsaSig::from_ptr(sig as *mut _)) Ok(EcdsaSig::from_ptr(sig)) } } Loading Loading @@ -117,7 +118,7 @@ impl EcdsaSigRef { unsafe { let mut r = ptr::null(); ECDSA_SIG_get0(self.as_ptr(), &mut r, ptr::null_mut()); BigNumRef::from_ptr(r as *mut _) BigNumRef::from_const_ptr(r) } } Loading @@ -130,7 +131,7 @@ impl EcdsaSigRef { unsafe { let mut s = ptr::null(); ECDSA_SIG_get0(self.as_ptr(), ptr::null_mut(), &mut s); BigNumRef::from_ptr(s as *mut _) BigNumRef::from_const_ptr(s) } } } Loading
openssl/src/ocsp.rs +2 −5 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ use asn1::Asn1GeneralizedTimeRef; use error::ErrorStack; use hash::MessageDigest; use stack::StackRef; use util::ForeignTypeRefExt; use x509::store::X509StoreRef; use x509::{X509Ref, X509}; use {cvt, cvt_p}; Loading Loading @@ -188,11 +189,7 @@ impl OcspBasicResponseRef { &mut next_update, ); if r == 1 { let revocation_time = if revocation_time.is_null() { None } else { Some(Asn1GeneralizedTimeRef::from_ptr(revocation_time)) }; let revocation_time = Asn1GeneralizedTimeRef::from_const_ptr_opt(revocation_time); Some(OcspStatus { status: OcspCertStatus(status), Loading
openssl/src/pkcs12.rs +2 −5 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ use error::ErrorStack; use nid::Nid; use pkey::{HasPrivate, PKey, PKeyRef, Private}; use stack::Stack; use util::ForeignTypeExt; use x509::{X509Ref, X509}; use {cvt, cvt_p}; Loading Loading @@ -52,11 +53,7 @@ impl Pkcs12Ref { let pkey = PKey::from_ptr(pkey); let cert = X509::from_ptr(cert); let chain = if chain.is_null() { None } else { Some(Stack::from_ptr(chain)) }; let chain = Stack::from_ptr_opt(chain); Ok(ParsedPkcs12 { pkey, cert, chain }) } Loading