mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-03 11:06:14 +02:00
Use negated option for controlling TLS support.
A positive option looks better, but comes with the following compatibility issue: people using a custom config.h that is not based on the default config.h and need TLS support would need to manually change their config in order to still get TLS. Work around that by making the public option negative. Internally the positive option is used, though. In the future (when preparing the next major version), we might want to switch back to a positive option as this would be more consistent with other options we have.
This commit is contained in:
@@ -1338,13 +1338,13 @@ int query_config( const char *config )
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_PROTO_DTLS */
|
||||
|
||||
#if defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
if( strcmp( "MBEDTLS_SSL_PROTO_TLS", config ) == 0 )
|
||||
#if defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
if( strcmp( "MBEDTLS_SSL_PROTO_NO_TLS", config ) == 0 )
|
||||
{
|
||||
MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_TLS );
|
||||
MACRO_EXPANSION_TO_STR( MBEDTLS_SSL_PROTO_NO_TLS );
|
||||
return( 0 );
|
||||
}
|
||||
#endif /* MBEDTLS_SSL_PROTO_TLS */
|
||||
#endif /* MBEDTLS_SSL_PROTO_NO_TLS */
|
||||
|
||||
#if defined(MBEDTLS_SSL_ALPN)
|
||||
if( strcmp( "MBEDTLS_SSL_ALPN", config ) == 0 )
|
||||
|
||||
@@ -44,14 +44,14 @@
|
||||
!defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \
|
||||
!defined(MBEDTLS_CERTS_C) || !defined(MBEDTLS_PEM_PARSE_C) || \
|
||||
!defined(MBEDTLS_CTR_DRBG_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
|
||||
!defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
|
||||
"MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
|
||||
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or"
|
||||
"MBEDTLS_SSL_PROTO_TLS not defined.\n");
|
||||
"not defined, and/or MBEDTLS_SSL_PROTO_NO_TLS defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
!defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_CTR_DRBG_C) || \
|
||||
!defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_TIMING_C) || \
|
||||
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_PEM_PARSE_C) || \
|
||||
!defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
int main( int argc, char *argv[] )
|
||||
{
|
||||
((void) argc);
|
||||
@@ -54,8 +54,8 @@ int main( int argc, char *argv[] )
|
||||
"and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or "
|
||||
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or "
|
||||
"MBEDTLS_TIMING_C and/or MBEDTLS_PEM_PARSE_C and/or "
|
||||
"MBEDTLS_SSL_PROTO_TLS not defined.\n");
|
||||
"MBEDTLS_TIMING_C and/or MBEDTLS_PEM_PARSE_C not defined, and/or "
|
||||
"MBEDTLS_SSL_PROTO_NO_TLS defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#elif defined(_WIN32)
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
!defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \
|
||||
!defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \
|
||||
!defined(MBEDTLS_CTR_DRBG_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \
|
||||
!defined(MBEDTLS_FS_IO) || !defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
!defined(MBEDTLS_FS_IO) || defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
|
||||
"MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
|
||||
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or "
|
||||
"MBEDTLS_SSL_PROTO_TLS not defined.\n");
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C "
|
||||
"not defined, and/or MBEDTLS_SSL_PROTO_NO_TLS defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
!defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_CTR_DRBG_C) || \
|
||||
!defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_FS_IO) || \
|
||||
!defined(MBEDTLS_THREADING_C) || !defined(MBEDTLS_THREADING_PTHREAD) || \
|
||||
!defined(MBEDTLS_PEM_PARSE_C) || !defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
!defined(MBEDTLS_PEM_PARSE_C) || defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C "
|
||||
@@ -53,8 +53,8 @@ int main( void )
|
||||
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or "
|
||||
"MBEDTLS_THREADING_C and/or MBEDTLS_THREADING_PTHREAD "
|
||||
"and/or MBEDTLS_PEM_PARSE_C and/or "
|
||||
"MBEDTLS_SSL_PROTO_TLS not defined.\n");
|
||||
"and/or MBEDTLS_PEM_PARSE_C not defined, and/or "
|
||||
"MBEDTLS_SSL_PROTO_NO_TLS defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -44,15 +44,15 @@
|
||||
!defined(MBEDTLS_SSL_SRV_C) || !defined(MBEDTLS_NET_C) || \
|
||||
!defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_CTR_DRBG_C) || \
|
||||
!defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_FS_IO) || \
|
||||
!defined(MBEDTLS_PEM_PARSE_C) || !defined(MBEDTLS_SSL_PROTO_TLS)
|
||||
!defined(MBEDTLS_PEM_PARSE_C) || defined(MBEDTLS_SSL_PROTO_NO_TLS)
|
||||
int main( void )
|
||||
{
|
||||
mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C "
|
||||
"and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or "
|
||||
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
|
||||
"MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C "
|
||||
"and/or MBEDTLS_PEM_PARSE_C and/or "
|
||||
"MBEDTLS_SSL_PROTO_TLS not defined.\n");
|
||||
"and/or MBEDTLS_PEM_PARSE_C not defined, and/or "
|
||||
"MBEDTLS_SSL_PROTO_NO_TLS defined.\n");
|
||||
return( 0 );
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user