Invoke config.py instead of config.pl

git grep -Fl /config.pl | xargs sed -i -e 's!/config\.pl!/config.py!g'

Also:
* Change one comment in include/mbedtls/check_config.h.
* Change PERL to PYTHON in CMakeLists.txt.
This commit is contained in:
Gilles Peskine 2019-07-27 23:52:53 +02:00
parent 40f103cea2
commit 5d46f6a89b
17 changed files with 131 additions and 131 deletions

View file

@ -53,17 +53,17 @@ set(CTR_DRBG_128_BIT_KEY_WARNING "${WARNING_BORDER}"
find_package(PythonInterp) find_package(PythonInterp)
find_package(Perl) find_package(Perl)
if(PERL_FOUND) if(PYTHON_FOUND)
# If 128-bit keys are configured for CTR_DRBG, display an appropriate warning # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning
execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.pl -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
RESULT_VARIABLE result) RESULT_VARIABLE result)
if(${result} EQUAL 0) if(${result} EQUAL 0)
message(WARNING ${CTR_DRBG_128_BIT_KEY_WARNING}) message(WARNING ${CTR_DRBG_128_BIT_KEY_WARNING})
endif() endif()
# If NULL Entropy is configured, display an appropriate warning # If NULL Entropy is configured, display an appropriate warning
execute_process(COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.pl -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_TEST_NULL_ENTROPY execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/include/mbedtls/config.h get MBEDTLS_TEST_NULL_ENTROPY
RESULT_VARIABLE result) RESULT_VARIABLE result)
if(${result} EQUAL 0) if(${result} EQUAL 0)
message(WARNING ${NULL_ENTROPY_WARNING}) message(WARNING ${NULL_ENTROPY_WARNING})

View file

@ -80,11 +80,11 @@ post_build:
ifndef WINDOWS ifndef WINDOWS
# If 128-bit keys are configured for CTR_DRBG, display an appropriate warning # If 128-bit keys are configured for CTR_DRBG, display an appropriate warning
-scripts/config.pl get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY && ([ $$? -eq 0 ]) && \ -scripts/config.py get MBEDTLS_CTR_DRBG_USE_128_BIT_KEY && ([ $$? -eq 0 ]) && \
echo '$(CTR_DRBG_128_BIT_KEY_WARNING)' echo '$(CTR_DRBG_128_BIT_KEY_WARNING)'
# If NULL Entropy is configured, display an appropriate warning # If NULL Entropy is configured, display an appropriate warning
-scripts/config.pl get MBEDTLS_TEST_NULL_ENTROPY && ([ $$? -eq 0 ]) && \ -scripts/config.py get MBEDTLS_TEST_NULL_ENTROPY && ([ $$? -eq 0 ]) && \
echo '$(NULL_ENTROPY_WARNING)' echo '$(NULL_ENTROPY_WARNING)'
endif endif

View file

@ -4,7 +4,7 @@ README for Mbed TLS
Configuration Configuration
------------- -------------
Mbed TLS should build out of the box on most systems. Some platform specific options are available in the fully documented configuration file `include/mbedtls/config.h`, which is also the place where features can be selected. This file can be edited manually, or in a more programmatic way using the Perl script `scripts/config.pl` (use `--help` for usage instructions). Mbed TLS should build out of the box on most systems. Some platform specific options are available in the fully documented configuration file `include/mbedtls/config.h`, which is also the place where features can be selected. This file can be edited manually, or in a more programmatic way using the Perl script `scripts/config.py` (use `--help` for usage instructions).
Compiler options can be set using conventional environment variables such as `CC` and `CFLAGS` when using the Make and CMake build system (see below). Compiler options can be set using conventional environment variables such as `CC` and `CFLAGS` when using the Make and CMake build system (see below).

View file

@ -45,7 +45,7 @@
#endif #endif
/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as /* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
* it would confuse config.pl. */ * it would confuse config.py. */
#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ #if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
!defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
#define MBEDTLS_PLATFORM_SNPRINTF_ALT #define MBEDTLS_PLATFORM_SNPRINTF_ALT

View file

@ -26,7 +26,7 @@ And you can run any of the fuzz targets like `fuzz_client`.
To run the fuzz targets without oss-fuzz, you first need to install one libFuzzingEngine (libFuzzer for instance). To run the fuzz targets without oss-fuzz, you first need to install one libFuzzingEngine (libFuzzer for instance).
Then you need to compile the code with the compiler flags of the wished sanitizer. Then you need to compile the code with the compiler flags of the wished sanitizer.
``` ```
perl scripts/config.pl set MBEDTLS_PLATFORM_TIME_ALT perl scripts/config.py set MBEDTLS_PLATFORM_TIME_ALT
mkdir build mkdir build
cd build cd build
cmake .. cmake ..

