From 786d272fdf723987e582da16e511f067abf671a5 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 2 Aug 2018 17:26:23 -0400 Subject: Move BTLS.ConstantTimeEquals into the BTLS.BoringSSL hierarchy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s a direct wrapper around a BoringSSL function, so it really belongs there. --- src/Data/HMAC.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Data') diff --git a/src/Data/HMAC.hs b/src/Data/HMAC.hs index a6b72fe..b0387c6 100644 --- a/src/Data/HMAC.hs +++ b/src/Data/HMAC.hs @@ -25,8 +25,8 @@ import Foreign.Marshal.Unsafe (unsafeLocalState) import BTLS.BoringSSL.Base import BTLS.BoringSSL.HMAC +import BTLS.BoringSSL.Mem (cryptoMemcmp) import BTLS.Cast (asCUCharBuf) -import BTLS.ConstantTimeEquals (constantTimeEquals) import BTLS.Types (SecretKey(SecretKey)) import Data.Digest.Internal (Algorithm(Algorithm), Digest(Digest), initUpdateFinalize) @@ -42,7 +42,7 @@ instance Eq HMAC where unsafeLocalState $ ByteString.unsafeUseAsCStringLen a $ \(a', size) -> ByteString.unsafeUseAsCStringLen b $ \(b', _) -> - constantTimeEquals a' b' size + cryptoMemcmp a' b' size instance Show HMAC where show (HMAC m) = show (Digest m) -- cgit v1.2.3