diff options
Diffstat (limited to 'KeyRing.hs')
-rw-r--r-- | KeyRing.hs | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1370,6 +1370,8 @@ writeWalletKeys krd db wk = do | |||
1370 | let wip = walletImportFormat (CryptoCoins.private_byte_id nw) (packet mp) | 1370 | let wip = walletImportFormat (CryptoCoins.private_byte_id nw) (packet mp) |
1371 | return (CryptoCoins.network_name nw,wip) | 1371 | return (CryptoCoins.network_name nw,wip) |
1372 | handleIO_ (return report) $ do | 1372 | handleIO_ (return report) $ do |
1373 | -- TODO: This AppendMode stratagy is not easy to adapt from FilePath-based | ||
1374 | -- to InputFile-based. | ||
1373 | withFile n AppendMode $ \fh -> do | 1375 | withFile n AppendMode $ \fh -> do |
1374 | rs <- forM cs' $ \(net,wip) -> do | 1376 | rs <- forM cs' $ \(net,wip) -> do |
1375 | hPutStrLn fh wip | 1377 | hPutStrLn fh wip |
@@ -1607,11 +1609,8 @@ makeMemoizingDecrypter :: KeyRingOperation -> InputFileContext | |||
1607 | -> IO (MappedPacket -> IO (KikiCondition Packet)) | 1609 | -> IO (MappedPacket -> IO (KikiCondition Packet)) |
1608 | makeMemoizingDecrypter operation ctx = do | 1610 | makeMemoizingDecrypter operation ctx = do |
1609 | pws <- | 1611 | pws <- |
1610 | -- TODO: head will throw an exception if a File Descriptor operation | ||
1611 | -- file is present. We probably should change OriginMap to use InputFile | ||
1612 | -- instead of FilePath. | ||
1613 | Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ) | 1612 | Traversable.mapM (cachedContents ctx . fromJust . pwfile . typ) |
1614 | (Map.mapKeys (head . resolveInputFile ctx) | 1613 | (Map.mapKeys (resolveForReport $ Just ctx) |
1615 | $ Map.filter (isJust . pwfile . typ) $ kFiles operation) | 1614 | $ Map.filter (isJust . pwfile . typ) $ kFiles operation) |
1616 | unkeysRef <- newIORef Map.empty | 1615 | unkeysRef <- newIORef Map.empty |
1617 | return $ doDecrypt unkeysRef pws | 1616 | return $ doDecrypt unkeysRef pws |
@@ -2278,7 +2277,7 @@ uidkey (UserIDPacket str) = str | |||
2278 | merge :: KeyDB -> InputFile -> Message -> KeyDB | 2277 | merge :: KeyDB -> InputFile -> Message -> KeyDB |
2279 | merge db inputfile (Message ps) = merge_ db filename qs | 2278 | merge db inputfile (Message ps) = merge_ db filename qs |
2280 | where | 2279 | where |
2281 | filename = concat $ resolveInputFile (InputFileContext "&secret" "&public") inputfile | 2280 | filename = resolveForReport Nothing inputfile |
2282 | 2281 | ||
2283 | qs = scanPackets filename ps | 2282 | qs = scanPackets filename ps |
2284 | 2283 | ||