mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
* keyserver.c (keyserver_typemap): New. Map certain keyserver types to a
common type (e.g. ldaps -> ldap). If we are building with curl, map both http and ftp to curl. * build-packet.c (build_sig_subpkt): Only allow one preferred keyserver subpacket at a time.
This commit is contained in:
parent
52595e06f6
commit
b96038387b
@ -1,3 +1,12 @@
|
|||||||
|
2004-12-22 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* keyserver.c (keyserver_typemap): New. Map certain keyserver
|
||||||
|
types to a common type (e.g. ldaps -> ldap). If we are building
|
||||||
|
with curl, map both http and ftp to curl.
|
||||||
|
|
||||||
|
* build-packet.c (build_sig_subpkt): Only allow one preferred
|
||||||
|
keyserver subpacket at a time.
|
||||||
|
|
||||||
2004-12-21 David Shaw <dshaw@jabberwocky.com>
|
2004-12-21 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keyedit.c (menu_set_keyserver_url): Make sure we only operate on
|
* keyedit.c (menu_set_keyserver_url): Make sure we only operate on
|
||||||
|
@ -658,7 +658,6 @@ build_sig_subpkt (PKT_signature *sig, sigsubpkttype_t type,
|
|||||||
case SIGSUBPKT_POLICY:
|
case SIGSUBPKT_POLICY:
|
||||||
case SIGSUBPKT_REV_KEY:
|
case SIGSUBPKT_REV_KEY:
|
||||||
case SIGSUBPKT_SIGNATURE:
|
case SIGSUBPKT_SIGNATURE:
|
||||||
case SIGSUBPKT_PREF_KS:
|
|
||||||
/* we do allow multiple subpackets */
|
/* we do allow multiple subpackets */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -759,6 +759,24 @@ keyserver_search_prompt(IOBUF buffer,const char *searchstr)
|
|||||||
m_free(line);
|
m_free(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* We sometimes want to use a different gpgkeys_xxx for a given
|
||||||
|
protocol (for example, ldaps is handled by gpgkeys_ldap). Map
|
||||||
|
these here. */
|
||||||
|
static const char *
|
||||||
|
keyserver_typemap(const char *type)
|
||||||
|
{
|
||||||
|
if(strcmp(type,"ldaps")==0)
|
||||||
|
return "ldap";
|
||||||
|
#ifdef HAVE_LIBCURL
|
||||||
|
else if(strcmp(type,"ftp")==0)
|
||||||
|
return "curl";
|
||||||
|
else if(strcmp(type,"http")==0)
|
||||||
|
return "curl";
|
||||||
|
#endif /* HAVE_LIBCURL */
|
||||||
|
else
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
#define KEYSERVER_ARGS_KEEP " -o \"%O\" \"%I\""
|
#define KEYSERVER_ARGS_KEEP " -o \"%O\" \"%I\""
|
||||||
#define KEYSERVER_ARGS_NOKEEP " -o \"%o\" \"%i\""
|
#define KEYSERVER_ARGS_NOKEEP " -o \"%o\" \"%i\""
|
||||||
|
|
||||||
@ -773,6 +791,7 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
|
|||||||
byte *line=NULL;
|
byte *line=NULL;
|
||||||
struct parse_options *kopts;
|
struct parse_options *kopts;
|
||||||
struct exec_info *spawn;
|
struct exec_info *spawn;
|
||||||
|
const char *scheme;
|
||||||
|
|
||||||
assert(keyserver);
|
assert(keyserver);
|
||||||
|
|
||||||
@ -789,14 +808,10 @@ keyserver_spawn(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Build the filename for the helper to execute */
|
/* Build the filename for the helper to execute */
|
||||||
/* Note that we don't use a symlink for "ldaps" anymore because this
|
scheme=keyserver_typemap(keyserver->scheme);
|
||||||
won't work under MS Windows. */
|
command=m_alloc(strlen("gpgkeys_")+strlen(scheme)+1);
|
||||||
command=m_alloc(strlen("gpgkeys_")+strlen(keyserver->scheme)+1);
|
|
||||||
strcpy(command,"gpgkeys_");
|
strcpy(command,"gpgkeys_");
|
||||||
if (!strcmp (keyserver->scheme, "ldaps"))
|
strcat(command,scheme);
|
||||||
strcat(command, "ldap");
|
|
||||||
else
|
|
||||||
strcat(command,keyserver->scheme);
|
|
||||||
|
|
||||||
if(opt.keyserver_options.options&KEYSERVER_USE_TEMP_FILES)
|
if(opt.keyserver_options.options&KEYSERVER_USE_TEMP_FILES)
|
||||||
{
|
{
|
||||||
@ -1252,9 +1267,8 @@ keyserver_work(int action,STRLIST list,KEYDB_SEARCH_DESC *desc,
|
|||||||
|
|
||||||
case KEYSERVER_VERSION_ERROR:
|
case KEYSERVER_VERSION_ERROR:
|
||||||
log_error(_("gpgkeys_%s does not support handler version %d\n"),
|
log_error(_("gpgkeys_%s does not support handler version %d\n"),
|
||||||
!strcmp (keyserver->scheme,"ldaps")?
|
keyserver_typemap(keyserver->scheme),
|
||||||
"ldap": keyserver->scheme,
|
KEYSERVER_PROTO_VERSION);
|
||||||
KEYSERVER_PROTO_VERSION);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KEYSERVER_TIMEOUT:
|
case KEYSERVER_TIMEOUT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user