summaryrefslogtreecommitdiffstats
path: root/tests/openpgp
diff options
context:
space:
mode:
authorJustus Winter <justus@g10code.com>2017-03-02 11:39:00 +0100
committerJustus Winter <justus@g10code.com>2017-03-02 11:39:00 +0100
commit62d21a4ab4029b32ea129f1cf3a0e1f22e2fb7b0 (patch)
tree7247dd865aff0458422bbe63b0601f40627831f5 /tests/openpgp
parenttests: Log information about ssh, add comments to test. (diff)
downloadgnupg2-62d21a4ab4029b32ea129f1cf3a0e1f22e2fb7b0.tar.xz
gnupg2-62d21a4ab4029b32ea129f1cf3a0e1f22e2fb7b0.zip
g10: Signal an error when trying to revoke non-existant UID.
* g10/keyedit.c (keyedit_quick_revuid): Signal an error when trying to revoke non-existant UID. * tests/openpgp/quick-key-manipulation.scm: Test that. GnuPG-bug-id: 2962 Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'tests/openpgp')
-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 7ede5e9b5..8ceb03500 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -37,6 +37,7 @@
(define alpha "Alpha <alpha@invalid.example.net>")
(define bravo "Bravo <bravo@invalid.example.net>")
+(define charlie "Charlie <charlie@invalid.example.net>")
(define (key-data key)
(filter (lambda (x) (or (string=? (car x) "pub")
@@ -79,6 +80,11 @@
(info "Checking that we can revoke a user ID...")
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,alpha))
+(info "Checking that we get an error revoking a non-existant user ID.")
+(catch '()
+ (call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,charlie))
+ (error "Expected an error, but get none."))
+
(assert (= 1 (count-uids-of-secret-key bravo)))
(info "Checking that we can change the expiration time.")