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

17370 Commits

Author SHA1 Message Date
Dave Rodgman
5c581dd602
Merge pull request #6735 from daverodgman/fix_test_dep_spelling_2.28
Backport 2.28: Fix spelling of test dependency
2022-12-07 09:06:39 +00:00
Dave Rodgman
3019ee631e
Merge pull request #6739 from daverodgman/rsa-pss-doc-fix-2.28 2022-12-06 20:32:31 +00:00
Dave Rodgman
9889c66bff
Merge pull request #6710 from gilles-peskine-arm/valgrind-cf-skip-tests-2.28
Backport 2.28: Rationalize Valgrind tests
2022-12-06 18:39:39 +00:00
Dave Rodgman
5301532047
Merge pull request #6736 from davidhorstmann-arm/2.28-cmake-get-skip-test-from-env
[backport 2.28] Tell cmake to get SKIP_TEST_SUITES from ENV
2022-12-06 18:38:51 +00:00
Tuvshinzaya Erdenekhuu
54bc05d72f Update documenation of PSA_ALG_RSA_PSS
Signed-off-by: Tuvshinzaya Erdenekhuu <tuvshinzaya.erdenekhuu@arm.com>
2022-12-06 18:22:43 +00:00
David Horstmann
5d094d35ad Add ChangeLog entry for code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 17:02:35 +00:00
David Horstmann
d2c83bedb5 Disable code style correction in check_config.h
Code style correction currently messes up check_names.py

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 17:02:35 +00:00
David Horstmann
20d6bfa8e7 Add script to run Uncrustify
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 17:02:35 +00:00
David Horstmann
b95fa6be47 Add configuration file for Uncrustify
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 17:02:35 +00:00
Dave Rodgman
a03396a9df Fix additional mis-spellings
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-12-06 16:30:38 +00:00
David Horstmann
04f25fc3fe Tell cmake to get SKIP_TEST_SUITES from ENV
If the variable SKIP_TEST_SUITES is not defined with -D, but is defined
in an environment variable, tell cmake to get it from there.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-06 15:10:36 +00:00
Dave Rodgman
0f1bdea5f1
Merge pull request #6718 from tom-cosgrove-arm/fix-typos-2212-2.28
Backport 2.28: Fix typos prior to release
2022-12-06 15:00:31 +00:00
Dave Rodgman
9d7b8eac28 Fix spelling of test dependency
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-12-06 14:47:46 +00:00
Dave Rodgman
f656e1dc2b
Merge pull request #6730 from gilles-peskine-arm/changelog-20221129-pre-2.28.2
Backport 2.28: Changelog improvements for 3.3
2022-12-06 13:37:36 +00:00
Gilles Peskine
a3e8dd4054 Improve wording, punctuation, etc.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-06 10:52:32 +01:00
Dave Rodgman
2d28747f25
Merge pull request #977 from Mbed-TLS/merge-2.28
Merge 2.28 into 2.28-restricted
2022-12-05 16:21:37 +00:00
Tom Cosgrove
e87c335272 Fix another typo where 'PSK' was 'PKS'
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-12-05 12:08:26 +00:00
Dave Rodgman
f0090d85e5 Merge remote-tracking branch 'origin/mbedtls-2.28' into merge-2.28 2022-12-05 11:04:05 +00:00
Tom Cosgrove
c1b9842da5 Don't change typos in debug messages used by ssl-opt.sh
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-12-05 08:29:36 +00:00
Tom Cosgrove
49f99bc3db Fix typos prior to release
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-12-04 16:44:21 +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
Gilles Peskine
13e7307892 Create a separate test suite for constant-time functions
This is the first step in arranging that functions from constant_time.c are
tested in test_suite_constant_time.function.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-01 19:49:36 +01:00
Gilles Peskine
3daa98ed95 Move constant-time HMAC testing to its own suite
These are very CPU-intensive, so make it easy to skip them. And conversely,
make it easy to run them without the growing body of SSL tests.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-01 19:49:36 +01:00
David Horstmann
bcc535cf31 Linewrap for the benefit of Uncrustify
The last line of programs/psa/key_ladder_demo.c is of the following
form:

 #endif /* Very long comment ... */

Uncrustify tries to reduce the length:

 #endif \
     /* Very long comment ... */

