diff options
Diffstat (limited to 'src/Crypto/Macaroon/Verifier')
-rw-r--r-- | src/Crypto/Macaroon/Verifier/Internal.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Crypto/Macaroon/Verifier/Internal.hs b/src/Crypto/Macaroon/Verifier/Internal.hs index 63d826d..b65b62d 100644 --- a/src/Crypto/Macaroon/Verifier/Internal.hs +++ b/src/Crypto/Macaroon/Verifier/Internal.hs | |||
@@ -44,7 +44,7 @@ instance Monoid ValidationError where | |||
44 | (ValidatorError e) `mappend` (ParseError _) = ValidatorError e | 44 | (ValidatorError e) `mappend` (ParseError _) = ValidatorError e |
45 | (ParseError _) `mappend` (ValidatorError e) = ValidatorError e | 45 | (ParseError _) `mappend` (ValidatorError e) = ValidatorError e |
46 | 46 | ||
47 | 47 | -- | Check that the given macaroon has a correct signature | |
48 | verifySig :: Key -> Macaroon -> Either ValidationError Macaroon | 48 | verifySig :: Key -> Macaroon -> Either ValidationError Macaroon |
49 | verifySig k m = bool (Left SigMismatch) (Right m) $ | 49 | verifySig k m = bool (Left SigMismatch) (Right m) $ |
50 | signature m == foldl' hash (toBytes (hmac derivedKey (identifier m) :: HMAC SHA256)) (caveats m) | 50 | signature m == foldl' hash (toBytes (hmac derivedKey (identifier m) :: HMAC SHA256)) (caveats m) |