From f231eaae28c5272e1ebbc1d56ed6d0b44a9a5bd1 Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Tue, 22 Aug 2017 14:50:14 +0300 Subject: [PATCH] Add configuration file in md.h include `*config.h*` in md.h as MACROS in the header file get ignored. Fix for #1001. --- ChangeLog | 2 ++ include/mbedtls/md.h | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index e8d1da5c9..a58975ee6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,8 @@ Bugfix * Fix a potential integer overflow in the version verification for DER encoded X509 certificates. The overflow would enable maliciously constructed certificates to bypass the certificate verification check. + * Include configuration file in md.h, to fix compilation warnings. + Reported by aaronmdjones in #1001 Changes * Added config.h option MBEDTLS_NO_UDBL_DIVISION, to prevent the use of diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h index 9b996a951..89be847ce 100644 --- a/include/mbedtls/md.h +++ b/include/mbedtls/md.h @@ -27,6 +27,12 @@ #include +#if !defined(MBEDTLS_CONFIG_FILE) +#include "config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + #define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */ #define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */ #define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */