]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
mbedtls: add missing header when defining MBEDTLS_DEBUG
authorFrederik Wedel-Heinen <frederik.wedel-heinen@dencrypt.dk>
Tue, 6 Oct 2020 08:41:28 +0000 (10:41 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Oct 2020 07:15:39 +0000 (09:15 +0200)
Closes #6045

lib/vtls/mbedtls.c

index 71d2b2d073e0a7ea5f883f7b9eb55b6cd5f5d6ad..4e5f6574f141417fe1b5d3f1982e8cdbf5e11dd2 100644 (file)
@@ -31,6 +31,9 @@
 
 #ifdef USE_MBEDTLS
 
+/* Define this to enable lots of debugging for mbedTLS */
+/* #define MBEDTLS_DEBUG */
+
 #include <mbedtls/version.h>
 #if MBEDTLS_VERSION_NUMBER >= 0x02040000
 #include <mbedtls/net_sockets.h>
 #include <mbedtls/ctr_drbg.h>
 #include <mbedtls/sha256.h>
 
+#if MBEDTLS_VERSION_MAJOR >= 2
+#  ifdef MBEDTLS_DEBUG
+#    include <mbedtls/debug.h>
+#  endif
+#endif
+
 #include "urldata.h"
 #include "sendf.h"
 #include "inet_pton.h"
@@ -113,9 +122,6 @@ static int entropy_func_mutex(void *data, unsigned char *output, size_t len)
 
 #endif /* THREADING_SUPPORT */
 
-/* Define this to enable lots of debugging for mbedTLS */
-#undef MBEDTLS_DEBUG
-
 #ifdef MBEDTLS_DEBUG
 static void mbed_debug(void *context, int level, const char *f_name,
                        int line_nb, const char *line)