Loading src/asn1/mod.rs +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ impl Asn1Time { } fn new_with_period(period: u64) -> Result<Asn1Time, SslError> { ffi::init(); let handle = unsafe { try_ssl_null!(ffi::X509_gmtime_adj(ptr::null_mut(), period as c_long)) Loading src/bio/mod.rs +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ impl Drop for MemBio { impl MemBio { /// Creates a new owned memory based BIO pub fn new() -> Result<MemBio, SslError> { ffi::init(); let bio = unsafe { ffi::BIO_new(ffi::BIO_s_mem()) }; try_ssl_null!(bio); Loading src/bn/mod.rs +4 −0 Original line number Diff line number Diff line Loading @@ -79,8 +79,10 @@ macro_rules! with_bn_in_ctx( ) impl BigNum { // FIXME: squash 3 constructors into one pub fn new() -> Result<BigNum, SslError> { unsafe { ffi::init(); let v = ffi::BN_new(); if v.is_null() { Err(SslError::get()) Loading @@ -92,6 +94,7 @@ impl BigNum { pub fn new_from(n: u64) -> Result<BigNum, SslError> { unsafe { ffi::init(); let bn = ffi::BN_new(); if bn.is_null() || ffi::BN_set_word(bn, n as c_ulong) == 0 { Err(SslError::get()) Loading @@ -103,6 +106,7 @@ impl BigNum { pub fn new_from_slice(n: &[u8]) -> Result<BigNum, SslError> { unsafe { ffi::init(); let bn = ffi::BN_new(); if bn.is_null() || ffi::BN_bin2bn(n.as_ptr(), n.len() as c_int, bn).is_null() { Err(SslError::get()) Loading src/crypto/hash.rs +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ pub struct Hasher { impl Hasher { pub fn new(ht: HashType) -> Hasher { ffi::init(); let ctx = unsafe { ffi::EVP_MD_CTX_create() }; let (evp, mdlen) = evpmd(ht); unsafe { Loading src/crypto/hmac.rs +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ pub struct HMAC { #[allow(non_snake_case)] pub fn HMAC(ht: hash::HashType, key: &[u8]) -> HMAC { unsafe { ffi::init(); let (evp, mdlen) = hash::evpmd(ht); let mut ctx : ffi::HMAC_CTX = ::std::mem::uninitialized(); Loading Loading
src/asn1/mod.rs +2 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,8 @@ impl Asn1Time { } fn new_with_period(period: u64) -> Result<Asn1Time, SslError> { ffi::init(); let handle = unsafe { try_ssl_null!(ffi::X509_gmtime_adj(ptr::null_mut(), period as c_long)) Loading
src/bio/mod.rs +2 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ impl Drop for MemBio { impl MemBio { /// Creates a new owned memory based BIO pub fn new() -> Result<MemBio, SslError> { ffi::init(); let bio = unsafe { ffi::BIO_new(ffi::BIO_s_mem()) }; try_ssl_null!(bio); Loading
src/bn/mod.rs +4 −0 Original line number Diff line number Diff line Loading @@ -79,8 +79,10 @@ macro_rules! with_bn_in_ctx( ) impl BigNum { // FIXME: squash 3 constructors into one pub fn new() -> Result<BigNum, SslError> { unsafe { ffi::init(); let v = ffi::BN_new(); if v.is_null() { Err(SslError::get()) Loading @@ -92,6 +94,7 @@ impl BigNum { pub fn new_from(n: u64) -> Result<BigNum, SslError> { unsafe { ffi::init(); let bn = ffi::BN_new(); if bn.is_null() || ffi::BN_set_word(bn, n as c_ulong) == 0 { Err(SslError::get()) Loading @@ -103,6 +106,7 @@ impl BigNum { pub fn new_from_slice(n: &[u8]) -> Result<BigNum, SslError> { unsafe { ffi::init(); let bn = ffi::BN_new(); if bn.is_null() || ffi::BN_bin2bn(n.as_ptr(), n.len() as c_int, bn).is_null() { Err(SslError::get()) Loading
src/crypto/hash.rs +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ pub struct Hasher { impl Hasher { pub fn new(ht: HashType) -> Hasher { ffi::init(); let ctx = unsafe { ffi::EVP_MD_CTX_create() }; let (evp, mdlen) = evpmd(ht); unsafe { Loading
src/crypto/hmac.rs +2 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ pub struct HMAC { #[allow(non_snake_case)] pub fn HMAC(ht: hash::HashType, key: &[u8]) -> HMAC { unsafe { ffi::init(); let (evp, mdlen) = hash::evpmd(ht); let mut ctx : ffi::HMAC_CTX = ::std::mem::uninitialized(); Loading