aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/server.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-02-18 15:09:16 +0000
committerWerner Koch <[email protected]>2017-02-18 15:39:02 +0000
commita74902cccde539ee2bd216caec0da6eb54b67c1b (patch)
treedaa1f4d3c39dd1ce5a26b1349e593ca893679520 /dirmngr/server.c
parentdirmngr: Strip the default https port from the Host: header. (diff)
downloadgnupg-a74902cccde539ee2bd216caec0da6eb54b67c1b.tar.gz
gnupg-a74902cccde539ee2bd216caec0da6eb54b67c1b.zip
dirmngr: Add per-session verify callback to http.c
* dirmngr/http.h (http_verify_cb_t): New type. * dirmngr/http.c (http_session_s): Add fields flags, verify_cb, and verify_cb_value. (http_session_new): Remove arg tls_priority. Add args verify_cb and verify-cb_value. Store them in the session object. (send_request): Use per-session verify callback. (http_verify_server_credentials) [HTTP_USE_NTBTLS]: Return GPG_ERR_NOT_IMPLEMENTED. * dirmngr/ks-engine-hkp.c (send_request): Adjust for changed http_session_new. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/t-http.c (main): Ditto. * dirmngr/server.c (do_get_cert_local): Replace xmalloc by malloc. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--dirmngr/server.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/dirmngr/server.c b/dirmngr/server.c
index 1134ac081..92bbc160b 100644
--- a/dirmngr/server.c
+++ b/dirmngr/server.c
@@ -370,14 +370,15 @@ do_get_cert_local (ctrl_t ctrl, const char *name, const char *command)
char *buf;
ksba_cert_t cert;
- if (name)
- buf = xstrconcat (command, " ", name, NULL);
+ buf = name? strconcat (command, " ", name, NULL) : xtrystrdup (command);
+ if (!buf)
+ rc = gpg_error_from_syserror ();
else
- buf = xstrdup (command);
-
- rc = assuan_inquire (ctrl->server_local->assuan_ctx, buf,
- &value, &valuelen, MAX_CERT_LENGTH);
- xfree (buf);
+ {
+ rc = assuan_inquire (ctrl->server_local->assuan_ctx, buf,
+ &value, &valuelen, MAX_CERT_LENGTH);
+ xfree (buf);
+ }
if (rc)
{
log_error (_("assuan_inquire(%s) failed: %s\n"),