and causes a compiler error as there is a continuation line with no
actual code in it. Work around this by linewrapping the comment
in advance.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-01 15:53:39 +00:00
Gilles Peskine
aec4bec53a Preserve line breaks from continued line comments
The commit "Preserve line breaks in comments before test functions"
only handled block comments. This commit handles line comments.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-30 16:39:55 +01:00
Gilles Peskine
3917028ab7
Merge pull request #6695 from tom-cosgrove-arm/fix-name-of-basic-build-test.sh-2.28
Backport 2.28: Fix name of basic build test.sh 2.28
2022-11-30 16:20:04 +01:00
Gilles Peskine
b7dcc93f0e programs/fuzz: set sensible default CFLAGS
Running make from programs/fuzz didn't set any optimization flags (running
make from programs or from the root inherited the parent's optimization
flags). Default to -O2.

There were no -W flags. Default to -Wall -Wextra, but not -Werror in line
with the other makefiles.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-30 12:48:59 +01:00
Tom Cosgrove
5f49b3cbe5 Fix the name of basic-build-test.sh within the file
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2022-11-30 11:18:35 +00: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
Gilles Peskine
07995fdd2f Preserve line breaks in comments before test functions
This way line numbers match better in error messages.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 22:03:32 +01:00
Gilles Peskine
7e8d4b6aff Explain space preservation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:53:31 +01:00
Gilles Peskine
43febf2890 Typos in comments
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:53:31 +01:00
Gilles Peskine
8ee3a65f14 Add test cases for comment nesting
Add a test case that would fail if all line comments were parsed before
block comments, and a test case that would fail if all block comments were
parsed before line comments.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:53:31 +01:00
Gilles Peskine
e54f63e4f3 Fix intended backslash in test data
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:53:31 +01:00
Gilles Peskine
d3ad55e496 Allow comments in prototypes of unit test functions
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:53:31 +01:00
Gilles Peskine
4711731455 Fix typo and copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:46:50 +01:00
Gilles Peskine
9e509fc316 Add target to generated all .c (and .datax) files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:46:50 +01:00
Gilles Peskine
5f0057d861 Remove some Python 2 compatibility code
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-29 21:46:50 +01:00
Gilles Peskine
fa05a2516d
Merge pull request #6664 from davidhorstmann-arm/2.28-fix-typo-unsupported
[Backport 2.28] Fix typo 'unsupoported' -> 'unsupported'
2022-11-29 21:44:31 +01:00
Dave Rodgman
ed179db976
Merge pull request #6657 from gilles-peskine-arm/psa-ecb-null-0-2.28
Backport 2.28: Fix NULL+0 undefined behavior in PSA crypto ECB
2022-11-25 17:07:36 +00:00
David Horstmann
f3fee1299e Fix typo 'unsupoported' -> 'unsupported'
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-11-25 15:54:07 +00:00
Gilles Peskine
a1d41c0a75 You can't have colon-space in unquoted YAML (plain scalars)
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-25 13:57:34 +01:00
Gilles Peskine
ff97f336e3 Explain why p + n isn't good enough
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-25 13:35:51 +01:00
Gilles Peskine
d551413027 Remove now-redundant definitions of inline
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-25 13:27:34 +01:00
Gilles Peskine
53740c8473 Travis: exclude test cases that are failing mysteriously
The test cases using tcp_client.pl are failing only on Travis's bionic and
focal systems (I can't reproduce the failure locally). Exclude them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-25 11:33:11 +01:00
Manuel Pégourié-Gonnard
7f15da6b2b
Merge pull request #6654 from ronald-cron-arm/compat-fix
2.28 compat.sh: Restore testing against OpenSSL for pre 1.2 TLS versions
2022-11-25 09:45:55 +01:00
Gilles Peskine
35e58d8e2a Update the Travis "full" build to use modern Clang
Don't use an all.sh component because there isn't one that does what we
want (modern Clang with ASan, and test everything).

* We need to set CC explicitly or tweak PATH, because clang in $PATH on
  Travis focal instances is Clang 7 which is too old (we want Clang 10).
* Travis lacks the array of versions of openssl and gnutls that we normally
  use for testing, so we need to exclude some tests (or build our
  own multiple versions of openssl and gnutls).

The SSL test exclusions are ad hoc and based on what currently works.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-11-24 23:42:56 +01:00
Ronald Cron
a7ba2b57af compat.sh: Restore testing against OpenSSL for pre 1.2 TLS versions
Restore compatibiltiy testing against OpenSSL for
(D)TLS versions smaller that 1.2.

. Fix the check for support in OpenSSL for these versions
. For test cases for (D)TLS version smaller than 1.2,
  restore the configuration of OpenSSL client/server
  with the given TLS version, as it was before #5660
  that broke it.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2022-11-24 22:43:15 +01:00