aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-04-21 14:43:50 +0000
committerIngo Klöcker <[email protected]>2022-04-26 09:48:47 +0000
commit35b17550706c8b7479ae96654feb97c05263cfc9 (patch)
treeb185f1674e2ee4ccbcbeccd80dcb2d2903f1f821 /tests
parenttests: Avoid auto-removal when test fails. (diff)
downloadgnupg-35b17550706c8b7479ae96654feb97c05263cfc9.tar.gz
gnupg-35b17550706c8b7479ae96654feb97c05263cfc9.zip
gpg: Look up user ID to revoke by UID hash
* g10/keyedit.c (find_userid_by_namehash, find_userid): New. (keyedit_quick_revuid): Use find_userid() instead of iterating over the nodes of the keyblock. * tests/openpgp/quick-key-manipulation.scm: Add test for revoking a user ID specified by its hash. -- This makes it possible to specify the user ID to revoke as UID hash when calling --quick-revoke-uid. GnuPG-bug-id: 5936
Diffstat (limited to 'tests')
-rwxr-xr-xtests/openpgp/quick-key-manipulation.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index 2023f17bd..6cdf19a34 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -34,6 +34,8 @@
(define alpha "Alpha <[email protected]>")
(define bravo "Bravo <[email protected]>")
(define charlie "Charlie <[email protected]>")
+(define delta "Delta <[email protected]>")
+(define deltahash "359DC5EFF98B14A58AAA615C638E8BD0CEDA537B")
(define (key-data key)
(filter (lambda (x) (or (string=? (car x) "pub")
@@ -87,6 +89,10 @@
(info "Checking that we can revoke a user ID...")
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,alpha))
+(info "Checking that we can revoke a user ID by its hash...")
+(call-check `(,@GPG --quick-add-uid ,(exact bravo) ,delta))
+(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,deltahash))
+
(info "Checking that we get an error revoking a non-existent user ID.")
(catch '()
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,charlie))