diff options
author | Ingo Klöcker <[email protected]> | 2022-08-08 10:29:00 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2022-08-08 10:31:15 +0000 |
commit | 82c53efd63654f3009652149e31a068301b298e7 (patch) | |
tree | 8220c1d904eb43f6b8d9f813b1fc030c21792200 /tests/openpgp | |
parent | gpg: Fix wrong error message for keytocard. (diff) | |
download | gnupg-82c53efd63654f3009652149e31a068301b298e7.tar.gz gnupg-82c53efd63654f3009652149e31a068301b298e7.zip |
gpg: Look up user ID to mark as primary by UID hash
* g10/keyedit.c (find_userid_by_namehash, find_userid): Add argument
want_valid. Skip invalid user IDs if valid is wanted.
(keyedit_quick_revuid): Ask find_userid() for any matching user ID.
(keyedit_quick_set_primary): Use find_userid() to find the user ID to
mark as primary.
* tests/openpgp/quick-key-manipulation.scm: Change second call of the
quick-set-primary-uid test to specify the user ID by its hash.
--
This makes it possible to specify the user ID to mark as primary via its
UID hash when calling --quick-set-primary-uid.
GnuPG-bug-id: 6126
Diffstat (limited to 'tests/openpgp')
-rwxr-xr-x | tests/openpgp/quick-key-manipulation.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm index 6cdf19a34..71d222a22 100755 --- a/tests/openpgp/quick-key-manipulation.scm +++ b/tests/openpgp/quick-key-manipulation.scm @@ -33,6 +33,7 @@ (define alpha "Alpha <[email protected]>") (define bravo "Bravo <[email protected]>") +(define bravohash "F75B1420CC5881F4005333379355CFF5873094DE") (define charlie "Charlie <[email protected]>") (define delta "Delta <[email protected]>") (define deltahash "359DC5EFF98B14A58AAA615C638E8BD0CEDA537B") @@ -77,7 +78,8 @@ (info "Checking that we can mark an user ID as primary.") (call-check `(,@gpg --quick-set-primary-uid ,(exact alpha) ,alpha)) -(call-check `(,@gpg --quick-set-primary-uid ,(exact alpha) ,bravo)) +(info "Checking that we can mark a user ID as primary by its hash...") +(call-check `(,@gpg --quick-set-primary-uid ,(exact alpha) ,bravohash)) ;; XXX I don't know how to verify this. The keylisting does not seem ;; to indicate the primary UID. |