From c4840b7ce163d8f4fe9fce81de1a2edfb7cf4adf Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 12 Feb 2018 10:14:01 +0000 Subject: [PATCH] coap_openssl.c: Fix coding error in coap_dtls_context_set_pki() --- src/coap_openssl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 3009a770..7aea91c3 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -546,9 +546,10 @@ int coap_dtls_context_set_pki( coap_context_t *ctx, } } - if (!setup_callback) return 0; - if (!setup_callback(context->dtls.ctx, setup_data)) return 0; - if (!setup_callback(context->tls.ctx, setup_data)) return 0;; + if (setup_callback) { + if (!setup_callback(context->dtls.ctx, setup_data)) return 0; + if (!setup_callback(context->tls.ctx, setup_data)) return 0;; + } if (!context->dtls.ssl) { context->dtls.ssl = SSL_new(context->dtls.ctx); if (!context->dtls.ssl)