1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

gpg: Do not allow the user to revoke the last valid UID.

* g10/keyedit.c (keyedit_quick_revuid): Merge self signatures, then
make sure that we do not revoke the last valid UID.
(menu_revuid): Make sure that we do not revoke the last valid UID.
* tests/openpgp/quick-key-manipulation.scm: Demonstrate that
'--quick-revoke-uid' can not be used to revoke the last valid UID.

GnuPG-bug-id: 2960
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-03-02 14:14:55 +01:00
parent 80fb1a8a05
commit 591b6a9d87
No known key found for this signature in database
GPG key ID: DD1A52F9DA8C9020
2 changed files with 45 additions and 1 deletions

View file

@ -81,6 +81,11 @@
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,charlie))
(error "Expected an error, but get none."))
(info "Checking that we get an error revoking the last valid user ID.")
(catch '()
(call-check `(,@GPG --quick-revoke-uid ,(exact bravo) ,bravo))
(error "Expected an error, but get none."))
(assert (= 1 (count-uids-of-secret-key bravo)))
(info "Checking that we can change the expiration time.")