From b1ae1ecdc9d1f16134ea40b07a6cedcc26a94db8 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 6 Jul 2019 17:26:54 -0400 Subject: Quiet down some of the warnings. --- lib/KeyRing/BuildKeyDB.hs | 8 +++++++- lib/PacketTranscoder.hs | 7 ++++--- lib/Transforms.hs | 13 ++++++------- 3 files changed, 17 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs index dd204d1..9a806a3 100644 --- a/lib/KeyRing/BuildKeyDB.hs +++ b/lib/KeyRing/BuildKeyDB.hs @@ -673,7 +673,13 @@ merge_ db filename qs = foldl mergeit db (zip [0..] qs) whatP (a,_) = concat . take 1 . words . show $ a --- insertSubkey :: (MappedPacket -> IO (KikiCondition Packet)) -> t -> KeyData -> [SignatureSubpacket] -> [Char] -> Packet -> IO (KikiCondition (KeyData, [([Char], KikiReportAction)])) +insertSubkey :: PacketTranscoder + -> keykey + -> KeyData + -> [SignatureSubpacket] + -> InputFile + -> Packet + -> IO (KikiCondition (KeyData, [(FilePath, KikiReportAction)])) insertSubkey transcode kk (KeyData top topsigs uids subs) tags inputfile key0 = do let topcipher = symmetric_algorithm $ packet top tops2k = s2k $ packet top diff --git a/lib/PacketTranscoder.hs b/lib/PacketTranscoder.hs index 830ec2f..730a221 100644 --- a/lib/PacketTranscoder.hs +++ b/lib/PacketTranscoder.hs @@ -106,9 +106,9 @@ interpretPassSpec :: InputFileContext -> (Maybe MappedPacket, Map.Map KeyKey (OriginMapped Query)) -> PassphraseSpec -> IO (KikiCondition (PassphraseSource, IO ()) ) -interpretPassSpec ctx keys PassphraseSpec { passSpecPassFile = fd - , passSpecKeySpec = keyspec - , passSpecRingFile = inputfile } = do +interpretPassSpec ctx _ PassphraseSpec { passSpecPassFile = fd + , passSpecKeySpec = keyspec + , passSpecRingFile = inputfile } = do getpw <- cachedContents (Just "Enter possibly multi-line passphrase (Press CTRL-D when finished):\n") ctx @@ -241,6 +241,7 @@ transcodeWithCache unkeysRef miss alg0 mp@MappedPacket{ packet = wk } = do else maybe (miss alg mp) (return . KikiSuccess) $ Map.lookup (keykey wk,fst alg, snd alg) unkeys +tryInOrder :: [PacketTranscoder] -> PacketTranscoder tryInOrder [] _ _ = return BadPassphrase tryInOrder [f] alg mp = f alg mp tryInOrder (f:fs) alg mp = do diff --git a/lib/Transforms.hs b/lib/Transforms.hs index 664cf86..adb7830 100644 --- a/lib/Transforms.hs +++ b/lib/Transforms.hs @@ -343,17 +343,16 @@ getBindings :: -> ( [([Packet],[SignatureOver])] -- other signatures with key sets -- that were used for the verifications - , [(Word8, - (Packet, Packet), -- (topkey,subkey) - [String], -- usage flags + , [(Word8, -- 1-master, 2-subkey, 0-other(see last element of tuple) + (Packet, Packet), -- (topkey,subkey) + [String], -- usage flags [SignatureSubpacket], -- hashed data - [Packet])] -- binding signatures + [Packet])] -- binding signatures ) getBindings pkts = (sigs,bindings) where (sigs,concat->bindings) = unzip $ do - let (keys,_) = partition isKey pkts - keys <- disjoint_fp keys + keys <- disjoint_fp (filter isKey pkts) let (bs,sigs) = verifyBindings keys pkts return . ((keys,sigs),) $ do b <- bs -- trace ("sigs = "++show (map (map signature_issuer . signatures_over) sigs)) bs @@ -370,7 +369,7 @@ getBindings pkts = (sigs,bindings) return (code,(topkey b,subkey b), kind, hashed,claimants) --- Returned data is simmilar to getBindings but the Word8 codes +-- Returned data is similar to getBindings but the Word8 codes -- are ORed together. accBindings :: Bits t => -- cgit v1.2.3