diff --git a/openssl/hmac.go b/openssl/hmac.go index 204c94c..80f320b 100644 --- a/openssl/hmac.go +++ b/openssl/hmac.go @@ -45,6 +45,7 @@ func NewHMAC(h func() hash.Hash, key []byte) hash.Hash { key: hkey, ctx: hmacCtxNew(), } + runtime.SetFinalizer(hmac, (*opensslHMAC).finalize) hmac.Reset() return hmac }