summaryrefslogtreecommitdiff
path: root/kiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-04-12 02:21:16 -0400
committerjoe <joe@jerkface.net>2014-04-12 02:21:16 -0400
commit6fe0904372a25808d68000e32dac7826f9c1f0e9 (patch)
treee4607fc64ad3f9492554c7290199dab5bae5894e /kiki.hs
parent8c065b516ee67fbab860b07d5e81919f7c774a05 (diff)
simplification
Diffstat (limited to 'kiki.hs')
-rw-r--r--kiki.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/kiki.hs b/kiki.hs
index ab3faf5..496eb3c 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -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