1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-30 16:17:02 +01:00
Justus Winter ab89164be0 g10: Improve and unify key selection for -r and --locate-keys.
* g10/getkey.c (struct pubkey_cmp_cookie): New type.
(key_is_ok, uid_is_ok, subkey_is_ok): New functions.
(pubkey_cmp): Likewise.
(get_best_pubkey_byname): Likewise.
* g10/keydb.h (get_best_pubkey_byname): New prototype.
* g10/keylist.c (locate_one): Use the new function.
* g10/pkclist.c (find_and_check_key): Likewise.
* tests/openpgp/Makefile.am (XTESTS): Add new test.
(TEST_FILES): Add new files.
* tests/openpgp/key-selection.scm: New file.
* tests/openpgp/key-selection/0.asc: Likewise.
* tests/openpgp/key-selection/1.asc: Likewise.
* tests/openpgp/key-selection/2.asc: Likewise.
* tests/openpgp/key-selection/3.asc: Likewise.
* tests/openpgp/key-selection/4.asc: Likewise.
--

When a name resembling a mail address is given to either --locate-keys
or --recipient, rank the search results and use only the most relevant
key.

This also lets us query which key will be used for encryption using
--locate-keys.  However, note that --locate-keys may also return keys
incapable of encryption, though it will prefer keys that have an
encryption subkey.

GnuPG-bug-id: 2359
Signed-off-by: Justus Winter <justus@g10code.com>
2016-11-03 15:04:18 +01:00
..
2016-09-17 16:00:37 +09:00
2016-10-20 13:30:47 +09:00
2016-06-30 18:50:16 +02:00
2016-10-21 12:04:46 +09:00
2016-02-14 14:46:30 +01:00
2014-10-31 14:21:34 +01:00
2016-10-27 13:04:45 +09:00
2007-07-04 19:49:40 +00:00
2016-09-05 09:52:04 +02:00
2014-11-13 12:01:42 +01:00
2015-02-04 09:15:34 +01:00
2016-10-07 07:54:38 +02:00
2015-02-04 09:15:34 +01:00
2016-09-10 13:42:09 -04:00
2016-10-27 14:59:56 +02:00
2016-10-24 13:12:05 +02:00
2016-10-21 12:04:46 +09:00
2016-01-22 10:54:10 +01:00
2016-10-21 12:04:46 +09:00
2016-07-13 13:31:12 +02:00
2016-08-11 21:32:55 +02:00
2016-06-30 11:45:13 +02:00
2008-12-12 08:54:50 +00:00
2016-08-18 10:08:34 +02:00
2016-06-28 18:21:50 +02:00
2016-06-28 18:21:50 +02:00
2016-03-08 14:08:49 +01:00
2016-07-01 09:47:48 +02:00
2016-08-10 16:50:29 +02:00
2016-05-03 11:26:06 +02:00
2016-06-30 18:50:16 +02:00
2016-11-02 12:45:18 +01:00
2016-09-15 14:46:06 +02:00
2014-01-29 17:45:05 +01:00