From 2c88eff31da391d25aa44006a0324369103049f4 Mon Sep 17 00:00:00 2001 From: adfoster-r7 Date: Thu, 21 Jul 2022 21:22:09 +0100 Subject: [PATCH] Add support for openssl3 with travis --- lib/openssl/cmac.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/openssl/cmac.rb b/lib/openssl/cmac.rb index d9f7240..c9f6e73 100644 --- a/lib/openssl/cmac.rb +++ b/lib/openssl/cmac.rb @@ -126,6 +126,7 @@ def reset @keys.clear @buffer.clear @cipher.reset unless @keys[0].nil? + @cipher.iv = "\x00" * 16 @cipher.encrypt self end @@ -160,6 +161,7 @@ def digest(length = 16) @cipher.reset @cipher.encrypt @cipher.key = @keys[0] + @cipher.iv = "\x00" * 16 # Each block is 16-bytes and the last block will always be PKCS#7 padding # which we want to discard. Take the last block prior to the padding for # the MAC.