aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-12-10 13:37:03 -0800
committerSteven Fackler <[email protected]>2014-12-10 13:37:03 -0800
commitae9e2b1e257a744fa538cf3db299cac0584b4417 (patch)
tree2a83cbb0a893bff7c04553123022c501c95cdff0 /src
parentMerge pull request #114 from DiamondLovesYou/master (diff)
parentAdd the openssl function prototype 'HMAC_CTX_cleanup'. (diff)
downloadrust-openssl-ae9e2b1e257a744fa538cf3db299cac0584b4417.tar.xz
rust-openssl-ae9e2b1e257a744fa538cf3db299cac0584b4417.zip
Merge pull request #117 from Ummon/master
Add the openssl function prototype 'HMAC_CTX_cleanup'.
Diffstat (limited to 'src')
-rw-r--r--src/crypto/hmac.rs8
1 files changed, 8 insertions, 0 deletions
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;