[git] GnuPG - branch, master, updated. gnupg-2.1.15-164-gdf5353b
by Neal H. Walfield
cvs at cvs.gnupg.org
Thu Sep 22 21:32:43 CEST 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via df5353b95eefc13135e7df50a7c197f270d6080d (commit)
from 7e0379a75475abfd15e0623913795779ff0f40d7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit df5353b95eefc13135e7df50a7c197f270d6080d
Author: Neal H. Walfield <neal at g10code.com>
Date: Thu Sep 22 21:32:31 2016 +0200
g10: When adding a user id, make sure the keyblock has been prepared.
* g10/keyedit.c (keyedit_quick_adduid): Call merge_keys_and_selfsig on
KEYBLOCK before adding the user id.
* tests/openpgp/quick-key-manipulation.scm: Make sure that the key
capabilities don't change when adding a user id.
(key-data): New function.
--
Signed-off-by: Neal H. Walfield <neal at g10code.com>
GnuPG-bug-id: 2697
diff --git a/g10/keyedit.c b/g10/keyedit.c
index cd16ec9..65ac2ea 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -2932,6 +2932,8 @@ keyedit_quick_adduid (ctrl_t ctrl, const char *username, const char *newuid)
fix_keyblock (&keyblock);
+ merge_keys_and_selfsig (keyblock);
+
if (menu_adduid (ctrl, keyblock, 0, NULL, uidstring))
{
err = keydb_update_keyblock (kdbhd, keyblock);
diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index f2b8766..8a3e3f1 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -37,6 +37,11 @@
(define alpha "Alpha <alpha at example.net>")
(define bravo "Bravo <bravo at example.net>")
+(define (key-data key)
+ (filter (lambda (x) (or (string=? (car x) "pub")
+ (string=? (car x) "sub")))
+ (gpg-with-colons `(-k ,key))))
+
(with-temporary-working-directory
(file-copy (path-join old-home "gpg.conf") "gpg.conf")
(file-copy (path-join old-home "gpg-agent.conf") "gpg-agent.conf")
@@ -51,7 +56,23 @@
(assert (= 1 (count-uids-of-secret-key alpha)))
(info "Checking that we can add a user ID...")
- (call-check `(, at GPG --quick-adduid ,(exact alpha) ,bravo))
+
+ ;; Make sure the key capabilities don't change when we add a user id.
+ ;; (See bug #2697.)
+ (let ((pre (key-data (exact alpha)))
+ (result (call-check `(, at GPG --quick-adduid ,(exact alpha) ,bravo)))
+ (post (key-data (exact alpha))))
+ (if (not (equal? pre post))
+ (begin
+ (display "Key capabilities changed when adding a user id:")
+ (newline)
+ (display " Pre: ")
+ (display pre)
+ (newline)
+ (display " Post: ")
+ (display post)
+ (newline)
+ (exit 1))))
(call-check `(, at GPG --check-trustdb)) ; XXX why?
-----------------------------------------------------------------------
Summary of changes:
g10/keyedit.c | 2 ++
tests/openpgp/quick-key-manipulation.scm | 23 ++++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list