gpg: Store key origin for new userids during import merge.
authorWerner Koch <wk@gnupg.org>
Tue, 25 Jul 2017 08:19:12 +0000 (10:19 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 25 Jul 2017 08:34:50 +0000 (10:34 +0200)
commit84c993d9325fc000acac7950b2dfeefa5976df3b
tree30a52e8b0cb945530be54d6ac8f78c17a8e8b817
parentd40b4a41a8d60292fd4b5b951a19883e31090179
gpg: Store key origin for new userids during import merge.

* g10/import.c (apply_meta_data): Rename to ...
(insert_key_origin): this.  Factor code out to ...
(insert_key_origin_pk, insert_key_origin_uid): new funcs.
(import_one): Move insert_key_origin behind clean_key.
(merge_blocks): Add args options, origin, and url.
(append_uid): Rename to ...
(append_new_uid): this.  Add args options, curtime, origin, and url.
Call insert_key_origin_uid for new UIDs.
--

This is a straightforward change to handle new user ids.

How to test:

With an empty keyring run

  gpg --with-key-origin --locate-key \
      --auto-key-locate clear,nodefault,wkd  wk@gnupg.org

and then append a new keyid using

  gpg --with-key-origin --locate-key \
      --auto-key-locate clear,nodefault,wkd  wk@g10code.com

Works with my current key 80615870F5BAD690333686D0F2AD85AC1E42B367.

Signed-off-by: Werner Koch <wk@gnupg.org>
g10/import.c