diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-08-16 11:41:25 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-08-16 11:41:25 -0700 |
commit | 379f036b39e0f7dac360ba04b281f6ea4ce8f20e (patch) | |
tree | 01a86517d6234562088561c3c4b51365ed722807 /doc/todo/Fix_compiler_errors_in_HEAD.mdwn | |
parent | 680449e656820db2b899a8631060cf62359b9b74 (diff) | |
parent | 0229f026b1ae0344c4c052593564800035268d81 (diff) | |
download | keysafe-379f036b39e0f7dac360ba04b281f6ea4ce8f20e.tar.gz |
Merge tag '0.20170811'
tagging package keysafe version 0.20170811
# gpg: Signature made Fri 11 Aug 2017 03:58:54 PM MST
# gpg: using RSA key 28A500C35207EAB72F6C0F25DB12DB0FF05F8F38
# gpg: Good signature from "Joey Hess <joeyh@joeyh.name>" [full]
# Primary key fingerprint: E85A 5F63 B31D 24C1 EBF0 D81C C910 D922 2512 E3C7
# Subkey fingerprint: 28A5 00C3 5207 EAB7 2F6C 0F25 DB12 DB0F F05F 8F38
Diffstat (limited to 'doc/todo/Fix_compiler_errors_in_HEAD.mdwn')
-rw-r--r-- | doc/todo/Fix_compiler_errors_in_HEAD.mdwn | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/doc/todo/Fix_compiler_errors_in_HEAD.mdwn b/doc/todo/Fix_compiler_errors_in_HEAD.mdwn new file mode 100644 index 0000000..08dbdc8 --- /dev/null +++ b/doc/todo/Fix_compiler_errors_in_HEAD.mdwn @@ -0,0 +1,78 @@ +``` +From e1fee7bb9dd508b9bef420fd76292f91bb151c8c Mon Sep 17 00:00:00 2001 +From: Mitchell Rosen <mitchellwrosen@gmail.com> +Date: Sat, 1 Apr 2017 14:39:41 -0400 +Subject: [PATCH 1/1] Fix compiler errors + +--- + HTTP/ProofOfWork.hs | 8 ++++---- + HTTP/Server.hs | 3 ++- + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/HTTP/ProofOfWork.hs b/HTTP/ProofOfWork.hs +index 0237347..9a10d39 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 +@@ -55,7 +55,7 @@ instance Hashable RequestID where + hashIO64 = hashIO64 . hashRequestID + + hashRequestID :: RequestID -> B.ByteString +-hashRequestID rid = encodeUtf8 (fromRandomSalt (randomSalt rid)) ++hashRequestID rid = encodeUtf8 (fromRandomSalt (randomSalt rid)) + <> ":" <> encodeUtf8 (requestHMAC rid) + + -- | Using Text and not ByteString so that ProofOfWorkRequirement can have a +@@ -80,7 +80,7 @@ maxProofOfWork = Seconds (16*60) + -- on the very first try. On average, the client will need to work for half + -- as long as the returned number of Seconds. + generationTime :: ProofOfWorkRequirement -> Seconds +-generationTime req = ++generationTime req = + let UseArgon2 (CPUCost (Seconds s) _) _ = proofOfWorkHashTunable (addedArgon2Iterations req) + in Seconds ((2^(leadingZeros req)) * s) + +@@ -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 = +diff --git a/HTTP/Server.hs b/HTTP/Server.hs +index 61bdbfd..12a8f26 100644 +--- a/HTTP/Server.hs ++++ b/HTTP/Server.hs +@@ -18,6 +18,7 @@ import CmdLine (ServerConfig(..)) + import Storage.Local + import Serialization () + import Servant ++import Network.Wai (Application) + import Network.Wai.Handler.Warp + import Control.Monad.IO.Class + import Control.Concurrent +@@ -51,7 +52,7 @@ runServer d cfg = do + _ <- forkIO $ obscurerThread st + runSettings settings (app st) + where +- settings = setHost host $ setPort (serverPort cfg) $ defaultSettings ++ settings = setHost host $ setPort (serverPort cfg) $ defaultSettings + host = fromString (serverAddress cfg) + + serverStorage :: Maybe LocalStorageDirectory -> Storage +-- +2.12.1 +``` + +> Thanks for the patch; I applied essentially these fixes although +> untangled the unrelated issues. [[done]] --[[Joey]] |