mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-08 12:44:23 +01:00
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>
This commit is contained in:
parent
74cb3b230c
commit
62d21a4ab4
@ -3053,6 +3053,8 @@ keyedit_quick_revuid (ctrl_t ctrl, const char *username, const char *uidtorev)
|
||||
}
|
||||
}
|
||||
|
||||
log_error (_("User ID revocation failed: %s\n"), gpg_strerror (GPG_ERR_NOT_FOUND));
|
||||
|
||||
leave:
|
||||
release_kbnode (keyblock);
|
||||
keydb_release (kdbhd);
|
||||
|
@ -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.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user