From: Julien Tanguy Date: Wed, 6 May 2015 11:53:36 +0000 (+0200) Subject: Haddock markup X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=7986de7cc40d5c063805b060c1796623d3584995;p=github%2Ffretlink%2Fhmacaroons.git Haddock markup [ci skip] --- 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 -- ^ Macaroon HMAC signature } +-- | Constant-time Eq instance instance Eq Macaroon where (MkMacaroon l1 i1 c1 s1) == (MkMacaroon l2 i2 c2 s2) = (l1 `constEqBytes` l2) &&! @@ -76,6 +77,7 @@ data Caveat = MkCaveat { cid :: Key -- ^ Caveat target location } +-- | Constant-time Eq instance instance Eq Caveat where (MkCaveat c1 v1 l1) == (MkCaveat c2 v2 l2) = (c1 `constEqBytes` c2) &&! diff --git a/src/Crypto/Macaroon/Serializer/Base64.hs b/src/Crypto/Macaroon/Serializer/Base64.hs index f6527c2..053d967 100644 --- a/src/Crypto/Macaroon/Serializer/Base64.hs +++ b/src/Crypto/Macaroon/Serializer/Base64.hs @@ -55,6 +55,7 @@ packetize key dat = do putByteString dat putByteString "\n" +-- | Deserialize a macaroon from a base64url-encoded ByteString deserialize :: BS.ByteString -> Either String Macaroon deserialize = parseOnly macaroon . B64.decodeLenient