From d569ecfc2c7531159548d96c2d964744c2940b91 Mon Sep 17 00:00:00 2001 From: nirekh01 Date: Tue, 9 Jan 2018 16:43:21 +0000 Subject: [PATCH] Add some corrections based on code review -Add the DHM_ALT in an alphabetical order -Close correctly the 'extern "C" { ...' --- include/mbedtls/config.h | 3 ++- include/mbedtls/dhm.h | 11 ++++++++++- library/version_features.c | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index f8594b841..2aa4686d9 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -267,6 +267,7 @@ //#define MBEDTLS_BLOWFISH_ALT //#define MBEDTLS_CAMELLIA_ALT //#define MBEDTLS_DES_ALT +//#define MBEDTLS_DHM_ALT //#define MBEDTLS_XTEA_ALT //#define MBEDTLS_MD2_ALT //#define MBEDTLS_MD4_ALT @@ -275,7 +276,7 @@ //#define MBEDTLS_SHA1_ALT //#define MBEDTLS_SHA256_ALT //#define MBEDTLS_SHA512_ALT -//#define MBEDTLS_DHM_ALT + /* * When replacing the elliptic curve module, pleace consider, that it is diff --git a/include/mbedtls/dhm.h b/include/mbedtls/dhm.h index 40916c661..f9725ab09 100644 --- a/include/mbedtls/dhm.h +++ b/include/mbedtls/dhm.h @@ -296,10 +296,19 @@ int mbedtls_dhm_parse_dhm( mbedtls_dhm_context *dhm, const unsigned char *dhmin, int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ); #endif /* MBEDTLS_FS_IO */ #endif /* MBEDTLS_ASN1_PARSE_C */ -#else + +#ifdef __cplusplus +} +#endif + +#else /* MBEDTLS_DHM_ALT */ #include "dhm_alt.h" #endif /* MBEDTLS_DHM_ALT */ +#ifdef __cplusplus +extern "C" { +#endif + /** * \brief Checkup routine * diff --git a/library/version_features.c b/library/version_features.c index 000246edc..48bd42bcd 100644 --- a/library/version_features.c +++ b/library/version_features.c @@ -99,6 +99,9 @@ static const char *features[] = { #if defined(MBEDTLS_DES_ALT) "MBEDTLS_DES_ALT", #endif /* MBEDTLS_DES_ALT */ +#if defined(MBEDTLS_DHM_ALT) + "MBEDTLS_DHM_ALT", +#endif /* MBEDTLS_DHM_ALT */ #if defined(MBEDTLS_XTEA_ALT) "MBEDTLS_XTEA_ALT", #endif /* MBEDTLS_XTEA_ALT */ @@ -123,9 +126,6 @@ static const char *features[] = { #if defined(MBEDTLS_SHA512_ALT) "MBEDTLS_SHA512_ALT", #endif /* MBEDTLS_SHA512_ALT */ -#if defined(MBEDTLS_DHM_ALT) - "MBEDTLS_DHM_ALT", -#endif /* MBEDTLS_DHM_ALT */ #if defined(MBEDTLS_ECP_ALT) "MBEDTLS_ECP_ALT", #endif /* MBEDTLS_ECP_ALT */