Base config compat check on MBETLS_VERSION_NUMBER

Any config with a version older than 3.0.0 or newer than
MBETLS_VERSION_NUMBER will be rejected.

This does mean that the current development version doesn'T accept *any*
value of MBETLS_CONFIG_VERSION, but this will be fixed when we bump the
version during our normal release process.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
diff --git a/include/mbedtls/build_info.h b/include/mbedtls/build_info.h
index d07f6ac..0ff3286 100644
--- a/include/mbedtls/build_info.h
+++ b/include/mbedtls/build_info.h
@@ -49,12 +49,6 @@
 #define MBEDTLS_VERSION_STRING         "2.26.0"
 #define MBEDTLS_VERSION_STRING_FULL    "mbed TLS 2.26.0"
 
-/**
- * Equal to the #MBEDTLS_VERSION_NUMBER of the mbedtls version that introduced
- * the most recent config version
- */
-#define MBEDTLS_CONFIG_VERSION_LATEST  0x03000000
-
 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 #define _CRT_SECURE_NO_DEPRECATE 1
 #endif
@@ -65,8 +59,9 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#if defined(MBEDTLS_CONFIG_VERSION) && \
-    MBEDTLS_CONFIG_VERSION != MBEDTLS_CONFIG_VERSION_LATEST
+#if defined(MBEDTLS_CONFIG_VERSION) && ( \
+    MBEDTLS_CONFIG_VERSION < 0x03000000 || \
+    MBEDLTS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER )
 #error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
 #endif
 
diff --git a/include/mbedtls/mbedtls_config.h b/include/mbedtls/mbedtls_config.h
index 8aa88b0..80bbebd 100644
--- a/include/mbedtls/mbedtls_config.h
+++ b/include/mbedtls/mbedtls_config.h
@@ -25,13 +25,15 @@
  */
 
 /**
+ * \def MBEDTLS_CONFIG_VERSION
+ *
  * This is an optional version symbol that enables comatibility handling of
  * config files.
  *
  * It is equal to the #MBEDTLS_VERSION_NUMBER of the mbedtls version that
  * introduced the config format we want to be compatible with.
  */
-#define MBEDTLS_CONFIG_VERSION 0x03000000
+//#define MBEDTLS_CONFIG_VERSION 0x03000000
 
 /**
  * \name SECTION: System support