summaryrefslogtreecommitdiff
path: root/KeyRing.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-05-04 20:09:19 -0400
committerjoe <joe@jerkface.net>2014-05-04 20:09:19 -0400
commitb845dc5c5ebad65472c43c6037fc32654562bc71 (patch)
treed3e3a62f8d28d16c34353d3fd63b14166815c499 /KeyRing.hs
parent2f31a27316faf3de5008fcb5f49316e5178827e6 (diff)
removed deprecated argument to KeyRingFile
Diffstat (limited to 'KeyRing.hs')
-rw-r--r--KeyRing.hs15
1 files changed, 8 insertions, 7 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
205 205
206-- type UsageTag = String 206-- type UsageTag = String
207type Initializer = String 207type Initializer = String
208type PasswordFile = InputFile
209 208
210data FileType = KeyRingFile (Maybe PasswordFile) 209data FileType = KeyRingFile
211 -- ^ PasswordFile parameter is deprecated in favor
212 -- of opPassphrases. TODO: remove it.
213 | PEMFile 210 | PEMFile
214 | WalletFile -- (Maybe UsageTag) 211 | WalletFile
215 | Hosts 212 | Hosts
216 213
217-- | Use this type to indicate whether a file of type 'KeyRingFile' is expected 214-- | Use this type to indicate whether a file of type 'KeyRingFile' is expected
@@ -301,9 +298,11 @@ ispem :: FileType -> Bool
301ispem (PEMFile {}) = True 298ispem (PEMFile {}) = True
302ispem _ = False 299ispem _ = False
303 300
304pwfile :: FileType -> Maybe PasswordFile 301{-
302pwfile :: FileType -> Maybe InputFile
305pwfile (KeyRingFile f) = f 303pwfile (KeyRingFile f) = f
306pwfile _ = Nothing 304pwfile _ = Nothing
305-}
307 306
308iswallet :: FileType -> Bool 307iswallet :: FileType -> Bool
309iswallet (WalletFile {}) = True 308iswallet (WalletFile {}) = True
@@ -1791,10 +1790,12 @@ makeMemoizingDecrypter operation ctx keys = do
1791 -- TODO: Perhaps these should both be of type InputFile rather than 1790 -- TODO: Perhaps these should both be of type InputFile rather than
1792 -- FilePath? 1791 -- FilePath?
1793 -- pws :: Map.Map FilePath (IO S.ByteString) 1792 -- pws :: Map.Map FilePath (IO S.ByteString)
1793 {-
1794 pws <- 1794 pws <-
1795 Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ) 1795 Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ)
1796 (Map.mapKeys (resolveForReport Nothing) -- see note (*) note above 1796 (Map.mapKeys (resolveForReport Nothing) -- see note (*) note above
1797 $ Map.filter (isJust . pwfile . typ) $ opFiles operation) 1797 $ Map.filter (isJust . pwfile . typ) $ opFiles operation)
1798 -}
1798 pws2 <- 1799 pws2 <-
1799 Traversable.mapM (cachedContents ctx) 1800 Traversable.mapM (cachedContents ctx)
1800 $ Map.fromList $ mapMaybe 1801 $ Map.fromList $ mapMaybe
@@ -1808,7 +1809,7 @@ makeMemoizingDecrypter operation ctx keys = do
1808 && isNothing (passSpecKeySpec sp)) 1809 && isNothing (passSpecKeySpec sp))
1809 $ opPassphrases operation 1810 $ opPassphrases operation
1810 unkeysRef <- newIORef (Map.empty :: Map.Map KeyKey Packet) 1811 unkeysRef <- newIORef (Map.empty :: Map.Map KeyKey Packet)
1811 return $ doDecrypt unkeysRef (pws `Map.union` pws2) defpw 1812 return $ doDecrypt unkeysRef ({- pws `Map.union` -} pws2) defpw
1812 where 1813 where
1813 doDecrypt :: IORef (Map.Map KeyKey Packet) 1814 doDecrypt :: IORef (Map.Map KeyKey Packet)
1814 -> Map.Map FilePath (IO S.ByteString) 1815 -> Map.Map FilePath (IO S.ByteString)