aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/Sanity.hs
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sanity.hs')
-rw-r--r--test/Sanity.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/Sanity.hs b/test/Sanity.hs
index 8def3ca..635e627 100644
--- a/test/Sanity.hs
+++ b/test/Sanity.hs
@@ -1,17 +1,17 @@
1{-#LANGUAGE OverloadedStrings#-} 1{-# LANGUAGE OverloadedStrings #-}
2module Sanity where 2module Sanity where
3 3
4import Crypto.Hash 4import Crypto.Hash
5import Data.ByteString (ByteString) 5import Data.Byteable
6import qualified Data.ByteString as B 6import Data.ByteString (ByteString)
7import Data.Hex 7import qualified Data.ByteString as B
8import Data.Byteable 8import Data.Hex
9 9
10import Test.Tasty 10import Test.Tasty
11import Test.Tasty.HUnit 11import Test.Tasty.HUnit
12 12
13import qualified Crypto.Macaroon.Tests
14import qualified Crypto.Macaroon.Serializer.Base64.Tests 13import qualified Crypto.Macaroon.Serializer.Base64.Tests
14import qualified Crypto.Macaroon.Tests
15 15
16tests :: TestTree 16tests :: TestTree
17tests = testGroup "Python HMAC Sanity check" [ checkKey 17tests = testGroup "Python HMAC Sanity check" [ checkKey
@@ -44,18 +44,18 @@ mac4 :: ByteString
44mac4 = toBytes (hmac mac3 "email = alice@example.org" :: HMAC SHA256) 44mac4 = toBytes (hmac mac3 "email = alice@example.org" :: HMAC SHA256)
45 45
46 46
47checkKey = testCase "Truncated key" $ 47checkKey = testCase "Truncated key" $
48 key @?= "this is our super secret key; on" 48 key @?= "this is our super secret key; on"
49 49
50checkMac1 = testCase "HMAC key" $ 50checkMac1 = testCase "HMAC key" $
51 "C60B4B3540BB1B2F2EF28D1C895691CC4A5E07A38A9D3B1C3379FB485293372F" @=? hex mac1 51 "C60B4B3540BB1B2F2EF28D1C895691CC4A5E07A38A9D3B1C3379FB485293372F" @=? hex mac1
52 52
53checkMac2 = testCase "HMAC key account" $ 53checkMac2 = testCase "HMAC key account" $
54 "5C933DC9A7D036DFCD1740B4F26D737397A1FF635EAC900F3226973503CAAAA5" @=? hex mac2 54 "5C933DC9A7D036DFCD1740B4F26D737397A1FF635EAC900F3226973503CAAAA5" @=? hex mac2
55 55
56checkMac3 = testCase "HMAC key account time" $ 56checkMac3 = testCase "HMAC key account time" $
57 "7A559B20C8B607009EBCE138C200585E9D0DECA6D23B3EAD6C5E0BA6861D3858" @=? hex mac3 57 "7A559B20C8B607009EBCE138C200585E9D0DECA6D23B3EAD6C5E0BA6861D3858" @=? hex mac3
58 58
59checkMac4 = testCase "HMAC key account time email" $ 59checkMac4 = testCase "HMAC key account time email" $
60 "E42BBB02A9A5A303483CB6295C497AE51AD1D5CB10003CBE548D907E7E62F5E4" @=? hex mac4 60 "E42BBB02A9A5A303483CB6295C497AE51AD1D5CB10003CBE548D907E7E62F5E4" @=? hex mac4
61 61