regression: card-edit/fetch doesn't work
NIIBE Yutaka
gniibe at fsij.org
Wed Jun 22 01:19:59 CEST 2016
On 06/21/2016 08:42 AM, NIIBE Yutaka wrote:
> While I update the documentation of Gnuk, I found that card-edit/fetch
> doesn't work with GnuPG 2.1.
In 2.0, it seems that the helper program gpg2keys_curl supports both
features of fetching a key file and retrieving from key server.
If I understand correctly, card-edit/fetch (mainly) expects fetching a
key (like gpg --fetch-key). The issue is that, the comments
explicitly addresses the use cases of HKP and LDAP.
Anyhow, here is a patch for --fetch-key like behavior:
diff --git a/g10/card-util.c b/g10/card-util.c
index be1a593..2cb44f9 100644
--- a/g10/card-util.c
+++ b/g10/card-util.c
@@ -733,28 +733,18 @@ fetch_url (ctrl_t ctrl)
log_error("error retrieving URL from card: %s\n",gpg_strerror(rc));
else
{
- struct keyserver_spec *spec=NULL;
-
rc=agent_scd_getattr("KEY-FPR",&info);
if(rc)
log_error("error retrieving key fingerprint from card: %s\n",
gpg_strerror(rc));
else if (info.pubkey_url && *info.pubkey_url)
- {
- spec = parse_keyserver_uri (info.pubkey_url, 1);
- if(spec && info.fpr1valid)
- {
- /* This is not perfectly right. Currently, all card
- fingerprints are 20 digits, but what about
- fingerprints for a future v5 key? We should get the
- length from somewhere lower in the code. In any
- event, the fpr/keyid is not meaningful for straight
- HTTP fetches, but using it allows the card to point
- to HKP and LDAP servers as well. */
- rc = keyserver_import_fprint (ctrl, info.fpr1, 20, spec);
- free_keyserver_spec(spec);
- }
- }
+ {
+ strlist_t sl = NULL;
+
+ add_to_strlist (&sl, info.pubkey_url);
+ rc = keyserver_fetch (ctrl, sl);
+ free_strlist (sl);
+ }
else if (info.fpr1valid)
{
rc = keyserver_import_fprint (ctrl, info.fpr1, 20,
opt.keyserver);
--
More information about the Gnupg-devel
mailing list