summaryrefslogtreecommitdiff
path: root/lib/KeyRing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/KeyRing')
-rw-r--r--lib/KeyRing/BuildKeyDB.hs11
-rw-r--r--lib/KeyRing/Types.hs1
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/KeyRing/BuildKeyDB.hs b/lib/KeyRing/BuildKeyDB.hs
index 510c820..ef4edba 100644
--- a/lib/KeyRing/BuildKeyDB.hs
+++ b/lib/KeyRing/BuildKeyDB.hs
@@ -416,9 +416,9 @@ parseSpec wkgrip spec =
416 case prespec of 416 case prespec of
417 AnyMatch -> (KeyGrip "", Nothing) 417 AnyMatch -> (KeyGrip "", Nothing)
418 EmptyMatch -> error "Bad key spec." 418 EmptyMatch -> error "Bad key spec."
419 WorkingKeyMatch -> (KeyGrip $ show wkgrip, Nothing) 419 WorkingKeyMatch -> (KeyExact wkgrip, Nothing)
420 SubstringMatch (Just KeyTypeField) tag -> (KeyGrip $ show wkgrip, Just tag) 420 SubstringMatch (Just KeyTypeField) tag -> (KeyExact wkgrip, Just tag)
421 SubstringMatch Nothing str -> (KeyGrip $ show wkgrip, Just str) 421 SubstringMatch Nothing str -> (KeyExact wkgrip, Just str)
422 SubstringMatch (Just UserIDField) ustr -> (KeyUidMatch ustr, Nothing) 422 SubstringMatch (Just UserIDField) ustr -> (KeyUidMatch ustr, Nothing)
423 FingerprintMatch fp -> (KeyGrip fp, Nothing) 423 FingerprintMatch fp -> (KeyGrip fp, Nothing)
424 else 424 else
@@ -780,6 +780,11 @@ is40digitHex xs = ys == xs && length ys==40
780 ishex c = False 780 ishex c = False
781 781
782matchSpec :: KeySpec -> KeyData -> Bool 782matchSpec :: KeySpec -> KeyData -> Bool
783matchSpec (KeyExact Nothing) _ = False
784matchSpec (KeyExact (Just grip)) (KeyData p _ _ _)
785 | matchpr grip (packet p) = True
786 | otherwise = False
787
783matchSpec (KeyGrip grip) (KeyData p _ _ _) 788matchSpec (KeyGrip grip) (KeyData p _ _ _)
784 | matchpr' grip (packet p) = True 789 | matchpr' grip (packet p) = True
785 | otherwise = False 790 | otherwise = False
diff --git a/lib/KeyRing/Types.hs b/lib/KeyRing/Types.hs
index 1a12a61..99986e1 100644
--- a/lib/KeyRing/Types.hs
+++ b/lib/KeyRing/Types.hs
@@ -367,6 +367,7 @@ matchpr'' fp k | otherwise = ""
367 367
368data KeySpec = 368data KeySpec =
369 KeyGrip String -- fp: 369 KeyGrip String -- fp:
370 | KeyExact (Maybe Fingerprint)
370 | KeyTag Packet String -- fp:????/t: 371 | KeyTag Packet String -- fp:????/t:
371 | KeyUidMatch String -- u: 372 | KeyUidMatch String -- u:
372 deriving Show 373 deriving Show