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

1425 Commits

Author SHA1 Message Date
Pengyu Lv
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
Pengyu Lv
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
Dave Rodgman
40d79cef35
Merge pull request #7199 from daverodgman/armclang-sha-warning-2.28
Backport 2.28: enable -Werror for armclang
2023-03-03 09:01:50 +00:00
Dave Rodgman
6cda3d3b5b Enable -Werror for armclang
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-03-02 15:34:42 +00:00
Andrzej Kurek
b790c935e6 depends.py: remove symbols that are not present in 2.28
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 15:19:37 -05:00
Andrzej Kurek
3e7666b95d Improve tests/scripts/depends.py code
As suggested by gilles-peskine-arm.

Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 05:43:54 -05:00
Andrzej Kurek
3ebe7d6260 Improve tests/scripts/depends.py code
As suggested by gilles-peskine-arm.

Co-authored-by: Gilles Peskine <gilles.peskine@arm.com>
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 05:43:47 -05:00
Andrzej Kurek
2432dc212e depends.py: improve expected argument type
Requested config option can be either boolean or a string.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 05:43:34 -05:00
Andrzej Kurek
2e1aeb129d depends.py: merge set/unset config option into one function
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 05:43:27 -05:00
Andrzej Kurek
cf39406196 Use config.py as a module in depends.py
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-02-15 05:42:02 -05:00
Gilles Peskine
da829035a2
Merge pull request #7053 from KloolK/typos-backport
[Backport 2.28] Fix typos
2023-02-10 15:07:03 +01:00
Gilles Peskine
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
Jan Bruckner
6d47550723 Fix typos
Signed-off-by: Jan Bruckner <jan@janbruckner.de>
2023-02-07 07:27:49 +01:00
Dave Rodgman
b028531a3b
Merge pull request #7013 from gilles-peskine-arm/build-without-certs-2.28.2
2.28 only: Fix the build without MBEDTLS_CERTS_C
2023-02-06 11:39:01 +00:00
Pengyu Lv
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
Gilles Peskine
5619443bf1 Test without MBEDTLS_CERTS_C
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-02-01 18:47:58 +01:00
Aditya Deshpande
a9186f37a8 Allow whole Box Drawings range
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-02-01 13:31:57 +00:00
Aditya Deshpande
e76dc39641 Modify comments to make them more inclusive
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-30 13:52:03 +00:00
Aditya Deshpande
ed514d3218 Allow specific Box Drawing UTF characters that are used in Markdown trees in check_files.py
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-30 13:24:11 +00:00
Manuel Pégourié-Gonnard
54be0fafc6
Merge pull request #6968 from aditya-deshpande-arm/backport-check-names-exclusions
[Backport 2.28] check_names.py: Compare identifiers in excluded files against symbols parsed by nm
2023-01-30 09:22:09 +01:00
Aditya Deshpande
7d20bb4740 Re-add empty lines that were accidentally omitted in the previous commit.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-27 16:03:22 +00:00
Manuel Pégourié-Gonnard
27276fcb97
Merge pull request #6844 from gilles-peskine-arm/test_suite_psa_crypto_metadata-20221215-2.28
Backport 2.28: Add metadata tests for CCM* and TLS1.2-ECJPAKE-to-PMS
2023-01-27 10:05:04 +01:00
Gilles Peskine
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
Andrzej Kurek
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
Aditya Deshpande
94375c81f0 Update check_names.py so that identifiers in excluded files are still compared against the output of nm.
This fixes the issue where excluding a file containing identifiers from checks would cause check_symbols_in_header to fail.

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-01-25 17:10:23 +00:00
David Horstmann
4fc7e0ed62 Fix a missing type hint warning
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 19:01:31 +00:00
Manuel Pégourié-Gonnard
85f65f8f2f
Merge pull request #6944 from AndrzejKurek/2.28-depends-py-kex-fixes
[Backport 2.28] Depends.py - add exclusive domain tests to key exchange testing
2023-01-24 09:32:09 +01:00
Andrzej Kurek
ddf6260aae Remove obsolete comment from depends.py
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-23 06:19:14 -05:00
Dave Rodgman
5fce4f6a45 Add regression test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 13:24:01 +00:00
Andrzej Kurek
de416fc2c6 depends.py: enable key exchange tests
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-17 10:40:28 -05:00
Andrzej Kurek
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
Ville Skyttä
a74468155d Use grep -E instead of egrep
`egrep` has been deprecated in GNU grep since 2007,
and since 3.8 it emits obsolescence warnings:
https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-16 11:08:46 +00:00
Gilles Peskine
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
Gilles Peskine
f8d190d23f
Merge pull request #6901 from gilles-peskine-arm/check-files-unicode-2.28
Backport 2.28: Reject bad characters in source code
2023-01-11 13:47:08 +01:00
Gilles Peskine
b60b7a33c0 Reject invalid UTF-8 and weird characters in text files
Reject "weird" characters in text files, especially control characters that
might be escape sequences or that might cause other text to appear garbled
(as in https://trojansource.codes/).

Also reject byte sequences that aren't valid UTF-8.

Accept only ASCII (except most control characters), letters, some non-ASCII
punctuation and some mathematical and technical symbols. This covers
everything that's currently present in Mbed TLS ( §áèéëñóöüłŽ–—’“”…≥).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Gilles Peskine
ff723d8649 Pass line number to issue_with_line
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Gilles Peskine
66548d1fa7 Treat more *.bin files as binary
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-10 22:13:27 +01:00
Manuel Pégourié-Gonnard
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
Gilles Peskine
1efe7fd988 Fix documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-24 11:41:58 +01:00
Gilles Peskine
4fa76bdc68 NotSupported is specifically about key types
Rename NotSupported to KeyTypeNotSupported, because it's only about testing
key management. For algorithms, not-supported is handled by OpFail.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-24 11:37:32 +01:00
Manuel Pégourié-Gonnard
8ee18d3787
Merge pull request #6798 from gilles-peskine-arm/check_test_cases-quiet_ci-2.28
Hide check_test_cases warnings on the CI
2022-12-21 09:42:59 +01:00
Manuel Pégourié-Gonnard
71e934f8d1
Merge pull request #6821 from gilles-peskine-arm/code-style-skip-generated-files-2.28
Backport 2.28: Don't touch the style of generated files
2022-12-19 13:06:29 +01:00
Gilles Peskine
38a49560de Simplify the coverage statistics summary
The script was parsing the output from `make lcov` to extract numbers and
calculate percentages. But everything including the percentages is already
present in the output of `make lcov`, just with a slightly different
presentation. So replace all this by a simple extraction of the relevant
lines from the output of `make lcov`.

This is more robust than the previous code, which relied on `tail -n4` to
extract relevant lines, which broke when `make lcov` started to emit one
extra line at the end.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-19 10:17:10 +01:00
Gilles Peskine
4ca54d417e Don't touch the style of generated files
Ideally the result of the generator would conform to the code style, but
this would be difficult, especially with respect to the placement of line
breaks in long logical lines. So, to avoid surprises when checking the style
of generated files (which happens in releases and in long-time support
branches), systematically skip generated files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-19 00:58:25 +01:00
Gilles Peskine
2200f12094
Merge pull request #6807 from mpg/doc-docker-from-ci-2.28
[Backport 2.28] Point to docker images used in the CI
2022-12-17 01:54:27 +01:00
David Horstmann
e1e776caf7 Fix an incorrect regex in check_names.py
Allow check_names.py to detect declarations of the form:

enum some_enum_name {

This pattern has only just appeared due to code style correction, which
explains why the issue was not previously noticed.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-16 13:49:09 +00:00
Manuel Pégourié-Gonnard
7314798412 Point to docker images used in the CI
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-12-16 10:21:11 +01:00
Gilles Peskine
63c8be6075
Merge pull request #6753 from mpg/restartable-docfix-2.28
[Backport 2.28] Document ECP_RESTARTABLE
2022-12-15 19:47:47 +01:00
Gilles Peskine
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
Gilles Peskine
4b3806eb46
Merge pull request #6688 from gilles-peskine-arm/generate_test_code-function_comments-2.28
Backport 2.28: Allow comments in test function prototypes
2022-12-15 12:32:07 +01:00