From c7186168ff0c2577406e5b19c7a8ff10a8a460d5 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Fri, 15 Sep 2023 11:42:36 +0100 Subject: [PATCH] PKI: report on insecure certificates --- src/coap_gnutls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/coap_gnutls.c b/src/coap_gnutls.c index 9f790cf0..8505622a 100644 --- a/src/coap_gnutls.c +++ b/src/coap_gnutls.c @@ -868,6 +868,14 @@ cert_verify_gnutls(gnutls_session_t g_session) { } } } + if (status & (GNUTLS_CERT_INSECURE_ALGORITHM)) { + status &= ~(GNUTLS_CERT_INSECURE_ALGORITHM); + fail = 1; + coap_log_warn(" %s: %s: '%s'\n", + coap_session_str(c_session), + "The certificate uses an insecure algorithm", + OUTPUT_CERT_NAME); + } if (status) { fail = 1;