Skip to content

Commit

Permalink
Refuse to build the library if deprecated features are excluded
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gilles-peskine-arm committed Apr 23, 2020
1 parent 9c1e009 commit 4099df6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 3 additions & 0 deletions include/mbedtls/check_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#ifndef MBEDTLS_CHECK_CONFIG_H
#define MBEDTLS_CHECK_CONFIG_H

#if defined(MBEDTLS_DEPRECATED_REMOVED)
#error "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
#endif
#if defined(MBEDTLS_DEPRECATED_WARNING)
#warning "Mbed Crypto is no longer being updated. Please use Mbed TLS instead. See README.md."
#endif
Expand Down
9 changes: 0 additions & 9 deletions tests/scripts/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -712,15 +712,6 @@ component_build_deprecated () {
msg "test: make, full config + DEPRECATED_WARNING, expect warnings" # ~ 30s
make -C tests clean
make CC=gcc CFLAGS='-O -Werror -Wall -Wextra -Wno-error=deprecated-declarations -DMBEDTLS_TEST_DEPRECATED' tests

msg "build: make, full config + DEPRECATED_REMOVED, clang -O" # ~ 30s
# No cleanup, just tweak the configuration and rebuild
make clean
scripts/config.py unset MBEDTLS_DEPRECATED_WARNING
scripts/config.py set MBEDTLS_DEPRECATED_REMOVED
# 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 -Wno-unused-function' tests
}

component_test_depends_curves () {
Expand Down

0 comments on commit 4099df6

Please sign in to comment.