From a4bdfcfe76b4d39c2d6fd7c8c5be4af90dd4b82d Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 1 Mar 2019 11:17:40 +0100 Subject: [PATCH] Don't check certificate purpose on older GnuTLS The feature was added in 3.6.0, so avoid compilation errors if building with an older GnuTLS. --- utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.c b/utils.c index bbfb8e6..b8d9b8e 100644 --- a/utils.c +++ b/utils.c @@ -847,6 +847,7 @@ _utils_cert_get_status_report(gnutls_x509_crt_t cert, unsigned int status, size -= strlen(buf); } +#if GNUTLS_VERSION_NUMBER >= 0x030600 if (status & GNUTLS_CERT_PURPOSE_MISMATCH) { snprintf(buf, sizeof(buf), " %d. The certificate or an intermediate does not match the\n" @@ -854,6 +855,7 @@ _utils_cert_get_status_report(gnutls_x509_crt_t cert, unsigned int status, strncat(out, buf, size); size -= strlen(buf); } +#endif } static int