From 8a110cc82bb2df37088502de9f15ac4c8fea6467 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 20 Sep 2017 16:52:37 +0000 Subject: Slightly restructure tls_ocsp_verify_cb() to make it more like libtls code. --- src/lib/libtls/tls_ocsp.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/libtls/tls_ocsp.c b/src/lib/libtls/tls_ocsp.c index 9f6f940ecf..4e2dba3487 100644 --- a/src/lib/libtls/tls_ocsp.c +++ b/src/lib/libtls/tls_ocsp.c @@ -315,12 +315,13 @@ tls_ocsp_verify_cb(SSL *ssl, void *arg) } tls_ocsp_free(ctx->ocsp); - ctx->ocsp = tls_ocsp_setup_from_peer(ctx); - if (ctx->ocsp != NULL) { - if (ctx->config->verify_cert == 0 || ctx->config->verify_time == 0) - return 1; - res = tls_ocsp_process_response_internal(ctx, raw, size); - } + if ((ctx->ocsp = tls_ocsp_setup_from_peer(ctx)) == NULL) + return 0; + + if (ctx->config->verify_cert == 0 || ctx->config->verify_time == 0) + return 1; + + res = tls_ocsp_process_response_internal(ctx, raw, size); return (res == 0) ? 1 : 0; } -- cgit v1.2.3-55-g6feb