1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

version_check_feature() added to check for compile-time options at run-time

This commit is contained in:
Paul Bakker
2014-04-30 11:49:44 +02:00
parent 8394684dd3
commit 0f90d7d2b5
11 changed files with 726 additions and 4 deletions

View File

@ -955,6 +955,19 @@
*/
//#define POLARSSL_THREADING_PTHREAD
/**
* \def POLARSSL_VERSION_FEATURES
*
* Allow run-time checking of compile-time enabled features. Thus allowing users
* to check at run-time if the library is for instance compiled with threading
* support via version_check_feature().
*
* Requires: POLARSSL_VERSION_C
*
* Comment this to disable run-time checking and save ROM space
*/
#define POLARSSL_VERSION_FEATURES
/**
* \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3
*
@ -2100,9 +2113,11 @@
/* Debug options */
//#define POLARSSL_DEBUG_DFL_MODE POLARSSL_DEBUG_LOG_FULL /**< Default log: Full or Raw */
/* \} name */
/* \} name SECTION: Module configuration options */
/*
/**
* \name SECTION: Sanity checks
*
* Sanity checks on defines and dependencies
*/
#if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
@ -2355,6 +2370,10 @@
#endif
#undef POLARSSL_THREADING_IMPL
#if defined(POLARSSL_VERSION_FEATURES) && !defined(POLARSSL_VERSION_C)
#error "POLARSSL_VERSION_FEATURES defined, but not all prerequisites"
#endif
#if defined(POLARSSL_X509_USE_C) && ( !defined(POLARSSL_BIGNUM_C) || \
!defined(POLARSSL_OID_C) || !defined(POLARSSL_ASN1_PARSE_C) || \
!defined(POLARSSL_PK_PARSE_C) )
@ -2387,4 +2406,6 @@
#error "POLARSSL_X509_CSR_WRITE_C defined, but not all prerequisites"
#endif
/* \} name SECTION: Sanity checks */
#endif /* config.h */