diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-03 15:04:55 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-03 15:04:55 -0400 |
commit | 11dff5f1cae3c434e32c1619b339c7c7cb8af218 (patch) | |
tree | 5e9d752fece0707c7495ca3fd1e4dcf1c7337089 /HTTP | |
parent | 62283447efbda834ab77cfb032ae460864093fbf (diff) | |
download | keysafe-11dff5f1cae3c434e32c1619b339c7c7cb8af218.tar.gz |
fix bad patch in 6c289708280f721338a3f334196cf92f99ea2d14
That did not compile it seems and seems I didn't test it either before
applying. This should do the same thing.
Diffstat (limited to 'HTTP')
-rw-r--r-- | HTTP/ProofOfWork.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/HTTP/ProofOfWork.hs b/HTTP/ProofOfWork.hs index 0237347..54e2223 100644 --- a/HTTP/ProofOfWork.hs +++ b/HTTP/ProofOfWork.hs @@ -16,7 +16,7 @@ import ByteStrings import GHC.Generics import qualified Data.Text as T import qualified Data.ByteString as B -import Data.Text.Encoding (encodeUtf8) +import Data.Text.Encoding (decodeUtf8, encodeUtf8) import Raaz.Core.Encode import qualified Raaz import Data.BloomFilter.Hash @@ -109,7 +109,7 @@ mkRequestID secret = mkRequeestID' secret <$> mkRandomSalt mkRequeestID' :: RequestIDSecret -> RandomSalt -> RequestID mkRequeestID' (RequestIDSecret key) salt = let hmac = Raaz.hmacSha256 key (encodeUtf8 $ fromRandomSalt salt) - in RequestID salt $ T.toByteString (Raaz.encode hmac :: Base16) + in RequestID salt $ decodeUtf8 $ Raaz.toByteString (Raaz.encode hmac :: Base16) validRequestID :: RequestIDSecret -> RequestID -> Bool validRequestID secret rid = |