1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-05-27 05:21:06 +03:00

716 Commits

Author SHA1 Message Date
Andrzej Kurek
6e4a9beb2b Disable msan errors on null allocation in all.sh
Such error was raised in platform tests,
and it's a valid test case.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-07-14 10:16:11 -04:00
Andrzej Kurek
d95b8edf29 Disable asan errors on null allocation in all.sh
Such error was raised in platform tests,
and it's a valid test case.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-07-14 10:13:40 -04:00
David Horstmann
6762231e4b Use CONFIG_H variable rather than config file name
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:35:25 +01:00
David Horstmann
175afbdfe8 all.sh component to test cmake custom config file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-07-05 14:35:25 +01:00
Dave Rodgman
bf99828d7b Nicer formatting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:14:41 +01:00
Dave Rodgman
173227d41e Test combinations of macros for aes.o
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:14:34 +01:00
Dave Rodgman
c2e225be81 Add armclang build test
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-05 21:29:35 -04:00
Dave Rodgman
43ea9ab5fa Add build tests for Thumb and Thumb2 with clang
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-05 21:26:27 -04:00
Pengyu Lv
d216c0411d all.sh: add support function for build_armcc
With this change, "--list-components" will not list
"build_armcc" on the system which is not installed
with Arm Compilers.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-03-03 18:23:35 +08:00
Pengyu Lv
a19ce12e47 all.sh: Skip build_mingw correctly
If i686-w64-mingw32-gcc is not installed, then
build_mingw should be unsupported.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-03-03 18:21:14 +08:00
Dave Rodgman
6cda3d3b5b Enable -Werror for armclang
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-03-02 15:34:42 +00:00
Gilles Peskine
bfe79030a9
Merge pull request #7021 from lpy4105/issue/backport-do-not-run-x86-tests-on-arm64
Backport 2.28: all.sh: test_m32_xx is not supported on arm64 host
2023-02-07 10:26:16 +01:00
Pengyu Lv
a89b36757c all.sh: test_m32_xx is not supported on arm64 host
test_m32_xxx tests are x86 specific, but the support
function only identifies a 64-bit system. So the tests
will be run on arm64 host and cause a test failure.
This change restricts those tests to amd64/x86_64
only.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-02-02 17:28:10 +08:00
Gilles Peskine
5619443bf1 Test without MBEDTLS_CERTS_C
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-02-01 18:47:58 +01:00
Gilles Peskine
f57f3db920
Merge pull request #6931 from AndrzejKurek/timeless-selftest-waz-bad
[2.28] Enable the timing.c selftest with MBEDTLS_TIMING_ALT
2023-01-26 21:55:44 +01:00
Andrzej Kurek
3a261a4dfd Add a selftest run for the TIMING_ALT test
The fuzz programs require one layer of directories
more when adding include directories.
Also remove an unnecessary include directory in the Makefile.

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-26 04:33:59 -05:00
Dave Rodgman
5fce4f6a45 Add regression test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 13:24:01 +00:00
Andrzej Kurek
c890b22fb3 Add a test for external alternate timing implementation
Copy the original implementation
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-17 05:11:29 -05:00
Gilles Peskine
b9e56fb560 Switch code style check to enforcement mode
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-11 14:52:38 +01:00
Manuel Pégourié-Gonnard
89d4027d6c Use OPENSSL everywhere, not OPENSSL_CMD
These variables were both uses to select the default version of OpenSSL
to use for tests:
- when running compat.sh or ssl-opt.sh directly, OPENSSL_CMD was used;
- when running all.sh, OPENSSL was used.

This caused surprising situations if you had one but not the other set
in your environment. For example I used to have OPENSSL_CMD set but not
OPENSSL, so ssl-opt.sh was failing in some all.sh components but passing
when I ran it manually in the same configuration and build, a rather
unpleasant experience.

The natural name would be OPENSSL, and that's what set in the Docker
images used by the CI. However back in the 1.3.x days, that name was
already used in library/Makefile, so it was preferable to pick a
different one, hence OPENSSL_CMD. However the build system has not been
using this name since at least Mbed TLS 2.0.0, so it's now free for use
again (as demonstrated by the fact that it's been set in the CI without
causing any trouble).

So, unify things and use OPENSSL everywhere. Just leave an error message
for the benefit of developers which might have OPENSSL_CMD, not OPENSSL,
set in their environment from the old days.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-01-10 09:47:09 +01:00
Gilles Peskine
5898796480 Hide check_test_cases warnings on the CI
We aren't paying attention to the warnings. So hide them and save log size.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-15 15:22:13 +01:00
Manuel Pégourié-Gonnard
df86cef899
Merge pull request #6693 from mpg/optimize-with-asan-2.28
[backport 2.28] Optimize with asan
2022-12-12 11:58:21 +01:00
Manuel Pégourié-Gonnard
0e0793f4ac
Merge pull request #6706 from davidhorstmann-arm/2.28-code-style-script-non-corrected
[Backport 2.28] Add code style correction script
2022-12-09 09:41:27 +01:00
David Horstmann
e09c476eb6 Add all.sh component to test with code style
Run the main test suites after running code style correction to check
that code style correction does not break these tests.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 10:09:03 +00:00
Gilles Peskine
9603a441a0 Valgrind for constant flow: skip non-CF test suites
When testing under Valgrind for constant flow, skip test suites that don't
have any constant-flow annotations, since the testing wouldn't do anything
more that testing with ordinary Valgrind (component_test_valgrind).
This is a significant time saving since testing with Valgrind is very slow.

