diff options
| author | Steven Fackler <[email protected]> | 2016-10-14 16:28:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-10-14 16:28:00 -0700 |
| commit | b2c09440f6ec6f990b79a9a5bca41fb83f171ea6 (patch) | |
| tree | bccd17bfa9551cd5debe9244af295a22be316d3f /openssl/src | |
| parent | Merge pull request #464 from alexcrichton/systest (diff) | |
| parent | Remove link_name usage (diff) | |
| download | rust-openssl-b2c09440f6ec6f990b79a9a5bca41fb83f171ea6.tar.xz rust-openssl-b2c09440f6ec6f990b79a9a5bca41fb83f171ea6.zip | |
Merge pull request #468 from sfackler/no-link-name
Remove link_name usage
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/crypto/hash.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/openssl/src/crypto/hash.rs b/openssl/src/crypto/hash.rs index d87c43c5..e3bf4997 100644 --- a/openssl/src/crypto/hash.rs +++ b/openssl/src/crypto/hash.rs @@ -3,6 +3,11 @@ use std::io; use std::ptr; use ffi; +#[cfg(ossl110)] +use ffi::{EVP_MD_CTX_new, EVP_MD_CTX_free}; +#[cfg(any(ossl101, ossl102))] +use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free}; + use HashTypeInternals; use error::ErrorStack; use nid::Nid; @@ -100,7 +105,7 @@ impl Hasher { pub fn new(ty: Type) -> Result<Hasher, ErrorStack> { ffi::init(); - let ctx = unsafe { try_ssl_null!(ffi::EVP_MD_CTX_new()) }; + let ctx = unsafe { try_ssl_null!(EVP_MD_CTX_new()) }; let md = ty.evp_md(); let mut h = Hasher { @@ -172,7 +177,7 @@ impl Write for Hasher { impl Clone for Hasher { fn clone(&self) -> Hasher { let ctx = unsafe { - let ctx = ffi::EVP_MD_CTX_new(); + let ctx = EVP_MD_CTX_new(); assert!(!ctx.is_null()); let r = ffi::EVP_MD_CTX_copy_ex(ctx, self.ctx); assert_eq!(r, 1); @@ -193,7 +198,7 @@ impl Drop for Hasher { if self.state != Finalized { drop(self.finish()); } - ffi::EVP_MD_CTX_free(self.ctx); + EVP_MD_CTX_free(self.ctx); } } } |