1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-07 12:21:11 +03:00
Commit Graph

692 Commits

Author SHA1 Message Date
c6d562815d Merge pull request #8392 from lpy4105/backport-2.28/issue/support-cpuid-for-win32
Backport 2.28: Support cpuid for win32
2023-10-23 10:43:36 +00:00
e6cbec8ea7 all.sh: build_mingw: test build default config without MBEDTLS_AESNI_C
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-10-20 09:54:41 +08:00
7e36ad1f5c Merge pull request #7983 from gilles-peskine-arm/sample-program-demos-2.28
Backport 2.28: Run sample program demo scripts in all.sh
2023-10-19 15:11:00 +00:00
b2ca03251d all.sh: build_mingw: test AESNI intrinsics
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2023-10-19 17:17:19 +08:00
0ee9dacb4d Merge pull request #8122 from gilles-peskine-arm/ssl-test-no-legacy-2.28
Backport 2.28: Remove GNUTLS_LEGACY and OPENSSL_LEGACY (partly)
2023-10-18 07:13:15 +00:00
3591cc61f2 Merge pull request #8103 from gilles-peskine-arm/7961-2.28
Backport 2.28: parts of #7961
2023-09-18 08:13:08 +00:00
f08ca83b4f Update spelling "mbed TLS" to "Mbed TLS"
The official spelling of the trade mark changed from all-lowercase "mbed"
to normal proper noun capitalization "Mbed" a few years ago. We've been
using the new spelling in new text but still have the old spelling in a
lot of text. This commit updates most occurrences of "mbed TLS":

```
sed -i -e 's/mbed TLS/Mbed TLS/g' $(git ls-files ':!ChangeLog' ':!tests/data_files/**' ':!tests/suites/*.data' ':!programs/x509/*' ':!configs/tfm*')
```

Justification for the omissions:

* `ChangeLog`: historical text.
* `test/data_files/**`, `tests/suites/*.data`, `programs/x509/*`: many
  occurrences are significant names in certificates and such. Changing
  the spelling would invalidate many signatures and tests.
* `configs/tfm*`: this is an imported file. We'll follow the upstream
  updates.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-12 19:21:54 +02:00
5ffb19741d config-wrapper-zeroize-memset.h should be user-config-zeroize-memset.h and not include mbedtls_config.h
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-09-01 14:44:11 +01:00
7f18f44053 Move zeroize-as-memset into a config file under tests/
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-09-01 14:43:48 +01:00
5117062bb6 Add a build to all.sh to check mbedtls_platform_zeroize() calls
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-09-01 11:24:27 +01:00
549a96120e Remove GNUTLS_LEGACY
It isn't used anywhere.

Keep the command line options of all.sh to avoid breaking any wrapper
scripts that people might have.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-27 21:50:06 +02:00
c67c3b3db6 Reduce adherence on "legacy" OpenSSL and GnuTLS
None of the tests actually need GNUTLS_LEGACY (3.3.8): GNUTLS (3.4.10)
works.

Only single-DES actually needs OPENSSL_LEGACY (1.0.1j). For the rest,
OPENSSL (1.0.2g) works.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-27 21:39:10 +02:00
8d77ec2f7d PSA_CRYPTO_DRIVER_TEST_ALL is incompatible with MBEDTLS_PSA_CRYPTO_CONFIG
Explain how PSA_CRYPTO_DRIVER_TEST_ALL works and why we have it. Note that
it is incompatible with MBEDTLS_PSA_CRYPTO_CONFIG.

MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS is in the full config, so there's no need to
add it explicitly.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-23 18:23:20 +02:00
168be01a78 Correct some msg messages in full config
When MBEDTLS_USE_PSA_CRYPTO is disabled on a base of full, mention it.

Don't explicitly mention MBEDTLS_PSA_CRYPTO_CONFIG when also mentioning
PSA_WANT_xxx, since PSA_WANT symbols are only meaningful when
MBEDTLS_PSA_CRYPTO_CONFIG is enabled.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 17:44:25 +02:00
2e70f1c952 Make malloc-0-null a user config file
Having a wrapper made it harder to use: incompatible with setting
MBEDTLS_CONFIG_FILE, harder to combine with other settings. It was also
surprising since it was the only test config that was structured in that
way.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 17:37:42 +02:00
d4c85af9ce Fix inconsistencies in no-chachapoly test
The original goal (https://github.com/Mbed-TLS/mbedtls/pull/5072) was to run
a test with ChaChaPoly disabled in PSA. It was actually implemented with GCM
also partially disabled (legacy GCM enabled but PSA GCM disabled), which
distracted from the objective. It's actually useful to test both with and
without GCM, so test both. Don't test inconsistencies between legacy and PSA
support because that's not a common case and not one we have particular
reasons to test.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 16:24:14 +02:00
2d04ce2a88 Remove comments that duplicate the 'msg' call just below
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-08-22 16:21:20 +02:00
7fbbb61238 Merge remote-tracking branch 'mbedtls-2.28' into calloc-also-zeroizes-2-28 2023-08-21 17:25:47 +02:00
fb806b68ed Merge pull request #7969 from gowthamsk-arm/use_earliest_latest_compilers_2.28
Backport 2.28: Use earliest latest compilers 2.28
2023-08-01 23:50:14 +00:00
cc029afbd0 Update default variable values for compilers
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:48:32 +01:00
2afb24f96a Use variables for selecting compilers
The latest and earliest clang/GCC compilers are now used through
variables instead of symlinks and also the all.sh script is updated
to support options for overriding the default values.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:45:57 +01:00
13850f387b Use compgen to gather components in all.sh
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:40:01 +01:00
53453cf250 Remove test_clang_opt check
The component functions in all.sh will be listed using
compgen instead of sed so this check is not needed.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:39:56 +01:00
1e3af2485f Update test scripts to use latest/earliest compilers
The Ubuntu 16.04 and 22.04 docker images have been updated with
earliest and latest versions of gcc and clang respectively.
This patch adds the necessary component and support functions
required for the CI to run these compilers.

For FreeBSD we invoke the function by name so a condition is added
to disable the existing test_clang_opt function for linux.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-07-26 16:55:39 +01:00
93aaf2e998 Run demo scripts in some builds
Run the sample program demo scripts in builds with a configuration
that is at least as complete as the default configuration.

Do not run sample programs in all configurations since they are
expected to fail if a required feature is missing.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
55e89985f0 Test MBEDTLS_PSA_INJECT_ENTROPY
Until now, we were never enabling this option in any test.

MBEDTLS_PSA_INJECT_ENTROPY requires MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES, so
it cannot be enabled in the full config and it gets its own component.

Test with MBEDTLS_USE_PSA_CRYPTO enabled, since MBEDTLS_PSA_INJECT_ENTROPY
is a very PSA feature (which can break non-PSA applications), and Mbed
OS (for whch MBEDTLS_PSA_INJECT_ENTROPY was designed) enables
MBEDTLS_USE_PSA_CRYPTO when it enables MBEDTLS_PSA_INJECT_ENTROPY.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 18:11:21 +02:00
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
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
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
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
bf99828d7b Nicer formatting
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:14:41 +01:00
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
c2e225be81 Add armclang build test
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-05 21:29:35 -04:00
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
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
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
6cda3d3b5b Enable -Werror for armclang
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-03-02 15:34:42 +00:00
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
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
5619443bf1 Test without MBEDTLS_CERTS_C
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-02-01 18:47:58 +01:00
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
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
5fce4f6a45 Add regression test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 13:24:01 +00:00
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
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
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
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
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
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
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