1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00
Commit Graph

6575 Commits

Author SHA1 Message Date
Gilles Peskine
e681a4e7e5 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-12-02 21:40:21 +01:00
Harry Ramsey
9d99e98503 Remove trailing whitespace
This commit removes trailing whitespace in test_suite_gcm.function.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 15:57:29 +00:00
Harry Ramsey
a1abbdb2b3 Add new line to end of test case files
This commit adds a new line to the end of test case files to pass
check_files.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 12:49:34 +00:00
Harry Ramsey
0cd29510f6 Add test cases for AES GCM input and output buffer overlap
This commit adds test cases for input and output buffer overlap. The
data for the test cases is a duplicate of existing encrypt/decrypt test
cases.

The two test functions gcm_<encrypt/decrypt>_input_output_buffer_overlap
are modified to use a single malloc buffer rounded to the nearest
128-bits/16-bytes for input and output.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-13 11:23:57 +00:00
Paul Elliott
89c68e206b Merge pull request #9736 from mpg/drop-armcc5-2.28
[2.28] Drop armcc5 support in all.sh
2024-10-30 12:29:32 +00:00
Gilles Peskine
89a87b5353 Merge pull request #9729 from paul-elliott-arm/fix_new_coverity_issues_2.28
[Backport 2.28] Fix new coverity issues
2024-10-29 14:58:39 +00:00
Manuel Pégourié-Gonnard
a674e988c9 Drop building with armcc5 in all.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 11:52:49 +01:00
Bence Szépkúti
61da0ddb07 Add override arguments for new gcc targets
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:33:48 +01:00
Bence Szépkúti
b14dd763c3 Clarify GCC version requirement
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:33:09 +01:00
Bence Szépkúti
478730eed2 Split up the Thumb-1 test component
The Thumb-1 tests are by far the slowest, so split the -O0 and -Os tests
into their own components.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:32:41 +01:00
Bence Szépkúti
73d8640bd3 Remove superfluous invocations of make clean
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:31:55 +01:00
Bence Szépkúti
f92112d7be Update component speed estimates
The estimates are based on the most recent CI run.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:30:20 +01:00
Bence Szépkúti
a56b61c6ee Initialize result caching variables
This prevents interference from identically named environment variables.

Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:49 +01:00
Bence Szépkúti
63a10d0726 Use true/false in place of integers
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:20 +01:00
Bence Szépkúti
08c14d1412 Ignore missing temporary files during cleanup
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:29:06 +01:00
Bence Szépkúti
26822ab1b6 Fix copypasta in gcc_version
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:28:50 +01:00
Bence Szépkúti
915fa3e6c7 Add AArch64 default config test
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:28:18 +01:00
Bence Szépkúti
86aa780e5a Add Arm eabi default config tests
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-10-28 13:27:39 +01:00
Paul Elliott
417b8d92a1 Pair inits with declarations
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 12:47:23 +01:00
Paul Elliott
9488b8c513 Fix double free in case of test failure
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 12:00:05 +01:00
Paul Elliott
1348b6a861 Add missing check of return
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 11:59:59 +01:00
Paul Elliott
181564bb89 Fix tests where tests were done prior to init
Variables that are in any way destructed on exit should be initialised
prior to any tests that might jump to exit, to save potential
uninitialised memory accesses.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-10-25 11:59:11 +01:00
Gilles Peskine
bfe4fc6749 Use -O2 for build+test with earliest compilers
The compilation is slower but we get more potential warnings and running the
tests is faster.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:58 +02:00
Gilles Peskine
8214340bb0 Fix spurious * in regex
`grep mbedtls_des*` would pick up e.g. mbedtls_derive_xxx.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:48 +02:00
Gilles Peskine
c61187f508 Don't set LD to a path with a typo for mingw
Our makefiles don't use $(LD) so the typo was harmless.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:02 +02:00
Sergei Trofimovich
990a88cd53 tests: fix calloc() argument list (gcc-14 fix)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `mbedtls`:

    In file included from /build/mbedtls/tests/include/test/ssl_helpers.h:19,
                     from /build/mbedtls/tests/src/test_helpers/ssl_helpers.c:11:
    /build/mbedtls/tests/src/test_helpers/ssl_helpers.c: In function 'mbedtls_test_init_handshake_options':
    /build/mbedtls/tests/include/test/macros.h:128:46:
      error: 'calloc' sizes specified with 'sizeof' in the earlier argument
        and not in the later argument [-Werror=calloc-transposed-args]
      128 |             (pointer) = mbedtls_calloc(sizeof(*(pointer)),  \
          |                                              ^

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
2024-09-02 22:09:13 +02:00
Manuel Pégourié-Gonnard
9f7cc4c14f Bump version to 2.28.9
Soversions unchanged.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:44:41 +02:00
Gilles Peskine
36548eefa4 Merge pull request #9256 from gilles-peskine-arm/psa-keystore-dynamic-backport-2.28
Backport 2.28: prepare for dynamically sized key store
2024-08-09 08:00:01 +00:00
Gilles Peskine
4c9d43fb18 Improve documentation in some tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:57 +02:00
Gilles Peskine
3a51fdc8c6 Improve full-key-store tests
Split the "many transient keys" test function in two: one that expects to
successfully create many keys, and one that expects to fill the key store.
This will make things easier when we add a dynamic key store where filling
the key store is not practical unless artificially limited.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
91773db331 Add a test for the built-in key range
Restricting the built-in key range would be an API break since applications
can hard-code a built-in key value and expect that it won't clash with
anything else. Make it harder to accidentally break the API.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Gilles Peskine
37a4fcc5b4 Prevent mbedtls_psa_register_se_key with volatile keys
mbedtls_psa_register_se_key() is not usable with volatile keys, since there
is no way to return the implementation-chosen key identifier which would be
needed to use the key. Document this limitation. Reject an attempt to create
such an unusable key. Fixes #9253.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
Tomás González
a526528de3 tests/ssl_helpers: Check that message queue is popped
mbedtls_test_mock_tcp_recv_msg is currently popping a message
queue and does not check if this was done correctly.

This extra check makes the test more complete/robust.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2024-07-31 17:25:40 +01:00
Wenxing Hou
20e964f1c6 Fix some typo for include folder
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2024-07-12 11:43:33 +03:00
Gilles Peskine
a76a6ff8df Adjust TLS protocol cases for 2.28
TLS 1.3 is still experimental and partial, and SSL3 is obsolete, so we don't
expect much coverage about them, in particular we don't expect them to be
the sole supported version. TLS 1.0 and 1.1 exist and we expect good
coverage for them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-07-01 11:32:33 +02:00
Gilles Peskine
93708fe126 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-28 19:16:25 +02:00
Gilles Peskine
b19fa4e6c7 Declare the new generated files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:34 +02:00
Gilles Peskine
d33c48b407 Add generated config tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:22 +02:00
Gilles Peskine
cfba2477e6 Remove some settings that don't exist in 2.28
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:11:59 +02:00
Gilles Peskine
744741bf2c Adjust generate_config_tests.py for 2.28
* Move to the correct location.
* Adjust the package name for auxiliary modules.
* Adjust the hack to import a module from scripts.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:05:10 +02:00
Gilles Peskine
ae27ca9e0a Anchor relative paths
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 19:52:12 +02:00
Gilles Peskine
14f91c9d89 New test suite to report configuration options
Add a test suite intended to report configuration options in the outcome
file: we're only interested in SKIP vs PASS.

Add a few test cases for some interesting combinations of options. The
selection here is just for illustration purposes, more will be added later.

A subsequent commit will automatically generate test cases for single options.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 19:49:59 +02:00
Ronald Cron
e3bdbd53ec all.sh: Fix clean-up of Makefiles generated by CMake
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-18 09:39:51 +02:00
Gilles Peskine
f514f25f88 Merge pull request #9025 from gilles-peskine-arm/psa-storage-test-cases-never-supported-2.28
Backport 2.28: Fix the detection of not-supported mechanisms in systematically generated PSA tests
2024-06-14 18:23:38 +00:00
Gilles Peskine
5a63e2f25f Select more RSA cipher suites
Filtering on cipher suites that have RSA in their name excludes a few old
RSA-based cipher suites whose name doesn't contain RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-31 13:36:55 +02:00
Gilles Peskine
8f5722a971 Fix compat.sh not running any tests on config-mini-tls1_1.h
We were only requesting 3DES cipher suites (which is weirdly restrictive
since the configuration also includes AES), but DES is in the default
exclusion list for compat.sh, so we ended up having no acceptable cipher
suites. Fix this.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-30 15:17:28 +02:00
Gilles Peskine
2ca5a68ad3 Enable 3DES with GnuTLS
With GnuTLS servers, 3DES-CBC cipher suites are enabled by default under our
GNUTLS_LEGACY (3.3.8), but disabled by default under more recent versions
including the one we use by default on the CI (3.4.6). Even modern
versions (I checked 3.7.2) support 3DES if explicitly enabled. So
unconditionally enable 3DES-CBC for GnuTLS.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-30 15:14:40 +02:00
Gilles Peskine
d2c418932a ssl-opt.sh, compat.sh: Error out if not executing any tests
Alert if all tests are filtered out or skipped: that probably indicates a
test script that set up an unintended configuration or an overly strict
filter. You can pass `--min 0` to bypass this check. You can pass `--min`
with a larger value to require that many test cases to run.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 20:03:12 +02:00
Gilles Peskine
9ebf9aa448 Merge pull request #9153 from gilles-peskine-arm/oid-limits-2.28
2.28 only: Fix the build without check_config.h (inclusion of limits.h)
2024-05-29 16:14:24 +00:00
Gilles Peskine
a8cd2e6421 Fix the build without check_config.h (inclusion of limits.h)
Including `mbedtls/check_config.h` from `mbedtls/config.h` is optional. If
done, `limits.h` gets included. If not done, we were missing the inclusion
of `limits.h` in several source files. Fix this and add a test build that
doesn't include `mbedtls/check_config.h`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-17 19:00:46 +02:00