summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2014-05-11 00:33:47 -0400
committerjoe <joe@jerkface.net>2014-05-11 00:33:47 -0400
commit91efbba981f62b60514e6f250907fb654c622c79 (patch)
tree0778a0f8512279b894cf96c63aec76e65438bc7a
parent8d0e428001e870188ecbc3c322c5dafcae6baa30 (diff)
doImportG now takes subpackets instead of tag string
-rw-r--r--KeyRing.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/KeyRing.hs b/KeyRing.hs
index f97c37c..7e9fa17 100644
--- a/KeyRing.hs
+++ b/KeyRing.hs
@@ -1330,7 +1330,7 @@ buildKeyDB ctx grip0 keyring = do
1330 r <- doImportG doDecrypt 1330 r <- doImportG doDecrypt
1331 db' 1331 db'
1332 (fmap keykey $ maybeToList wk) 1332 (fmap keykey $ maybeToList wk)
1333 tag 1333 [mkUsage tag]
1334 fname 1334 fname
1335 sub 1335 sub
1336 try r $ \(db'',report) -> do 1336 try r $ \(db'',report) -> do
@@ -1519,7 +1519,7 @@ doImport doDecrypt db (fname,subspec,ms,_) = do
1519 if (not (null tailms) || null m0) 1519 if (not (null tailms) || null m0)
1520 then return $ AmbiguousKeySpec fname 1520 then return $ AmbiguousKeySpec fname
1521 else do 1521 else do
1522 r <- doImportG doDecrypt db m0 tag fname key 1522 r <- doImportG doDecrypt db m0 [mkUsage tag] fname key
1523 try r $ \(db',report') -> do 1523 try r $ \(db',report') -> do
1524 return $ KikiSuccess (db',report++report') 1524 return $ KikiSuccess (db',report++report')
1525 1525
@@ -1528,11 +1528,11 @@ doImportG
1528 (MappedPacket -> IO (KikiCondition Packet)) 1528 (MappedPacket -> IO (KikiCondition Packet))
1529 -> Map.Map k KeyData 1529 -> Map.Map k KeyData
1530 -> [k] 1530 -> [k]
1531 -> [Char] 1531 -> [SignatureSubpacket]
1532 -> [Char] 1532 -> [Char]
1533 -> Packet 1533 -> Packet
1534 -> IO (KikiCondition (Map.Map k KeyData, [(FilePath,KikiReportAction)])) 1534 -> IO (KikiCondition (Map.Map k KeyData, [(FilePath,KikiReportAction)]))
1535doImportG doDecrypt db m0 tag fname key = do 1535doImportG doDecrypt db m0 tags fname key = do
1536 let kk = head m0 1536 let kk = head m0
1537 Just (KeyData top topsigs uids subs) = Map.lookup kk db 1537 Just (KeyData top topsigs uids subs) = Map.lookup kk db
1538 subkk = keykey key 1538 subkk = keykey key
@@ -1550,7 +1550,7 @@ doImportG doDecrypt db m0 tag fname key = do
1550 subs' = Map.insert subkk subkey subs 1550 subs' = Map.insert subkk subkey subs
1551 1551
1552 istor = do 1552 istor = do
1553 guard (tag == "tor") 1553 guard ("tor" `elem` mapMaybe usage tags)
1554 return $ "Anonymous <root@" ++ take 16 (torhash key) ++ ".onion>" 1554 return $ "Anonymous <root@" ++ take 16 (torhash key) ++ ".onion>"
1555 1555
1556 uids' <- flip (maybe $ return $ KikiSuccess (uids,[])) istor $ \idstr -> do 1556 uids' <- flip (maybe $ return $ KikiSuccess (uids,[])) istor $ \idstr -> do
@@ -1587,10 +1587,10 @@ doImportG doDecrypt db m0 tag fname key = do
1587 1587
1588 let SubKey subkey_p subsigs = subkey 1588 let SubKey subkey_p subsigs = subkey
1589 wk = packet top 1589 wk = packet top
1590 (xs',minsig,ys') = findTag [mkUsage tag] wk key subsigs 1590 (xs',minsig,ys') = findTag tags wk key subsigs
1591 doInsert mbsig db = do 1591 doInsert mbsig db = do
1592 -- NEW SUBKEY BINDING SIGNATURE 1592 -- NEW SUBKEY BINDING SIGNATURE
1593 sig' <- makeSig doDecrypt top fname subkey_p [mkUsage tag] mbsig 1593 sig' <- makeSig doDecrypt top fname subkey_p tags mbsig
1594 try sig' $ \(sig',report) -> do 1594 try sig' $ \(sig',report) -> do
1595 report <- return $ fmap (fname,) report ++ [(fname, YieldSignature)] 1595 report <- return $ fmap (fname,) report ++ [(fname, YieldSignature)]
1596 let subs' = Map.insert subkk 1596 let subs' = Map.insert subkk