From 99ff0f49d3f668acf4a7d9e7f4da275a1cb327c2 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sat, 16 May 2020 10:04:13 -0400 Subject: Match v5 partial fingerprints from front rather than back. --- kiki.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'kiki.hs') diff --git a/kiki.hs b/kiki.hs index 0bc7133..03ea635 100644 --- a/kiki.hs +++ b/kiki.hs @@ -188,7 +188,9 @@ listKeysFiltered style grips pkts0 = do let issuers = do sig_over <- signatures_over sig i <- maybeToList $ signature_issuer sig_over - maybeToList $ find_key (matchpr i) (Message keys) (reverse (take 16 (reverse i))) + let sigkeyid i | version top == 5 = take 16 i + | otherwise = reverse . take 16 . reverse $ i + maybeToList $ find_key (matchpr (auto_fp_version sig_over) i) (Message keys) (sigkeyid i) (primary,secondary) = partition (==top) issuers -- trace ("PRIMARY: "++show (map fingerprint primary)) $ return () @@ -709,13 +711,13 @@ kiki_usage ((== Export) -> bExport) ((== Import) -> bImport) ((== Secret) -> bSe ," position to indicate whether a SUBKEY or MASTER is intended." ,"" ," MASTER may be any of" - ," * The tail end of a fingerprint prefixed by 'fp:'" + ," * The tail end (or, for v5, front end) of a fingerprint prefixed by 'fp:'" ," * A sub-string of a user id (without slashes) prefixed by 'u:'" ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" ," * A sub-string of a user id (without slashes, the prefix 'u:' is optional)" ,"" ," SUBKEY may be any of" - ," * The tail end of a fingerprint prefixed by 'fp:'" + ," * The tail end (or, for v5, front end) of a fingerprint prefixed by 'fp:'" ," * An exact match of a usage tag prefixed by 't:'" ," * 40 characters of hexidecimal (kiki will assume this to be a fingerprint)" ," * An exact match of a usage tag (The prefix 't:' is optional)" @@ -1642,7 +1644,8 @@ kiki "tar" args | "--help" `elem` args = do ," (current working identity)" ,"" ," fp:4A39F" - ," (tail end of a fingerprint prefixed by 'fp:')" + ," (tail end of a v4 fingerprint or the front end of a v5" + ," fingerprint prefixed by 'fp:')" ,"" ," u:joe" ," (sub-string of a user id prefixed by 'u:')" -- cgit v1.2.3