From b71674e0c0dbfa10385884a8314576858cb22e12 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 24 May 2021 12:07:29 +0100 Subject: [PATCH] coap_gnutls.c: Fix if typo causing certificate not to be checked Include {} for if statement. Issue introduced in c987bee --- src/coap_gnutls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index e875da12..032eafc0 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -759,12 +759,13 @@ static int cert_verify_gnutls(gnutls_session_t g_session) memset(&cert_info, 0, sizeof(cert_info)); cert_type = get_san_or_cn(g_session, &cert_info); #if (GNUTLS_VERSION_NUMBER >= 0x030606) - if (cert_type == GNUTLS_CRT_RAW) - if (!check_rpk_cert(g_context, &cert_info, c_session)) { - alert = GNUTLS_A_ACCESS_DENIED; - goto fail; + if (cert_type == GNUTLS_CRT_RAW) { + if (!check_rpk_cert(g_context, &cert_info, c_session)) { + alert = GNUTLS_A_ACCESS_DENIED; + goto fail; } return 1; + } #endif /* >= 3.6.6 */ if (cert_info.cert_list_size == 0 && !g_context->setup_data.verify_peer_cert)