Skip to content

Commit d1428a2

Browse files
Refuse to build the library if deprecated features are excluded
Mbed Crypto is no longer being updated, so using it is deprecated. Don't test with MBEDTLS_DEPRECATED_REMOVED anymore since the library deliberately no longer builds when it's enabled. Signed-off-by: Gilles Peskine <[email protected]>
1 parent 9c1e009 commit d1428a2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

include/mbedtls/check_config.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
#ifndef MBEDTLS_CHECK_CONFIG_H
3131
#define MBEDTLS_CHECK_CONFIG_H
3232

33+
#if defined(MBEDTLS_DEPRECATED_ERROR)
34+
#error "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
35+
#endif
3336
#if defined(MBEDTLS_DEPRECATED_WARNING)
3437
#warning "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
3538
#endif

tests/scripts/all.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -712,15 +712,6 @@ component_build_deprecated () {
712712
msg "test: make, full config + DEPRECATED_WARNING, expect warnings" # ~ 30s
713713
make -C tests clean
714714
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -DMBEDTLS_TEST_DEPRECATED' tests
715-
716-
msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
717-
# No cleanup, just tweak the configuration and rebuild
718-
make clean
719-
scripts/config.py unset MBEDTLS_DEPRECATED_WARNING
720-
scripts/config.py set MBEDTLS_DEPRECATED_REMOVED
721-
# Build with -O -Wextra to catch a maximum of issues.
722-
make CC=clang CFLAGS='-O -Werror -Wall -Wextra' lib programs
723-
make CC=clang CFLAGS='-O -Werror -Wall -Wextra -Wno-unused-function' tests
724715
}
725716

726717
component_test_depends_curves () {

0 commit comments

Comments
 (0)