1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-04 08:02:28 +03:00
Commit Graph

6579 Commits

Author SHA1 Message Date
a645708949 Restore bump version
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-08 11:50:57 +00:00
9a0ad5c427 Changed the test to reflect mbedTLS's current behavior.
Signed-off-by: Matthias Schulz <mschulz@hilscher.com>
2023-11-07 16:40:22 +01:00
5240ab0c98 Backported test cases from https://github.com/Mbed-TLS/mbedtls/pull/8378
Signed-off-by: Matthias Schulz <mschulz@hilscher.com>
2023-11-07 16:21:49 +01:00
d6d43ec8a5 Merge pull request #8485 from gilles-peskine-arm/check-files-license-2.28
Backport 2.28: Check copyright statements and SPDX license statements
2023-11-06 17:07:48 +00:00
32ffbfd139 Pacify mypy
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
1b4f036dd4 Also complain if licenses are mentioned
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
15db6822a3 Check copyright statements and SPDX license identifier
Enforce a specific copyright statement and a specific SPDX license
identifier where they are present.

Binary files, third-party modules and a few other exceptions are not
checked.

There is currently no check that copyright statements and license
identifiers are present.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
5136156750 Sort imports
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-11-06 13:25:37 +01:00
8243ebf6b3 Merge pull request #8477 from paul-elliott-arm/full_no_platform_2_28
[Backport 2.28] Add build preset full_no_platform
2023-11-06 11:35:12 +00:00
0c835dbae3 move script to tests/scripts
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:06:03 +08:00
8c31148af0 fix wrong typo and indent issue
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:04:42 +08:00
dbb7b467d2 Add server9-bad-saltlen generate command
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-11-06 10:04:42 +08:00
6805037a45 Add build preset full_no_platform
Add build preset as above, and utilise it in
all.sh:component_test_no_platform.

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-11-03 19:24:56 +00:00
d0ac48087b Bump version
./scripts/bump_version.sh --version 2.28.6 --so-crypto 7 --so-x509 1 --so-tls 14

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 13:02:18 +00:00
0f2971a968 Update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 12:54:54 +00:00
7ff7965561 Update headers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-11-03 12:04:52 +00:00
1df57fcc0e Merge pull request #8196 from tgonzalezorlandoarm/tg/check_test_cases
Backport 2.28: Make check_test_cases.py recognize test case name templates in ssl-opt.sh
2023-11-02 12:22:40 +00:00
e25a619824 Remove dead code
Do explain why we don't test a smaller buffer in addition to testing the
nominal size and a larger buffer.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-31 09:32:36 +00:00
2bff1bfd47 New test suite for the low-level hash interface
Some basic test coverage for now:

* Nominal operation.
* Larger output buffer.
* Clone an operation and use it after the original operation stops.

Generate test data automatically. For the time being, only do that for
hashes that Python supports natively. Supporting all algorithms is future
work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-31 09:32:35 +00:00
734d22c03e Move PSA information and dependency automation into their own module
This will let us use these features from other modules (yet to be created).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-31 09:31:20 +00:00
f29cc32a06 Merge pull request #8390 from gilles-peskine-arm/20231017-misc-cleanup-2.28
Backport 2.28: Cleanups in test code
2023-10-30 18:07:47 +00:00
aaea3a3148 check_test_cases: Unify walk_compat_sh and walk_opt_sh into one
walk_compat_sh and walk_opt_sh are basically the same now, so:

 * Merge them into one function.
 * Use the --list-test-cases option for both of them.
 * Rename this merged function as collect_from_script which seems
   more appropriate as since it isn't iterating the script but
   calling it.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-30 14:23:57 +00:00
cbb2e45e96 ssl-opt: Introduce --list-test-cases option
Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2023-10-30 14:23:56 +00:00
e3d1c76818 Fix invocation with explicit .datax file
Don't chdir when invoking a test suite executable with an explicit .datax
file. The point of the chdir is to automatically find the .datax file (and
the relative location of the data_files directory) in typical cases. This
conflicts with the expectation that passing a relative path to a .datax file
will work.

(This is what I had originally intended, and what is documented in the
comment, but I forgot to add the argc check in the initial commit.)

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:47:42 +02:00
290e008925 Define try_chdir everywhere
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:47:42 +02:00
460cf76ef5 Note about the lack of Windows support
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:47:42 +02:00
994efa2aa0 Print a notice if chdir fails
Fixes -Wunused-result warning.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:47:42 +02:00
9cc1255e99 Support running unit tests from another directory
When running a test suite, try to change to the directory containing the
executable. This allows running a test suite from any directory, and still
allow it to access its .datax file as well as data files (generally in
tests/data_files) used by individual test cases.

Only implemented on Unix-like systems and on Windows.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-25 17:47:42 +02:00
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
fa27636396 Close file on error path
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-19 17:24:23 +02:00
bf8520080a Use modern macros for calloc in test code
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-19 17:24:23 +02:00
3ca2f5cd01 Make TEST_CALLOC_NONNULL more robust
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-19 17:24:23 +02: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
72aa683aae Introduce TEST_CALLOC_NONNULL
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-10-18 18:14:56 +02:00
ce9c4f52c4 Remove redundant null check
crl_file is a test argument and can't be null. Besides the code above
already assumes that it's non-null.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-18 18:13:39 +02:00
5b5da941a4 test: proper positioning of USE_PSA_INIT + fixed some exit labels
Very partial backport of 32f2ac9a18

Signed-off-by: valerio <valerio.setti@nordicsemi.no>
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-18 18:12:39 +02:00
11f41793f8 Fix missing initializations on some error paths
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-10-18 18:12:36 +02: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
0814a22490 Correct styling of Mbed TLS in documentation
Several bits of documentation were incorrectly styling Mbed TLS
as MbedTLS.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2023-10-06 17:37:01 +01:00
c7a8ea998d Bump version to 2.28.5
```
./scripts/bump_version.sh --version 2.28.5
```

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-10-03 22:24:04 +01:00
6d169947e9 Merge branch 'mbedtls-2.28-restricted' into mbedtls-2.28.5rc0-pr
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-10-03 22:22:36 +01:00
dc48f6ed27 Test mbedtls_ssl_decrypt_buf(): stream cipher, negative cases
Test mbedtls_ssl_decrypt_buf() with a stream cipher (RC4 or null). Test the
good case (to make sure the test code constructs the input correctly), test
with an invalid MAC, and test with a shortened input.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-21 18:25:05 +02:00
2198cc5273 Refactoring: create mbedtls_test_ssl_prepare_record_mac()
No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-21 18:24:38 +02:00
027e1b4b3d Refactoring: prepare to create mbedtls_test_ssl_prepare_record_mac()
No semantic change.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-21 18:24:38 +02:00
9013b818c6 Move testing of mbedtls_ssl_decrypt_buf to a new test suite
test_suite_ssl is huge and needs splitting.

Create a new test suite focused on mbedtls_ssl_decrypt_buf(), which is a
complicated function that needs more thorough testing with malformed inputs.
At this point, we are only doing negative testing with CBC-non-ETM test
suites. This needs to grow.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-09-21 18:24:36 +02:00
f4cf4a6e25 Merge pull request #1070 from gilles-peskine-arm/merge-2.28-restricted-20230915
Merge mbedtls-2.28 into restricted
2023-09-20 12:07:55 +01: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
9cacae3c7a Merge remote-tracking branch 'upstream-public/mbedtls-2.28' into HEAD 2023-09-15 18:32:36 +02:00