View file

@ -19,7 +19,7 @@ fi
CONFIG_BAK=${CONFIG_H}.bak CONFIG_BAK=${CONFIG_H}.bak
cp -p $CONFIG_H $CONFIG_BAK cp -p $CONFIG_H $CONFIG_BAK
scripts/config.pl realfull scripts/config.py realfull
make apidoc make apidoc
mv $CONFIG_BAK $CONFIG_H mv $CONFIG_BAK $CONFIG_H

View file

@ -59,8 +59,8 @@ EOF
for F in 0 1; do for F in 0 1; do
for W in 2 3 4 5 6; do for W in 2 3 4 5 6; do
scripts/config.pl set MBEDTLS_ECP_WINDOW_SIZE $W scripts/config.py set MBEDTLS_ECP_WINDOW_SIZE $W
scripts/config.pl set MBEDTLS_ECP_FIXED_POINT_OPTIM $F scripts/config.py set MBEDTLS_ECP_FIXED_POINT_OPTIM $F
make benchmark >/dev/null 2>&1 make benchmark >/dev/null 2>&1
echo "fixed point optim = $F, max window size = $W" echo "fixed point optim = $F, max window size = $W"
echo "--------------------------------------------" echo "--------------------------------------------"

View file

@ -62,10 +62,10 @@ doit()
fi fi
{ {
scripts/config.pl unset MBEDTLS_NET_C || true scripts/config.py unset MBEDTLS_NET_C || true
scripts/config.pl unset MBEDTLS_TIMING_C || true scripts/config.py unset MBEDTLS_TIMING_C || true
scripts/config.pl unset MBEDTLS_FS_IO || true scripts/config.py unset MBEDTLS_FS_IO || true
scripts/config.pl --force set MBEDTLS_NO_PLATFORM_ENTROPY || true scripts/config.py --force set MBEDTLS_NO_PLATFORM_ENTROPY || true
} >/dev/null 2>&1 } >/dev/null 2>&1
make clean >/dev/null make clean >/dev/null

View file

@ -46,10 +46,10 @@ do_config()
echo "" echo ""
echo "config-$NAME:" echo "config-$NAME:"
cp configs/config-$NAME.h $CONFIG_H cp configs/config-$NAME.h $CONFIG_H
scripts/config.pl unset MBEDTLS_SSL_SRV_C scripts/config.py unset MBEDTLS_SSL_SRV_C
for FLAG in $UNSET_LIST; do for FLAG in $UNSET_LIST; do
scripts/config.pl unset $FLAG scripts/config.py unset $FLAG
done done
grep -F SSL_MAX_CONTENT_LEN $CONFIG_H || echo 'SSL_MAX_CONTENT_LEN=16384' grep -F SSL_MAX_CONTENT_LEN $CONFIG_H || echo 'SSL_MAX_CONTENT_LEN=16384'

View file

