aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-07-14 12:00:37 +0000
committerWerner Koch <[email protected]>2016-07-14 12:00:37 +0000
commit0342369ce001b9dba04dc79e7a4eb66fbda278e7 (patch)
tree91991f6ce7a1e9283fd1187599f40a09daefaa1a
parentgpgscm: Use kludge to avoid improper use of ffi_schemify_name. (diff)
downloadgnupg-0342369ce001b9dba04dc79e7a4eb66fbda278e7.tar.gz
gnupg-0342369ce001b9dba04dc79e7a4eb66fbda278e7.zip
gpg: Fix regression since 2.1 in --search-key with a fingerprint.
* dirmngr/ks-engine-hkp.c (ks_hkp_search): Prefix fingerprint with 0x. -- pre-2.1 made sure that the 0x prefix was put before the fingerprint so that the search command works. Actually --recv-key should be used with a fingerprint but some users are using --search-key, probably to use the interactive mode. GnuPG-bug-id: 2412 Signed-off-by: Werner Koch <[email protected]>
-rw-r--r--dirmngr/ks-engine-hkp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c
index 636eaf781..bcc17504d 100644
--- a/dirmngr/ks-engine-hkp.c
+++ b/dirmngr/ks-engine-hkp.c
@@ -1207,12 +1207,16 @@ ks_hkp_search (ctrl_t ctrl, parsed_uri_t uri, const char *pattern,
pattern = fprbuf;
break;
case KEYDB_SEARCH_MODE_FPR16:
- bin2hex (desc.u.fpr, 16, fprbuf);
+ fprbuf[0] = '0';
+ fprbuf[1] = 'x';
+ bin2hex (desc.u.fpr, 16, fprbuf+2);
pattern = fprbuf;
break;
case KEYDB_SEARCH_MODE_FPR20:
case KEYDB_SEARCH_MODE_FPR:
- bin2hex (desc.u.fpr, 20, fprbuf);
+ fprbuf[0] = '0';
+ fprbuf[1] = 'x';
+ bin2hex (desc.u.fpr, 20, fprbuf+2);
pattern = fprbuf;
break;
default: