diff options
author | NIIBE Yutaka <[email protected]> | 2016-06-23 03:12:43 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2016-06-24 01:22:55 +0000 |
commit | fb0e18b38434cbe97dee4c26047a994baf02fe76 (patch) | |
tree | 87b516fbc9ee73ac6569190fa5d5393cb679474e | |
parent | scd: Reset nonnull_nad to zero for VENDOR_GEMPC. (diff) | |
download | gnupg-fb0e18b38434cbe97dee4c26047a994baf02fe76.tar.gz gnupg-fb0e18b38434cbe97dee4c26047a994baf02fe76.zip |
g10: Fix card-edit/fetch to use keyserver_fetch.
* g10/card-util.c (fetch_url): Call keyserver_fetch instead of
keyserver_import_fprint.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
GnuPG-bug-id: 1828
(backport of master
commit 6f5ff1cfe449cf1f4cb7287bc57570eb794216b2)
-rw-r--r-- | g10/card-util.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/g10/card-util.c b/g10/card-util.c index 2198cb2d5..745ba1d47 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -729,28 +729,18 @@ fetch_url(void) 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,NULL,0); - 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(info.fpr1,20,spec); - free_keyserver_spec(spec); - } - } + { + strlist_t sl = NULL; + + add_to_strlist (&sl, info.pubkey_url); + rc = keyserver_fetch (sl); + free_strlist (sl); + } else if (info.fpr1valid) { rc = keyserver_import_fprint (info.fpr1, 20, opt.keyserver); |