aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-05-25 09:57:04 +0000
committerWerner Koch <[email protected]>2023-05-25 09:57:44 +0000
commit14828c75be10d61f35a46c58541aa39884b33bcd (patch)
tree6bac10601c782f718fb0afd04361b9f21a207dad
parentpo: Update Japanese Translation. (diff)
downloadgnupg-14828c75be10d61f35a46c58541aa39884b33bcd.tar.gz
gnupg-14828c75be10d61f35a46c58541aa39884b33bcd.zip
gpg: Fix searching for the ADSK key when adding an ADSK.
* g10/keyedit.c (menu_addadsk): Request an exact search. * g10/getkey.c (finish_lookup): Add an debug output. -- GnuPG-bug-id: 6504
-rw-r--r--g10/getkey.c3
-rw-r--r--g10/keyedit.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 15905dc63..68d7ee61d 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -3655,6 +3655,9 @@ finish_lookup (kbnode_t keyblock, unsigned int req_usage, int want_exact,
break;
}
}
+ if (DBG_LOOKUP)
+ log_debug ("finish_lookup: exact search requested: %sfound\n",
+ foundk? "":"not ");
}
/* Get the user id that matched that low-level search criteria. */
diff --git a/g10/keyedit.c b/g10/keyedit.c
index e16a40ead..21c1ee8d8 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -4844,6 +4844,15 @@ menu_addadsk (ctrl_t ctrl, kbnode_t pub_keyblock, const char *adskfpr)
continue;
}
+ /* Force searching for that exact fingerprint and for any key
+ * which has a key with that fingerprint. */
+ if (!strchr (answer, '!'))
+ {
+ char *tmpstr = xstrconcat (answer, "!", NULL);
+ xfree (answer);
+ answer = tmpstr;
+ }
+
free_public_key (adsk_pk);
adsk_pk = xcalloc (1, sizeof *adsk_pk);
adsk_pk->req_usage = PUBKEY_USAGE_ENC;