From b939afe3fc70be446d9ffd6e6071a4af5cf98a8a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 31 Jul 2016 01:24:57 +0100 Subject: Allow certificate verification user prompt creation to return errors --- frontends/monkey/cert.c | 7 ++++--- frontends/monkey/cert.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'frontends/monkey') diff --git a/frontends/monkey/cert.c b/frontends/monkey/cert.c index ec1b1ce43..710e71098 100644 --- a/frontends/monkey/cert.c +++ b/frontends/monkey/cert.c @@ -35,15 +35,14 @@ typedef struct monkey_cert { static monkey_cert_t *cert_ring = NULL; static uint32_t cert_ctr = 0; -void +nserror gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw) { monkey_cert_t *m4t = calloc(sizeof(*m4t), 1); if (m4t == NULL) { - cb(false, cbpw); - return; + return NSERROR_NOMEM; } m4t->cb = cb; m4t->pw = cbpw; @@ -53,6 +52,8 @@ gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, fprintf(stdout, "SSLCERT VERIFY CERT %u URL %s\n", m4t->num, nsurl_access(url)); + + return NSERROR_OK; } diff --git a/frontends/monkey/cert.h b/frontends/monkey/cert.h index 283817f3d..4470e2e72 100644 --- a/frontends/monkey/cert.h +++ b/frontends/monkey/cert.h @@ -21,7 +21,7 @@ struct ssl_cert_info; -void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, +nserror gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs, unsigned long num, nserror (*cb)(bool proceed, void *pw), void *cbpw); -- cgit v1.2.3