diff options
Diffstat (limited to 'kiki.hs')
-rw-r--r-- | kiki.hs | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -1313,11 +1313,11 @@ cross_merge doDecrypt homespec keyrings wallets f = do | |||
1313 | , homeSpec = homespec | 1313 | , homeSpec = homespec |
1314 | , keyringFiles = keyrings | 1314 | , keyringFiles = keyrings |
1315 | , walletFiles = wallets | 1315 | , walletFiles = wallets |
1316 | , kaction = go | 1316 | , kaction = go doDecrypt f |
1317 | } | 1317 | } |
1318 | runKeyRing it | 1318 | runKeyRing it |
1319 | where | 1319 | where |
1320 | go rt = do | 1320 | go doDecrypt f rt = do |
1321 | let readp n = fmap (n,) (readPacketsFromFile n) | 1321 | let readp n = fmap (n,) (readPacketsFromFile n) |
1322 | readw wk n = fmap (n,) (readPacketsFromWallet wk n) | 1322 | readw wk n = fmap (n,) (readPacketsFromWallet wk n) |
1323 | 1323 | ||
@@ -1335,15 +1335,13 @@ cross_merge doDecrypt homespec keyrings wallets f = do | |||
1335 | guard $ matchSpec (KeyGrip fp) elm | 1335 | guard $ matchSpec (KeyGrip fp) elm |
1336 | return $ keyPacket (snd elm) | 1336 | return $ keyPacket (snd elm) |
1337 | wms <- mapM (readw wk) (rtWallets rt) | 1337 | wms <- mapM (readw wk) (rtWallets rt) |
1338 | let -- db1= foldl' (uncurry . merge_) db0 wms | 1338 | let ts = do |
1339 | ts = do | ||
1340 | maybeToList wk | 1339 | maybeToList wk |
1341 | (fname,xs) <- wms | 1340 | (fname,xs) <- wms |
1342 | (_,sub,(_,m)) <- xs | 1341 | (_,sub,(_,m)) <- xs |
1343 | (tag,top) <- Map.toList m | 1342 | (tag,top) <- Map.toList m |
1344 | return (top,fname,sub,tag) | 1343 | return (top,fname,sub,tag) |
1345 | 1344 | ||
1346 | -- sig' <- makeSig doDecrypt top fname subkey_p tag mbsig | ||
1347 | importWalletKey db' (top,fname,sub,tag) = do | 1345 | importWalletKey db' (top,fname,sub,tag) = do |
1348 | doImportG doDecrypt | 1346 | doImportG doDecrypt |
1349 | db' | 1347 | db' |
@@ -1377,12 +1375,8 @@ cross_merge doDecrypt homespec keyrings wallets f = do | |||
1377 | warn $ n++": new WalletKey "++net | 1375 | warn $ n++": new WalletKey "++net |
1378 | hPutStrLn fh wip | 1376 | hPutStrLn fh wip |
1379 | 1377 | ||
1380 | -- unlockFiles fsns ----------- Originally, I did this to enable altering the gpg keyrings | 1378 | db' <- f (rtSecring rt,grip) db (rtPubring rt) |
1381 | ------------------------------- from external tools. | ||
1382 | (db',_) <- f (rtSecring rt,grip) db (rtPubring rt) | ||
1383 | -- lk <- relock --------------- The design is not quite safe, so it is disabled for now. | ||
1384 | let lk = (rtRings rt,[]) | 1379 | let lk = (rtRings rt,[]) |
1385 | ------------------------------- | ||
1386 | maybe (if n==0 then pass 1 else return (lk,db)) | 1380 | maybe (if n==0 then pass 1 else return (lk,db)) |
1387 | (return . (lk,)) | 1381 | (return . (lk,)) |
1388 | db' | 1382 | db' |
@@ -2553,7 +2547,7 @@ main = do | |||
2553 | shargs = mapMaybe (\(x:xs) -> (,xs) <$> Map.lookup x shspec) sargs | 2547 | shargs = mapMaybe (\(x:xs) -> (,xs) <$> Map.lookup x shspec) sargs |
2554 | 2548 | ||
2555 | forM_ shargs $ \(cmd,args) -> cmd args use_db | 2549 | forM_ shargs $ \(cmd,args) -> cmd args use_db |
2556 | return $ (ret_db,use_db) | 2550 | return ret_db |
2557 | 2551 | ||
2558 | return() | 2552 | return() |
2559 | where | 2553 | where |