From b845dc5c5ebad65472c43c6037fc32654562bc71 Mon Sep 17 00:00:00 2001 From: joe Date: Sun, 4 May 2014 20:09:19 -0400 Subject: removed deprecated argument to KeyRingFile --- KeyRing.hs | 15 ++++++++------- kiki.hs | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/KeyRing.hs b/KeyRing.hs index 9d046b6..b0d1b67 100644 --- a/KeyRing.hs +++ b/KeyRing.hs @@ -205,13 +205,10 @@ data InputFile = HomeSec -- type UsageTag = String type Initializer = String -type PasswordFile = InputFile -data FileType = KeyRingFile (Maybe PasswordFile) - -- ^ PasswordFile parameter is deprecated in favor - -- of opPassphrases. TODO: remove it. +data FileType = KeyRingFile | PEMFile - | WalletFile -- (Maybe UsageTag) + | WalletFile | Hosts -- | Use this type to indicate whether a file of type 'KeyRingFile' is expected @@ -301,9 +298,11 @@ ispem :: FileType -> Bool ispem (PEMFile {}) = True ispem _ = False -pwfile :: FileType -> Maybe PasswordFile +{- +pwfile :: FileType -> Maybe InputFile pwfile (KeyRingFile f) = f pwfile _ = Nothing +-} iswallet :: FileType -> Bool iswallet (WalletFile {}) = True @@ -1791,10 +1790,12 @@ makeMemoizingDecrypter operation ctx keys = do -- TODO: Perhaps these should both be of type InputFile rather than -- FilePath? -- pws :: Map.Map FilePath (IO S.ByteString) + {- pws <- Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ) (Map.mapKeys (resolveForReport Nothing) -- see note (*) note above $ Map.filter (isJust . pwfile . typ) $ opFiles operation) + -} pws2 <- Traversable.mapM (cachedContents ctx) $ Map.fromList $ mapMaybe @@ -1808,7 +1809,7 @@ makeMemoizingDecrypter operation ctx keys = do && isNothing (passSpecKeySpec sp)) $ opPassphrases operation unkeysRef <- newIORef (Map.empty :: Map.Map KeyKey Packet) - return $ doDecrypt unkeysRef (pws `Map.union` pws2) defpw + return $ doDecrypt unkeysRef ({- pws `Map.union` -} pws2) defpw where doDecrypt :: IORef (Map.Map KeyKey Packet) -> Map.Map FilePath (IO S.ByteString) diff --git a/kiki.hs b/kiki.hs index a3c0a56..cae8ae8 100644 --- a/kiki.hs +++ b/kiki.hs @@ -705,7 +705,7 @@ sync bExport bImport bSecret cmdarg args_raw = do , (buildStreamInfo reftyp WalletFile) { access = Sec })) wallets rings = map (\fname -> ( ArgFile fname - , buildStreamInfo reftyp $ KeyRingFile passfd)) + , buildStreamInfo reftyp KeyRingFile )) keyrings_ hosts = maybe [] (map decorate) $ Map.lookup "--hosts" margs where decorate fname = (ArgFile fname, buildStreamInfo reftyp Hosts) @@ -726,10 +726,10 @@ sync bExport bImport bSecret cmdarg args_raw = do { opFiles = Map.fromList $ [ ( HomeSec, buildStreamInfo (if bSecret && bImport then KF_All else KF_None) - (KeyRingFile passfd) ) + KeyRingFile ) , ( HomePub, buildStreamInfo (if bImport then pubfill else KF_None) - (KeyRingFile Nothing) ) + KeyRingFile ) ] ++ rings ++ if bSecret then pems else [] @@ -825,7 +825,7 @@ kiki "show" args = do hosts = [] walts = [] streaminfo = StreamInfo { fill = KF_None - , typ = KeyRingFile passfd + , typ = KeyRingFile , spill = KF_All , initializer = Nothing , access = AutoAccess -- cgit v1.2.3