1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-06-03 13:22:02 +03:00

17243 Commits

Author SHA1 Message Date
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
Gilles Peskine
9f54092a01 Avoid unstructured macro usage with code duplication
Instead of
```
 #if CONDITION
    for(XXX)
        for(YYY)
 #else
    for(XXX)
        for(YYY)
 #endif
            BODY
```
duplicate the BODY code. This isn't ideal, but we can live with it.

The compelling reason to restructure the code is that this entanglement
of C preprocessor syntax with C grammar syntax confuses uncrustify.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-08 21:50:34 +01:00
David Horstmann
eead72ec9e Reindent line continuations for pylint
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
c747fdfe1f Fixup: Config file name in code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
1f8b4d9c6b Add spaces around '+'
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
4f51601292 Remove legacy comments from config
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
9008128491 Improvements to the top of the code style config
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
6ec778f727 Rename Uncrustify configuration
Make it more obvious that this is an Uncrustify configuration file.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
c543870882 Explain that the script is only for the future
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
f47e657fe6 Remove ChangeLog entry, style is not yet official
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
3a6f9f9921 Use constant for supported Uncrustify version
Define and report the supported Uncrustify version (and remove extra
newlines from version output).

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
99a669a50d Fix typo in code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
448cfec2a5 Use helper function for error printing
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
David Horstmann
27b3704eef Miscellaneous improvements to code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00: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
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
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
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
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
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
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