1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

Make HKP kyeserver engine work again.

We had some debug code here which prevented it from working.
The host selection code still needs a review!

	* ks-engine-http.c (ks_http_help): Do not print help for hkp.
	* ks-engine-hkp.c (ks_hkp_help): Print help only for hkp.
	(send_request): Remove test code.
	(map_host): Use xtrymalloc.

	* certcache.c (classify_pattern): Remove unused variable and make
	explicit substring search work.
This commit is contained in:
Werner Koch 2011-11-24 15:48:24 +01:00
parent b342a5523e
commit cc7cc2b469
6 changed files with 20 additions and 11 deletions

View File

@ -1,3 +1,13 @@
2011-11-24 Werner Koch <wk@g10code.com>
* ks-engine-http.c (ks_http_help): Do not print help for hkp.
* ks-engine-hkp.c (ks_hkp_help): Print help only for hkp.
(send_request): Remove test code.
(map_host): Use xtrymalloc.
* certcache.c (classify_pattern): Remove unused variable and make
explicit substring search work.
2011-10-13 Marcus Brinkmann <marcus@g10code.com> 2011-10-13 Marcus Brinkmann <marcus@g10code.com>
* Makefile.am, certcache.c, crlfetch.c, dirmngr.c, ldap-wrapper.c: * Makefile.am, certcache.c, crlfetch.c, dirmngr.c, ldap-wrapper.c:

View File

@ -693,11 +693,10 @@ get_cert_bysubject (const char *subject_dn, unsigned int seq)
static enum pattern_class static enum pattern_class
classify_pattern (const char *pattern, size_t *r_offset, size_t *r_sn_offset) classify_pattern (const char *pattern, size_t *r_offset, size_t *r_sn_offset)
{ {
enum pattern_class result = PATTERN_UNKNOWN; enum pattern_class result;
const char *s; const char *s;
int hexprefix = 0; int hexprefix = 0;
int hexlength; int hexlength;
int mode = 0;
*r_offset = *r_sn_offset = 0; *r_offset = *r_sn_offset = 0;
@ -730,7 +729,7 @@ classify_pattern (const char *pattern, size_t *r_offset, size_t *r_sn_offset)
break; break;
case '*': /* Case insensitive substring search. */ case '*': /* Case insensitive substring search. */
mode = PATTERN_SUBSTR; result = PATTERN_SUBSTR;
s++; s++;
break; break;

View File

@ -87,7 +87,7 @@ ks_action_help (ctrl_t ctrl, const char *url)
if (!parsed_uri) if (!parsed_uri)
ks_print_help (ctrl, ks_print_help (ctrl,
"(Use the schema followed by a colon for specific help.)"); "(Use an URL for engine specific help.)");
else else
http_release_parsed_uri (parsed_uri); http_release_parsed_uri (parsed_uri);
return err; return err;

View File

@ -209,7 +209,7 @@ map_host (const char *name)
int refidx; int refidx;
reftblsize = 100; reftblsize = 100;
reftbl = xmalloc (reftblsize * sizeof *reftbl); reftbl = xtrymalloc (reftblsize * sizeof *reftbl);
if (!reftbl) if (!reftbl)
return NULL; return NULL;
refidx = 0; refidx = 0;
@ -280,7 +280,7 @@ map_host (const char *name)
else else
{ {
if (ai->ai_family == AF_INET) if (ai->ai_family == AF_INET)
hosttable[tmpidx]->v4 = 1; hosttable[tmpidx]->v4 = 1;
if (ai->ai_family == AF_INET6) if (ai->ai_family == AF_INET6)
hosttable[tmpidx]->v6 = 1; hosttable[tmpidx]->v6 = 1;
@ -409,7 +409,7 @@ ks_hkp_help (ctrl_t ctrl, parsed_uri_t uri)
if (!uri) if (!uri)
err = ks_print_help (ctrl, " hkp"); err = ks_print_help (ctrl, " hkp");
else if (uri->is_http) else if (uri->is_http && !strcmp (uri->scheme, "hkp"))
err = ks_print_help (ctrl, data); err = ks_print_help (ctrl, data);
else else
err = 0; err = 0;
@ -472,7 +472,7 @@ send_request (ctrl_t ctrl, const char *request, const char *hostportstr,
char *request_buffer = NULL; char *request_buffer = NULL;
*r_fp = NULL; *r_fp = NULL;
return gpg_error (GPG_ERR_NOT_SUPPORTED);
once_more: once_more:
err = http_open (&http, err = http_open (&http,
post_cb? HTTP_REQ_POST : HTTP_REQ_GET, post_cb? HTTP_REQ_POST : HTTP_REQ_GET,

View File

@ -43,7 +43,7 @@ ks_http_help (ctrl_t ctrl, parsed_uri_t uri)
if (!uri) if (!uri)
err = ks_print_help (ctrl, " http"); err = ks_print_help (ctrl, " http");
else if (uri->is_http) else if (uri->is_http && strcmp (uri->scheme, "hkp"))
err = ks_print_help (ctrl, data); err = ks_print_help (ctrl, data);
else else
err = 0; err = 0;

View File

@ -666,7 +666,7 @@ fetch_next_cert_ldap (cert_fetch_context_t context,
char *p, *pend; char *p, *pend;
int n; int n;
int okay = 0; int okay = 0;
int is_cms = 0; /* int is_cms = 0; */
*value = NULL; *value = NULL;
*valuelen = 0; *valuelen = 0;
@ -758,7 +758,7 @@ fetch_next_cert_ldap (cert_fetch_context_t context,
{ {
p = context->tmpbuf; p = context->tmpbuf;
p[n] = 0; /*(we allocated one extra byte for this.)*/ p[n] = 0; /*(we allocated one extra byte for this.)*/
is_cms = 0; /* fixme: is_cms = 0; */
if ( (pend = strchr (p, ';')) ) if ( (pend = strchr (p, ';')) )
*pend = 0; /* Strip off the extension. */ *pend = 0; /* Strip off the extension. */
if (!ascii_strcasecmp (p, USERCERTIFICATE)) if (!ascii_strcasecmp (p, USERCERTIFICATE))