@ -622,7 +622,7 @@ component_test_large_ecdsa_key_signature () {
SMALL_MPI_MAX_SIZE=136 # Small enough to interfere with the EC signatures SMALL_MPI_MAX_SIZE=136 # Small enough to interfere with the EC signatures
msg "build: cmake + MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE}, gcc, ASan" # ~ 1 min 50s msg "build: cmake + MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE}, gcc, ASan" # ~ 1 min 50s
scripts/config.pl set MBEDTLS_MPI_MAX_SIZE $SMALL_MPI_MAX_SIZE scripts/config.py set MBEDTLS_MPI_MAX_SIZE $SMALL_MPI_MAX_SIZE
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -662,7 +662,7 @@ component_test_default_cmake_gcc_asan () {
component_test_full_cmake_gcc_asan () { component_test_full_cmake_gcc_asan () {
msg "build: full config, cmake, gcc, ASan" msg "build: full config, cmake, gcc, ASan"
scripts/config.pl full scripts/config.py full
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -684,7 +684,7 @@ component_test_ref_configs () {
component_test_sslv3 () { component_test_sslv3 () {
msg "build: Default + SSLv3 (ASan build)" # ~ 6 min msg "build: Default + SSLv3 (ASan build)" # ~ 6 min
scripts/config.pl set MBEDTLS_SSL_PROTO_SSL3 scripts/config.py set MBEDTLS_SSL_PROTO_SSL3
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -701,7 +701,7 @@ component_test_sslv3 () {
component_test_no_renegotiation () { component_test_no_renegotiation () {
msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min
scripts/config.pl unset MBEDTLS_SSL_RENEGOTIATION scripts/config.py unset MBEDTLS_SSL_RENEGOTIATION
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -714,8 +714,8 @@ component_test_no_renegotiation () {
component_test_no_pem_no_fs () { component_test_no_pem_no_fs () {
msg "build: Default + !MBEDTLS_PEM_PARSE_C + !MBEDTLS_FS_IO (ASan build)" msg "build: Default + !MBEDTLS_PEM_PARSE_C + !MBEDTLS_FS_IO (ASan build)"
scripts/config.pl unset MBEDTLS_PEM_PARSE_C scripts/config.py unset MBEDTLS_PEM_PARSE_C
scripts/config.pl unset MBEDTLS_FS_IO scripts/config.py unset MBEDTLS_FS_IO
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -728,7 +728,7 @@ component_test_no_pem_no_fs () {
component_test_rsa_no_crt () { component_test_rsa_no_crt () {
msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min
scripts/config.pl set MBEDTLS_RSA_NO_CRT scripts/config.py set MBEDTLS_RSA_NO_CRT
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -744,8 +744,8 @@ component_test_rsa_no_crt () {
component_test_everest () { component_test_everest () {
msg "build: Everest ECDH context (ASan build)" # ~ 6 min msg "build: Everest ECDH context (ASan build)" # ~ 6 min
scripts/config.pl unset MBEDTLS_ECDH_LEGACY_CONTEXT scripts/config.py unset MBEDTLS_ECDH_LEGACY_CONTEXT
scripts/config.pl set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED scripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
CC=clang cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=clang cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -762,8 +762,8 @@ component_test_everest () {
component_test_small_ssl_out_content_len () { component_test_small_ssl_out_content_len () {
msg "build: small SSL_OUT_CONTENT_LEN (ASan build)" msg "build: small SSL_OUT_CONTENT_LEN (ASan build)"
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384 scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -773,8 +773,8 @@ component_test_small_ssl_out_content_len () {
component_test_small_ssl_in_content_len () { component_test_small_ssl_in_content_len () {
msg "build: small SSL_IN_CONTENT_LEN (ASan build)" msg "build: small SSL_IN_CONTENT_LEN (ASan build)"
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 4096 scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 4096
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 16384 scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 16384
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -784,7 +784,7 @@ component_test_small_ssl_in_content_len () {
component_test_small_ssl_dtls_max_buffering () { component_test_small_ssl_dtls_max_buffering () {
msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0" msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0"
scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000 scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 1000
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -794,7 +794,7 @@ component_test_small_ssl_dtls_max_buffering () {
component_test_small_mbedtls_ssl_dtls_max_buffering () { component_test_small_mbedtls_ssl_dtls_max_buffering () {
msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1" msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1"
scripts/config.pl set MBEDTLS_SSL_DTLS_MAX_BUFFERING 190 scripts/config.py set MBEDTLS_SSL_DTLS_MAX_BUFFERING 190
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -804,7 +804,7 @@ component_test_small_mbedtls_ssl_dtls_max_buffering () {
component_test_full_cmake_clang () { component_test_full_cmake_clang () {
msg "build: cmake, full config, clang" # ~ 50s msg "build: cmake, full config, clang" # ~ 50s
scripts/config.pl full scripts/config.py full
CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On . CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On .
make make
@ -823,8 +823,8 @@ component_test_full_cmake_clang () {
component_build_deprecated () { component_build_deprecated () {
msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s msg "build: make, full config + DEPRECATED_WARNING, gcc -O" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl set MBEDTLS_DEPRECATED_WARNING scripts/config.py set MBEDTLS_DEPRECATED_WARNING
# Build with -O -Wextra to catch a maximum of issues. # Build with -O -Wextra to catch a maximum of issues.
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs make CC=gcc CFLAGS='-O -Werror -Wall -Wextra' lib programs
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
@ -832,8 +832,8 @@ component_build_deprecated () {
msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
# No cleanup, just tweak the configuration and rebuild # No cleanup, just tweak the configuration and rebuild
make clean make clean
scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING scripts/config.py unset MBEDTLS_DEPRECATED_WARNING
scripts/config.pl set MBEDTLS_DEPRECATED_REMOVED scripts/config.py set MBEDTLS_DEPRECATED_REMOVED
# Build with -O -Wextra to catch a maximum of issues. # Build with -O -Wextra to catch a maximum of issues.
make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
@ -873,12 +873,12 @@ component_build_default_make_gcc_and_cxx () {
component_test_no_use_psa_crypto_full_cmake_asan() { component_test_no_use_psa_crypto_full_cmake_asan() {
# full minus MBEDTLS_USE_PSA_CRYPTO: run the same set of tests as basic-build-test.sh # full minus MBEDTLS_USE_PSA_CRYPTO: run the same set of tests as basic-build-test.sh
msg "build: cmake, full config minus MBEDTLS_USE_PSA_CRYPTO, ASan" msg "build: cmake, full config minus MBEDTLS_USE_PSA_CRYPTO, ASan"
scripts/config.pl full scripts/config.py full
scripts/config.pl set MBEDTLS_ECP_RESTARTABLE # not using PSA, so enable restartable ECC scripts/config.py set MBEDTLS_ECP_RESTARTABLE # not using PSA, so enable restartable ECC
scripts/config.pl unset MBEDTLS_PSA_CRYPTO_C scripts/config.py unset MBEDTLS_PSA_CRYPTO_C
scripts/config.pl unset MBEDTLS_USE_PSA_CRYPTO scripts/config.py unset MBEDTLS_USE_PSA_CRYPTO
scripts/config.pl unset MBEDTLS_PSA_ITS_FILE_C scripts/config.py unset MBEDTLS_PSA_ITS_FILE_C
scripts/config.pl unset MBEDTLS_PSA_CRYPTO_STORAGE_C scripts/config.py unset MBEDTLS_PSA_CRYPTO_STORAGE_C
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -903,9 +903,9 @@ component_test_no_use_psa_crypto_full_cmake_asan() {
component_test_check_params_functionality () { component_test_check_params_functionality () {
msg "build+test: MBEDTLS_CHECK_PARAMS functionality" msg "build+test: MBEDTLS_CHECK_PARAMS functionality"
scripts/config.pl full # includes CHECK_PARAMS scripts/config.py full # includes CHECK_PARAMS
# Make MBEDTLS_PARAM_FAILED call mbedtls_param_failed(). # Make MBEDTLS_PARAM_FAILED call mbedtls_param_failed().
scripts/config.pl unset MBEDTLS_CHECK_PARAMS_ASSERT scripts/config.py unset MBEDTLS_CHECK_PARAMS_ASSERT
# Only build and run tests. Do not build sample programs, because # Only build and run tests. Do not build sample programs, because
# they don't have a mbedtls_param_failed() function. # they don't have a mbedtls_param_failed() function.
make CC=gcc CFLAGS='-Werror -O1' lib test make CC=gcc CFLAGS='-Werror -O1' lib test
@ -913,22 +913,22 @@ component_test_check_params_functionality () {
component_test_check_params_without_platform () { component_test_check_params_without_platform () {
msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C" msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C"
scripts/config.pl full # includes CHECK_PARAMS scripts/config.py full # includes CHECK_PARAMS
# Keep MBEDTLS_PARAM_FAILED as assert. # Keep MBEDTLS_PARAM_FAILED as assert.
scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT scripts/config.py unset MBEDTLS_PLATFORM_EXIT_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT scripts/config.py unset MBEDTLS_PLATFORM_TIME_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_FPRINTF_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY scripts/config.py unset MBEDTLS_PLATFORM_MEMORY
scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_PRINTF_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_SNPRINTF_ALT
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED
scripts/config.pl unset MBEDTLS_PLATFORM_C scripts/config.py unset MBEDTLS_PLATFORM_C
make CC=gcc CFLAGS='-Werror -O1' all test make CC=gcc CFLAGS='-Werror -O1' all test
} }
component_test_check_params_silent () { component_test_check_params_silent () {
msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()" msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()"
scripts/config.pl full # includes CHECK_PARAMS scripts/config.py full # includes CHECK_PARAMS
# Set MBEDTLS_PARAM_FAILED to nothing. # Set MBEDTLS_PARAM_FAILED to nothing.
sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H" sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H"
make CC=gcc CFLAGS='-Werror -O1' all test make CC=gcc CFLAGS='-Werror -O1' all test
@ -939,19 +939,19 @@ component_test_no_platform () {
# This should catch missing mbedtls_printf definitions, and by disabling file # This should catch missing mbedtls_printf definitions, and by disabling file
# IO, it should catch missing '#include <stdio.h>' # IO, it should catch missing '#include <stdio.h>'
msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl unset MBEDTLS_PLATFORM_C scripts/config.py unset MBEDTLS_PLATFORM_C
scripts/config.pl unset MBEDTLS_NET_C scripts/config.py unset MBEDTLS_NET_C
scripts/config.pl unset MBEDTLS_PLATFORM_MEMORY scripts/config.py unset MBEDTLS_PLATFORM_MEMORY
scripts/config.pl unset MBEDTLS_PLATFORM_PRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_PRINTF_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_FPRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_FPRINTF_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_SNPRINTF_ALT scripts/config.py unset MBEDTLS_PLATFORM_SNPRINTF_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT scripts/config.py unset MBEDTLS_PLATFORM_TIME_ALT
scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT scripts/config.py unset MBEDTLS_PLATFORM_EXIT_ALT
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED
scripts/config.pl unset MBEDTLS_FS_IO scripts/config.py unset MBEDTLS_FS_IO
scripts/config.pl unset MBEDTLS_PSA_CRYPTO_STORAGE_C scripts/config.py unset MBEDTLS_PSA_CRYPTO_STORAGE_C
scripts/config.pl unset MBEDTLS_PSA_ITS_FILE_C scripts/config.py unset MBEDTLS_PSA_ITS_FILE_C
# Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19, # Note, _DEFAULT_SOURCE needs to be defined for platforms using glibc version >2.19,
# to re-enable platform integration features otherwise disabled in C99 builds # to re-enable platform integration features otherwise disabled in C99 builds
make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -O0 -D_DEFAULT_SOURCE' lib programs
@ -961,23 +961,23 @@ component_test_no_platform () {
component_build_no_std_function () { component_build_no_std_function () {
# catch compile bugs in _uninit functions # catch compile bugs in _uninit functions
msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS scripts/config.py set MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED
make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
} }
component_build_no_ssl_srv () { component_build_no_ssl_srv () {
msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl unset MBEDTLS_SSL_SRV_C scripts/config.py unset MBEDTLS_SSL_SRV_C
make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
} }
component_build_no_ssl_cli () { component_build_no_ssl_cli () {
msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl unset MBEDTLS_SSL_CLI_C scripts/config.py unset MBEDTLS_SSL_CLI_C
make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0' make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0'
} }
@ -985,18 +985,18 @@ component_build_no_sockets () {
# Note, C99 compliance can also be tested with the sockets support disabled, # Note, C99 compliance can also be tested with the sockets support disabled,
# as that requires a POSIX platform (which isn't the same as C99). # as that requires a POSIX platform (which isn't the same as C99).
msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
scripts/config.pl full scripts/config.py full
scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc. scripts/config.py unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux scripts/config.py set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib make CC=gcc CFLAGS='-Werror -Wall -Wextra -O0 -std=c99 -pedantic' lib
} }
component_test_memory_buffer_allocator_backtrace () { component_test_memory_buffer_allocator_backtrace () {
msg "build: default config with memory buffer allocator and backtrace enabled" msg "build: default config with memory buffer allocator and backtrace enabled"
scripts/config.pl set MBEDTLS_MEMORY_BUFFER_ALLOC_C scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_PLATFORM_MEMORY
scripts/config.pl set MBEDTLS_MEMORY_BACKTRACE scripts/config.py set MBEDTLS_MEMORY_BACKTRACE
scripts/config.pl set MBEDTLS_MEMORY_DEBUG scripts/config.py set MBEDTLS_MEMORY_DEBUG
CC=gcc cmake . CC=gcc cmake .
make make
@ -1006,8 +1006,8 @@ component_test_memory_buffer_allocator_backtrace () {
component_test_memory_buffer_allocator () { component_test_memory_buffer_allocator () {
msg "build: default config with memory buffer allocator" msg "build: default config with memory buffer allocator"
scripts/config.pl set MBEDTLS_MEMORY_BUFFER_ALLOC_C scripts/config.py set MBEDTLS_MEMORY_BUFFER_ALLOC_C
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_PLATFORM_MEMORY
CC=gcc cmake . CC=gcc cmake .
make make
@ -1022,7 +1022,7 @@ component_test_memory_buffer_allocator () {
component_test_no_max_fragment_length () { component_test_no_max_fragment_length () {
# Run max fragment length tests with MFL disabled # Run max fragment length tests with MFL disabled
msg "build: default config except MFL extension (ASan build)" # ~ 30s msg "build: default config except MFL extension (ASan build)" # ~ 30s
scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -1032,7 +1032,7 @@ component_test_no_max_fragment_length () {
component_test_asan_remove_peer_certificate () { component_test_asan_remove_peer_certificate () {
msg "build: default config with MBEDTLS_SSL_KEEP_PEER_CERTIFICATE disabled (ASan build)" msg "build: default config with MBEDTLS_SSL_KEEP_PEER_CERTIFICATE disabled (ASan build)"
scripts/config.pl unset MBEDTLS_SSL_KEEP_PEER_CERTIFICATE scripts/config.py unset MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -1048,9 +1048,9 @@ component_test_asan_remove_peer_certificate () {
component_test_no_max_fragment_length_small_ssl_out_content_len () { component_test_no_max_fragment_length_small_ssl_out_content_len () {
msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)" msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)"
scripts/config.pl unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH scripts/config.py unset MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
scripts/config.pl set MBEDTLS_SSL_IN_CONTENT_LEN 16384 scripts/config.py set MBEDTLS_SSL_IN_CONTENT_LEN 16384
scripts/config.pl set MBEDTLS_SSL_OUT_CONTENT_LEN 4096 scripts/config.py set MBEDTLS_SSL_OUT_CONTENT_LEN 4096
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -1060,9 +1060,9 @@ component_test_no_max_fragment_length_small_ssl_out_content_len () {
component_test_when_no_ciphersuites_have_mac () { component_test_when_no_ciphersuites_have_mac () {
msg "build: when no ciphersuites have MAC" msg "build: when no ciphersuites have MAC"
scripts/config.pl unset MBEDTLS_CIPHER_NULL_CIPHER scripts/config.py unset MBEDTLS_CIPHER_NULL_CIPHER
scripts/config.pl unset MBEDTLS_ARC4_C scripts/config.py unset MBEDTLS_ARC4_C
scripts/config.pl unset MBEDTLS_CIPHER_MODE_CBC scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC
make make
msg "test: !MBEDTLS_SSL_SOME_MODES_USE_MAC" msg "test: !MBEDTLS_SSL_SOME_MODES_USE_MAC"
@ -1074,12 +1074,12 @@ component_test_when_no_ciphersuites_have_mac () {
component_test_null_entropy () { component_test_null_entropy () {
msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)" msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)"
scripts/config.pl set MBEDTLS_TEST_NULL_ENTROPY scripts/config.py set MBEDTLS_TEST_NULL_ENTROPY
scripts/config.pl set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES scripts/config.py set MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
scripts/config.pl set MBEDTLS_ENTROPY_C scripts/config.py set MBEDTLS_ENTROPY_C
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED
scripts/config.pl unset MBEDTLS_ENTROPY_HARDWARE_ALT scripts/config.py unset MBEDTLS_ENTROPY_HARDWARE_ALT
scripts/config.pl unset MBEDTLS_HAVEGE_C scripts/config.py unset MBEDTLS_HAVEGE_C
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan -D UNSAFE_BUILD=ON . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan -D UNSAFE_BUILD=ON .
make make
@ -1089,9 +1089,9 @@ component_test_null_entropy () {
component_test_platform_calloc_macro () { component_test_platform_calloc_macro () {
msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)" msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY scripts/config.py set MBEDTLS_PLATFORM_MEMORY
scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc scripts/config.py set MBEDTLS_PLATFORM_CALLOC_MACRO calloc
scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free scripts/config.py set MBEDTLS_PLATFORM_FREE_MACRO free
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
make make
@ -1117,7 +1117,7 @@ component_build_mbedtls_config_file () {
msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s
# Use the full config so as to catch a maximum of places where # Use the full config so as to catch a maximum of places where
# the check of MBEDTLS_CONFIG_FILE might be missing. # the check of MBEDTLS_CONFIG_FILE might be missing.
scripts/config.pl full scripts/config.py full
sed 's!"check_config.h"!"mbedtls/check_config.h"!' <"$CONFIG_H" >full_config.h sed 's!"check_config.h"!"mbedtls/check_config.h"!' <"$CONFIG_H" >full_config.h
echo '#error "MBEDTLS_CONFIG_FILE is not working"' >"$CONFIG_H" echo '#error "MBEDTLS_CONFIG_FILE is not working"' >"$CONFIG_H"
make CFLAGS="-I '$PWD' -DMBEDTLS_CONFIG_FILE='\"full_config.h\"'" make CFLAGS="-I '$PWD' -DMBEDTLS_CONFIG_FILE='\"full_config.h\"'"
@ -1127,7 +1127,7 @@ component_build_mbedtls_config_file () {
component_test_m32_o0 () { component_test_m32_o0 () {
# Build once with -O0, to compile out the i386 specific inline assembly # Build once with -O0, to compile out the i386 specific inline assembly
msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s
scripts/config.pl full scripts/config.py full
make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address' make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address'
msg "test: i386, make, gcc -O0 (ASan build)" msg "test: i386, make, gcc -O0 (ASan build)"
@ -1143,7 +1143,7 @@ support_test_m32_o0 () {
component_test_m32_o1 () { component_test_m32_o1 () {
# Build again with -O1, to compile in the i386 specific inline assembly # Build again with -O1, to compile in the i386 specific inline assembly
msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s
scripts/config.pl full scripts/config.py full
make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address' make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address'
msg "test: i386, make, gcc -O1 (ASan build)" msg "test: i386, make, gcc -O1 (ASan build)"
@ -1158,8 +1158,8 @@ support_test_m32_o1 () {
component_test_m32_everest () { component_test_m32_everest () {
msg "build: i386, Everest ECDH context (ASan build)" # ~ 6 min msg "build: i386, Everest ECDH context (ASan build)" # ~ 6 min
scripts/config.pl unset MBEDTLS_ECDH_LEGACY_CONTEXT scripts/config.py unset MBEDTLS_ECDH_LEGACY_CONTEXT
scripts/config.pl set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED scripts/config.py set MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED
make CC=gcc CFLAGS='-O2 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address' make CC=gcc CFLAGS='-O2 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32 -fsanitize=address'
msg "test: i386, Everest ECDH context - main suites (inc. selftests) (ASan build)" # ~ 50s msg "test: i386, Everest ECDH context - main suites (inc. selftests) (ASan build)" # ~ 50s
@ -1178,7 +1178,7 @@ support_test_m32_everest () {
component_test_mx32 () { component_test_mx32 () {
msg "build: 64-bit ILP32, make, gcc" # ~ 30s msg "build: 64-bit ILP32, make, gcc" # ~ 30s
scripts/config.pl full scripts/config.py full
make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32' make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32'
msg "test: 64-bit ILP32, make, gcc" msg "test: 64-bit ILP32, make, gcc"
@ -1193,13 +1193,13 @@ support_test_mx32 () {
component_build_arm_none_eabi_gcc () { component_build_arm_none_eabi_gcc () {
msg "build: arm-none-eabi-gcc, make" # ~ 10s msg "build: arm-none-eabi-gcc, make" # ~ 10s
scripts/config.pl baremetal scripts/config.py baremetal
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
} }
component_build_arm_none_eabi_gcc_arm5vte () { component_build_arm_none_eabi_gcc_arm5vte () {
msg "build: arm-none-eabi-gcc -march=arm5vte, make" # ~ 10s msg "build: arm-none-eabi-gcc -march=arm5vte, make" # ~ 10s
scripts/config.pl baremetal scripts/config.py baremetal
# Build for a target platform that's close to what Debian uses # Build for a target platform that's close to what Debian uses
# for its "armel" distribution (https://wiki.debian.org/ArmEabiPort). # for its "armel" distribution (https://wiki.debian.org/ArmEabiPort).
# See https://github.com/ARMmbed/mbedtls/pull/2169 and comments. # See https://github.com/ARMmbed/mbedtls/pull/2169 and comments.
@ -1210,8 +1210,8 @@ component_build_arm_none_eabi_gcc_arm5vte () {
component_build_arm_none_eabi_gcc_no_udbl_division () { component_build_arm_none_eabi_gcc_no_udbl_division () {
msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
scripts/config.pl baremetal scripts/config.py baremetal
scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION scripts/config.py set MBEDTLS_NO_UDBL_DIVISION
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
echo "Checking that software 64-bit division is not required" echo "Checking that software 64-bit division is not required"
if_build_succeeded not grep __aeabi_uldiv library/*.o if_build_succeeded not grep __aeabi_uldiv library/*.o
@ -1219,8 +1219,8 @@ component_build_arm_none_eabi_gcc_no_udbl_division () {
component_build_arm_none_eabi_gcc_no_64bit_multiplication () { component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
scripts/config.pl baremetal scripts/config.py baremetal
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION scripts/config.py set MBEDTLS_NO_64BIT_MULTIPLICATION
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
echo "Checking that software 64-bit multiplication is not required" echo "Checking that software 64-bit multiplication is not required"
if_build_succeeded not grep __aeabi_lmul library/*.o if_build_succeeded not grep __aeabi_lmul library/*.o
@ -1228,7 +1228,7 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
component_build_armcc () { component_build_armcc () {
msg "build: ARM Compiler 5, make" msg "build: ARM Compiler 5, make"
scripts/config.pl baremetal scripts/config.py baremetal
make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
make clean make clean
@ -1251,7 +1251,7 @@ component_build_armcc () {
component_test_allow_sha1 () { component_test_allow_sha1 () {
msg "build: allow SHA1 in certificates by default" msg "build: allow SHA1 in certificates by default"
scripts/config.pl set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES scripts/config.py set MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
make CFLAGS='-Werror -Wall -Wextra' make CFLAGS='-Werror -Wall -Wextra'
msg "test: allow SHA1 in certificates by default" msg "test: allow SHA1 in certificates by default"
make test make test
@ -1280,7 +1280,7 @@ support_build_mingw() {
component_test_memsan () { component_test_memsan () {
msg "build: MSan (clang)" # ~ 1 min 20s msg "build: MSan (clang)" # ~ 1 min 20s
scripts/config.pl unset MBEDTLS_AESNI_C # memsan doesn't grok asm scripts/config.py unset MBEDTLS_AESNI_C # memsan doesn't grok asm
CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan . CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
make make

View file

@ -67,8 +67,8 @@ export CFLAGS=' --coverage -g3 -O0 '
export LDFLAGS=' --coverage' export LDFLAGS=' --coverage'
make clean make clean
cp "$CONFIG_H" "$CONFIG_BAK" cp "$CONFIG_H" "$CONFIG_BAK"
scripts/config.pl full scripts/config.py full
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE scripts/config.py unset MBEDTLS_MEMORY_BACKTRACE
make -j make -j

View file

@ -46,13 +46,13 @@ for my $curve (@curves) {
system( "make clean" ) and die; system( "make clean" ) and die;
# depends on a specific curve. Also, ignore error if it wasn't enabled # depends on a specific curve. Also, ignore error if it wasn't enabled
system( "scripts/config.pl unset MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED" ); system( "scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED" );
print "\n******************************************\n"; print "\n******************************************\n";
print "* Testing without curve: $curve\n"; print "* Testing without curve: $curve\n";
print "******************************************\n"; print "******************************************\n";
system( "scripts/config.pl unset $curve" ) system( "scripts/config.py unset $curve" )
and abort "Failed to disable $curve\n"; and abort "Failed to disable $curve\n";
system( "CFLAGS='-Werror -Wall -Wextra' make lib" ) system( "CFLAGS='-Werror -Wall -Wextra' make lib" )

View file

@ -58,11 +58,11 @@ for my $hash (@hashes) {
print "* Testing without hash: $hash\n"; print "* Testing without hash: $hash\n";
print "******************************************\n"; print "******************************************\n";
system( "scripts/config.pl unset $hash" ) system( "scripts/config.py unset $hash" )
and abort "Failed to disable $hash\n"; and abort "Failed to disable $hash\n";
for my $opt (@ssl) { for my $opt (@ssl) {
system( "scripts/config.pl unset $opt" ) system( "scripts/config.py unset $opt" )
and abort "Failed to disable $opt\n"; and abort "Failed to disable $opt\n";
} }

View file

@ -73,10 +73,10 @@ while( my ($alg, $extras) = each %algs ) {
print "* Testing without alg: $alg\n"; print "* Testing without alg: $alg\n";
print "******************************************\n"; print "******************************************\n";
system( "scripts/config.pl unset $alg" ) system( "scripts/config.py unset $alg" )
and abort "Failed to disable $alg\n"; and abort "Failed to disable $alg\n";
for my $opt (@$extras) { for my $opt (@$extras) {
system( "scripts/config.pl unset $opt" ) system( "scripts/config.py unset $opt" )
and abort "Failed to disable $opt\n"; and abort "Failed to disable $opt\n";
} }

View file

@ -47,10 +47,10 @@ for my $kex (@kexes) {
print "******************************************\n"; print "******************************************\n";
# full config with all key exchanges disabled except one # full config with all key exchanges disabled except one
system( "scripts/config.pl full" ) and abort "Failed config full\n"; system( "scripts/config.py full" ) and abort "Failed config full\n";
for my $k (@kexes) { for my $k (@kexes) {
next if $k eq $kex; next if $k eq $kex;
system( "scripts/config.pl unset $k" ) system( "scripts/config.py unset $k" )
and abort "Failed to disable $k\n"; and abort "Failed to disable $k\n";
} }

View file

@ -13,7 +13,7 @@ if grep -i cmake Makefile >/dev/null; then
fi fi
cp include/mbedtls/config.h include/mbedtls/config.h.bak cp include/mbedtls/config.h include/mbedtls/config.h.bak
scripts/config.pl full scripts/config.py full
make clean make clean
make_ret= make_ret=
CFLAGS=-fno-asynchronous-unwind-tables make lib \ CFLAGS=-fno-asynchronous-unwind-tables make lib \

View file

@ -300,9 +300,9 @@ requires_not_i686() {
} }
# Calculate the input & output maximum content lengths set in the config # Calculate the input & output maximum content lengths set in the config
MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384")
MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN")
MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") MAX_OUT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN")
if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then
MAX_CONTENT_LEN="$MAX_IN_LEN" MAX_CONTENT_LEN="$MAX_IN_LEN"
@ -3718,7 +3718,7 @@ run_test "Authentication: client no cert, ssl3" \
# default value (8) # default value (8)
MAX_IM_CA='8' MAX_IM_CA='8'
MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA) MAX_IM_CA_CONFIG=$( ../scripts/config.py get MBEDTLS_X509_MAX_INTERMEDIATE_CA)
if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then
printf "The ${CONFIG_H} file contains a value for the configuration of\n" printf "The ${CONFIG_H} file contains a value for the configuration of\n"