diff options
Diffstat (limited to 'src/Crypto/Macaroon/Internal.hs')
-rw-r--r-- | src/Crypto/Macaroon/Internal.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Crypto/Macaroon/Internal.hs b/src/Crypto/Macaroon/Internal.hs index ebd25cb..02b7963 100644 --- a/src/Crypto/Macaroon/Internal.hs +++ b/src/Crypto/Macaroon/Internal.hs | |||
@@ -44,6 +44,7 @@ data Macaroon = MkMacaroon { location :: Location | |||
44 | -- ^ Macaroon HMAC signature | 44 | -- ^ Macaroon HMAC signature |
45 | } | 45 | } |
46 | 46 | ||
47 | -- | Constant-time Eq instance | ||
47 | instance Eq Macaroon where | 48 | instance Eq Macaroon where |
48 | (MkMacaroon l1 i1 c1 s1) == (MkMacaroon l2 i2 c2 s2) = | 49 | (MkMacaroon l1 i1 c1 s1) == (MkMacaroon l2 i2 c2 s2) = |
49 | (l1 `constEqBytes` l2) &&! | 50 | (l1 `constEqBytes` l2) &&! |
@@ -76,6 +77,7 @@ data Caveat = MkCaveat { cid :: Key | |||
76 | -- ^ Caveat target location | 77 | -- ^ Caveat target location |
77 | } | 78 | } |
78 | 79 | ||
80 | -- | Constant-time Eq instance | ||
79 | instance Eq Caveat where | 81 | instance Eq Caveat where |
80 | (MkCaveat c1 v1 l1) == (MkCaveat c2 v2 l2) = | 82 | (MkCaveat c1 v1 l1) == (MkCaveat c2 v2 l2) = |
81 | (c1 `constEqBytes` c2) &&! | 83 | (c1 `constEqBytes` c2) &&! |