diff options
author | joe <joe@jerkface.net> | 2013-11-09 20:17:28 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-11-09 20:17:28 -0500 |
commit | aceaab7b2f98188b269edf3ebd5223fbf7cdc2e9 (patch) | |
tree | 9c8661bfccbcc0934298f9373d2e0a43163cda29 | |
parent | 32550c6d55c4db0ed4e7d23b437c42aaa89382b1 (diff) |
Ability to output master keys.
-rw-r--r-- | kiki.hs | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1296,15 +1296,22 @@ main = do | |||
1296 | Message allpkts = m | 1296 | Message allpkts = m |
1297 | 1297 | ||
1298 | let topspec = case () of | 1298 | let topspec = case () of |
1299 | _ | null top -> {- trace "using grip" $ -} KeyGrip grip | 1299 | _ | null top && (subtyp=="fp" || (null subtyp && is40digitHex sub)) |
1300 | _ | is40digitHex top -> {- trace "using top" $ -} KeyGrip top | 1300 | -> KeyGrip sub |
1301 | _ | null top -> KeyGrip grip | ||
1302 | _ | toptyp=="fp" || (null toptyp && is40digitHex top) | ||
1303 | -> {- trace "using top" $ -} KeyGrip top | ||
1301 | _ | otherwise -> todo | 1304 | _ | otherwise -> todo |
1302 | (pre, wksubs) = seek_key topspec allpkts | 1305 | (pre, wksubs) = seek_key topspec allpkts |
1303 | if null wksubs then error ("No match for "++spec) else do | 1306 | if null wksubs then error ("No match for "++spec) else do |
1304 | let wk:subs = wksubs | 1307 | let wk:subs = wksubs |
1305 | (xs,ys) = seek_key (KeyTag wk sub) subs | 1308 | (_,ys) = case subtyp of |
1309 | "t" -> seek_key (KeyTag wk sub) subs | ||
1310 | "fp" | top=="" -> ([],wk:subs) | ||
1311 | "" | top=="" && is40digitHex sub -> ([],wk:subs) | ||
1312 | "" -> seek_key (KeyTag wk sub) subs | ||
1306 | when (not (null ys)) $ do | 1313 | when (not (null ys)) $ do |
1307 | let (xs',ys') = seek_key (KeyTag wk sub) (tail ys) | 1314 | let (_,ys') = seek_key (KeyTag wk sub) (tail ys) -- ambiguity check |
1308 | k = head ys | 1315 | k = head ys |
1309 | rsa = fromJust $ rsaKeyFromPacket k | 1316 | rsa = fromJust $ rsaKeyFromPacket k |
1310 | der = encodeASN1 DER (toASN1 rsa []) | 1317 | der = encodeASN1 DER (toASN1 rsa []) |