From 6d2f8d67f2423ba6a337359ecf0188bd52227dce Mon Sep 17 00:00:00 2001 From: Ummon Date: Wed, 10 Dec 2014 22:25:32 +0100 Subject: Add the openssl function prototype 'HMAC_CTX_cleanup'. --- src/crypto/hmac.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/crypto/hmac.rs b/src/crypto/hmac.rs index a7a854b7..8096a948 100644 --- a/src/crypto/hmac.rs +++ b/src/crypto/hmac.rs @@ -61,6 +61,14 @@ impl HMAC { } } +impl Drop for HMAC { + fn drop(&mut self) { + unsafe { + ffi::HMAC_CTX_cleanup(&mut self.ctx); + } + } +} + #[cfg(test)] mod tests { use serialize::hex::FromHex; -- cgit v1.2.3