In Mbed TLS 2.28, MBEDTLS_USE_PSA_CRYPTO does not affect constant-time
functions, so testing in the full configuration covers all we need.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-01 19:49:36 +01:00
Gilles Peskine
619b73d97d Test MBEDTLS_USE_PSA_CRYPTO with Valgrind
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-01 19:49:36 +01:00
Manuel Pégourié-Gonnard
717f2305a4 Add comment about use of ASAN_CFLAGS
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-30 10:54:01 +01:00
Manuel Pégourié-Gonnard
154b84e664 Enable optimisation with Asan with make in all.sh
All builds using ASAN_CFLAGS were with Asan but no optimisation, making
them particularly slow. Indeed, we were overwriting CFLAGS which
defaults to -O2 and not using any -O in the replacement. (CMake already has
optimisations on with ASan.)

While at it, also remove -Wall -Wextra which are redundant as they are
already part of WARNING_CFLAGS which we are not overwriting.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-11-30 10:54:01 +01:00
Dave Rodgman
b400fb0b76
Merge pull request #6452 from AndrzejKurek/depends-py-reloaded-2-28
[Backport 2.28] Unified tests/scripts/depends.py - reloaded
2022-11-24 10:59:31 +00:00
Gilles Peskine
83264bed63 Group cpp_dummy_build test into an existing component
No need to do yet another build just to compile an additional trivial program.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-31 11:45:17 +00:00
Gilles Peskine
e86cdcb7bf Remove redundant build-only driver interface component
component_build_psa_accel_alg_ecdsa is subsumed by
component_test_psa_crypto_config_accel_ecdsa, which has the same
configuration and additionally runs the unit tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-31 11:41:47 +00:00
Andrzej Kurek
c5acdb9e92 Remove unused perl dependency scripts
curves.pl, depends-hashes.pl, key-exchanges.pl and depends-pkalgs.pl are now superseded by depends.py.
Update all references to them accordingly.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-27 07:44:13 -04:00
Andrzej Kurek
20d8a5f688 Add all.sh components running depends.py without MBEDTLS_USE_PSA_CRYPTO
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-27 07:44:13 -04:00
Gilles Peskine
031c8c2815 Add build with a typical configuration for a PSA crypto service
Disable non-crypto features that can't be called through the PSA API, as
well as algorithms that have no PSA interface.

This serves as a non-regression test for #6408 and #6409.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 21:09:49 +02:00
Gilles Peskine
8df2748432 Improve test component name
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:32:35 +02:00
Gilles Peskine
21503df752 Add build with a typical configuration for a PSA crypto service
Disable non-crypto features that can't be called through the PSA API, as
well as algorithms that have no PSA interface.

This serves as a non-regression test for #6408 and #6409.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-25 20:32:20 +02:00
Andrzej Kurek
85d69309e8 Split depends.py all.sh job into seven
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-20 06:23:56 -04:00
Andrzej Kurek
3cdd08cf84 Add an all.sh component running depends.pl
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2022-10-20 06:23:34 -04:00
Manuel Pégourié-Gonnard
3495ca309b
Merge pull request #6415 from mprse/aead_driver_test_2_28_backport
2.28 backport: Enable testing of AEAD drivers with libtestdriver1
2022-10-14 11:11:06 +02:00
Gilles Peskine
279188f3f3
Merge pull request #6396 from gilles-peskine-arm/platform.h-unconditional-2.28
Backport 2.28: Include platform.h unconditionally
2022-10-13 10:19:25 +02:00
Przemek Stekiel
8b56f23db2 all.sh: add testing of AEAD drivers with libtestdriver1
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-10-12 13:03:40 +02:00
Przemek Stekiel
fa6094185e Revert: Enable Key Wrapping mode for 128-bit block ciphers
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-10-10 14:34:09 +02:00
Przemek Stekiel
97d5740b7a Fix MBEDTLS_SSL_TICKET_C, MBEDTLS_SSL_SESSION_TICKETS dependencies
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-10-10 14:08:51 +02:00
Gilles Peskine
9c764bfd72 MBEDTLS_PLATFORM_VSNPRINTF_ALT requires MBEDTLS_PLATFORM_C
mbedtls_vsnprintf replacement works like mbedtls_snprintf replacement, so
copy the requirements for MBEDTLS_PLATFORM_VSNPRINTF_ALT.

(MBEDTLS_PLATFORM_xxx_MACRO shouldn't require MBEDTLS_PLATFORM_C, but that's
a separate preexisting problem which I do not try address at this time.)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-10-07 15:57:59 +02:00
Przemek Stekiel
2b03880628 Enable Key Wrapping mode for 128-bit block ciphers
This is done to make configuration consistent with upstream and get rid of warnings.
ssl_ticket.c:254:17: warning: implicit declaration of function ‘mbedtls_cipher_auth_encrypt_ext’

Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-10-06 12:08:25 +02:00
Przemek Stekiel
e53527063b Add test components for tls 1.2 builds with single encryption type
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
2022-10-05 11:37:54 +02:00
Gilles Peskine
7959858f4c Don't remove programs/fuzz/Makefile
Other programs/*/Makefile are only created by CMake, but programs/fuzz has
its own Makefile in the repository. Fixes #6247.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-09-22 10:19:52 +02:00
Gilles Peskine
423dd13357 Don't try restoring a file if no backup is available
This caused `all.sh --force` to fail on a clean build tree.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-09-22 10:19:51 +02:00
Shaun Case
0e7791ff07 Redo of PR#5345. Fixed spelling and typographical errors found by CodeSpell.
Signed-off-by: Shaun Case <warmsocks@gmail.com>
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-04-28 18:22:20 +01:00
Gilles Peskine
9aa892b833
Merge pull request #5754 from gilles-peskine-arm/psa-storage-format-test-exercise-2.28
Backport 2.28: PSA storage format: exercise key
2022-04-28 18:20:09 +02:00