diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Crypto/Macaroon/Verifier.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Crypto/Macaroon/Verifier.hs b/src/Crypto/Macaroon/Verifier.hs index 0d1636c..e257f5f 100644 --- a/src/Crypto/Macaroon/Verifier.hs +++ b/src/Crypto/Macaroon/Verifier.hs | |||
@@ -24,10 +24,10 @@ import Crypto.Macaroon.Internal | |||
24 | 24 | ||
25 | 25 | ||
26 | -- | Opaque datatype for now. Might need more explicit errors | 26 | -- | Opaque datatype for now. Might need more explicit errors |
27 | data Result = Success | Failure deriving (Show,Eq) | 27 | data VResult = VSuccess | VFailure deriving (Show,Eq) |
28 | 28 | ||
29 | verifySig :: Key -> Macaroon -> Result | 29 | verifySig :: Key -> Macaroon -> VResult |
30 | verifySig k m = bool Failure Success $ | 30 | verifySig k m = bool VFailure VSuccess $ |
31 | signature m == foldl' hash (toBytes (hmac derivedKey (identifier m) :: HMAC SHA256)) (caveats m) | 31 | signature m == foldl' hash (toBytes (hmac derivedKey (identifier m) :: HMAC SHA256)) (caveats m) |
32 | where | 32 | where |
33 | hash s c = toBytes (hmac s (vid c `BS.append` cid c) :: HMAC SHA256) | 33 | hash s c = toBytes (hmac s (vid c `BS.append` cid c) :: HMAC SHA256) |