mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Deprecate the --keyserver option.
* g10/keyserver.c (keyserver_refresh): Change return type to gpg_error_t. Use gpg_dirmngr_ks_list to print the name of the keyserver to use. (keyserver_search): Do not print the "no keyserver" error message. The same error is anyway returned from dirmngr. * g10/call-dirmngr.c (ks_status_parm_s): Add field "keyword". (ks_status_cb): Handle other status keywords. (gpg_dirmngr_ks_list): New. * tools/gpgconf-comp.c (gc_options_gpg): Deprecate "keyserver". (gc_options_dirmngr): Add "Keyserver" group and "keyserver". -- Along with the corresponding dirmngr change this option allows to configure the keyserver only in dirmngr.conf. Existing configurations will continue to work. However, GUIs using gpgconf now the keyserver option under the dirmngr (aka Key Acquirer) tab unless they are in export mode in which the keyserver option is also show for gpg. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
a48e6de603
commit
ae471fa978
6 changed files with 82 additions and 31 deletions
|
@ -1357,10 +1357,12 @@ keyidlist(strlist_t users,KEYDB_SEARCH_DESC **klist,int *count,int fakev3)
|
|||
/* Note this is different than the original HKP refresh. It allows
|
||||
usernames to refresh only part of the keyring. */
|
||||
|
||||
int
|
||||
gpg_error_t
|
||||
keyserver_refresh (ctrl_t ctrl, strlist_t users)
|
||||
{
|
||||
int rc,count,numdesc,fakev3=0;
|
||||
gpg_error_t err;
|
||||
int count, numdesc;
|
||||
int fakev3 = 0;
|
||||
KEYDB_SEARCH_DESC *desc;
|
||||
unsigned int options=opt.keyserver_options.import_options;
|
||||
|
||||
|
@ -1381,9 +1383,9 @@ keyserver_refresh (ctrl_t ctrl, strlist_t users)
|
|||
ascii_strcasecmp(opt.keyserver->scheme,"mailto")==0))
|
||||
fakev3=1;
|
||||
|
||||
rc=keyidlist(users,&desc,&numdesc,fakev3);
|
||||
if(rc)
|
||||
return rc;
|
||||
err = keyidlist (users, &desc, &numdesc, fakev3);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
count=numdesc;
|
||||
if(count>0)
|
||||
|
@ -1403,11 +1405,11 @@ keyserver_refresh (ctrl_t ctrl, strlist_t users)
|
|||
/* We use the keyserver structure we parsed out before.
|
||||
Note that a preferred keyserver without a scheme://
|
||||
will be interpreted as hkp:// */
|
||||
rc = keyserver_get (ctrl, &desc[i], 1, keyserver, NULL, NULL);
|
||||
if(rc)
|
||||
err = keyserver_get (ctrl, &desc[i], 1, keyserver, NULL, NULL);
|
||||
if (err)
|
||||
log_info(_("WARNING: unable to refresh key %s"
|
||||
" via %s: %s\n"),keystr_from_desc(&desc[i]),
|
||||
keyserver->uri,gpg_strerror (rc));
|
||||
keyserver->uri,gpg_strerror (err));
|
||||
else
|
||||
{
|
||||
/* We got it, so mark it as NONE so we don't try and
|
||||
|
@ -1424,16 +1426,22 @@ keyserver_refresh (ctrl_t ctrl, strlist_t users)
|
|||
|
||||
if(count>0)
|
||||
{
|
||||
if(opt.keyserver && !opt.quiet)
|
||||
{
|
||||
if(count==1)
|
||||
log_info(_("refreshing 1 key from %s\n"),opt.keyserver->uri);
|
||||
else
|
||||
log_info(_("refreshing %d keys from %s\n"),
|
||||
count,opt.keyserver->uri);
|
||||
}
|
||||
char *tmpuri;
|
||||
|
||||
rc=keyserver_get (ctrl, desc, numdesc, NULL, NULL, NULL);
|
||||
err = gpg_dirmngr_ks_list (ctrl, &tmpuri);
|
||||
if (!err)
|
||||
{
|
||||
if (!opt.quiet)
|
||||
{
|
||||
if(count==1)
|
||||
log_info(_("refreshing 1 key from %s\n"), tmpuri);
|
||||
else
|
||||
log_info(_("refreshing %d keys from %s\n"), count, tmpuri);
|
||||
}
|
||||
xfree (tmpuri);
|
||||
|
||||
err = keyserver_get (ctrl, desc, numdesc, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
xfree(desc);
|
||||
|
@ -1445,7 +1453,7 @@ keyserver_refresh (ctrl_t ctrl, strlist_t users)
|
|||
if(!(opt.keyserver_options.import_options&IMPORT_FAST))
|
||||
check_or_update_trustdb ();
|
||||
|
||||
return rc;
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1463,12 +1471,6 @@ keyserver_search (ctrl_t ctrl, strlist_t tokens)
|
|||
if (!tokens)
|
||||
return 0; /* Return success if no patterns are given. */
|
||||
|
||||
if (!opt.keyserver)
|
||||
{
|
||||
log_error (_("no keyserver known (use option --keyserver)\n"));
|
||||
return gpg_error (GPG_ERR_NO_KEYSERVER);
|
||||
}
|
||||
|
||||
/* Write global options */
|
||||
|
||||
/* for(temp=opt.keyserver_options.other;temp;temp=temp->next) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue