diff options
| author | Steven Fackler <[email protected]> | 2015-02-08 23:30:34 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-02-08 23:31:46 -0800 |
| commit | 6ef819f9718c3b43551461b72c531c2eeee878f9 (patch) | |
| tree | 4788a3c2a2ac6f425ab1b7317bc88bd1ebfc57d1 /openssl/src | |
| parent | Merge pull request #156 from s-panferov/patch-1 (diff) | |
| download | rust-openssl-6ef819f9718c3b43551461b72c531c2eeee878f9.tar.xz rust-openssl-6ef819f9718c3b43551461b72c531c2eeee878f9.zip | |
Fix builds against 0.9.x OpenSSL
Namely builds on OSX
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/crypto/hmac.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/openssl/src/crypto/hmac.rs b/openssl/src/crypto/hmac.rs index 65808e58..f3f5aee6 100644 --- a/openssl/src/crypto/hmac.rs +++ b/openssl/src/crypto/hmac.rs @@ -87,9 +87,9 @@ impl HMAC { #[inline] fn init_once(&mut self, md: *const ffi::EVP_MD, key: &[u8]) { unsafe { - let r = ffi::HMAC_Init_ex(&mut self.ctx, - key.as_ptr(), key.len() as c_int, - md, 0 as *const _); + let r = ffi::HMAC_Init_ex_shim(&mut self.ctx, + key.as_ptr(), key.len() as c_int, + md, 0 as *const _); assert_eq!(r, 1); } self.state = Reset; @@ -105,9 +105,9 @@ impl HMAC { // If the key and/or md is not supplied it's reused from the last time // avoiding redundant initializations unsafe { - let r = ffi::HMAC_Init_ex(&mut self.ctx, - 0 as *const _, 0, - 0 as *const _, 0 as *const _); + let r = ffi::HMAC_Init_ex_shim(&mut self.ctx, + 0 as *const _, 0, + 0 as *const _, 0 as *const _); assert_eq!(r, 1); } self.state = Reset; @@ -119,8 +119,7 @@ impl HMAC { self.init(); } unsafe { - let r = ffi::HMAC_Update(&mut self.ctx, data.as_ptr(), - data.len() as c_uint); + let r = ffi::HMAC_Update_shim(&mut self.ctx, data.as_ptr(), data.len() as c_uint); assert_eq!(r, 1); } self.state = Updated; @@ -135,7 +134,7 @@ impl HMAC { let mut res: Vec<u8> = repeat(0).take(md_len).collect(); unsafe { let mut len = 0; - let r = ffi::HMAC_Final(&mut self.ctx, res.as_mut_ptr(), &mut len); + let r = ffi::HMAC_Final_shim(&mut self.ctx, res.as_mut_ptr(), &mut len); self.state = Finalized; assert_eq!(len as usize, md_len); assert_eq!(r, 1); |