1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Merge pull request #9121 from valeriosetti/issue8963

Add client-server build to all.sh
This commit is contained in:
Tom Cosgrove
2024-05-20 07:14:37 +00:00
committed by GitHub
23 changed files with 642 additions and 611 deletions

View File

@@ -945,6 +945,39 @@ helper_libtestdriver1_make_main() {
make CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -I../tests/include -I../tests -I../../tests -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_TEST_LIBTESTDRIVER1 $loc_accel_flags" LDFLAGS="-ltestdriver1 $ASAN_CFLAGS" "$@"
}
# $1: target which can be "client" or "server"
helper_crypto_client_build() {
TARGET=$1
shift
TARGET_LIB=libpsa$TARGET
if [ "$TARGET" == "client" ]; then
scripts/config.py full
scripts/config.py unset MBEDTLS_PSA_CRYPTO_C
scripts/config.py unset MBEDTLS_PSA_CRYPTO_STORAGE_C
# Dynamic secure element support is a deprecated feature and it is not
# available when CRYPTO_C and PSA_CRYPTO_STORAGE_C are disabled.
scripts/config.py unset MBEDTLS_PSA_CRYPTO_SE_C
# Disable potentially problematic features
scripts/config.py unset MBEDTLS_X509_RSASSA_PSS_SUPPORT
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
scripts/config.py unset MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
scripts/config.py unset MBEDTLS_ECP_RESTARTABLE
else
scripts/config.py crypto_full
scripts/config.py unset MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS
scripts/config.py set MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
fi
make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB "$@"
# cleanup() will restore some backed-up files which include $CONFIG_H and
# $CRYPTO_CONFIG_H. Built libraries were already copied to psasim at this
# point.
cleanup
}
################################################################
#### Configuration helpers
################################################################
@@ -6175,11 +6208,21 @@ component_check_test_helpers () {
}
component_test_psasim() {
msg "build library for client"
helper_crypto_client_build client
msg "build library for server"
scripts/config.py crypto
helper_crypto_client_build server
msg "build psasim"
make -C tests/psa-client-server/psasim
make -C tests/psa-client-server/psasim CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS"
msg "test psasim"
make -C tests/psa-client-server/psasim run
tests/psa-client-server/psasim/test/run_test.sh
msg "clean psasim"
make -C tests/psa-client-server/psasim clean