17518 Commits

Author SHA1 Message Date
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
04aaa45ee1 Remove unnecessary '\' linebreak characters
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-25 11:39:45 +00:00
David Horstmann
659d905cf9 Give proper Dict type hints in crypto_knowledge.py
This prevents a return type error in a later function that uses the
dictionaries here properly typed.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 19:01:31 +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
David Horstmann
6956cb58ac Don't wrap stdout and stderr in UTF-8 wrapper
This is no longer needed as we only print ASCII text directly

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
5682e80266 Output diff without capturing it
Instead of capturing the output of diff and printing it, let diff do its
own outputting and se the return code to decide what to do.

This also means that the conversion of stdout to UTF-8 is not necessary,
as the reason it was needed was for printing diffs of files with UTF-8
characters in them.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
6d02f0cfa0 Add basic output on success
Whilst it is true that "silence is golden", no output at all could be
disconcerting and it makes searching in a CI log more difficult.

Add a simple status message that says "Checked N files, style ok".

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
3febe15114 Remove overly verbose output on success
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
64827e4611 Change print to print_err for an error message
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
71ccdaacd1 Remove unnecessary "Line length options" heading
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
a27d872228 Document that the script must be run from the root
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
David Horstmann
f7b7bf7a5e Remove provisional notice on code style script
Since code style is now enforced, the notice is wrong. Remove it to
avoid confusion.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-24 18:43:12 +00:00
Dave Rodgman
8431fe05f1
Merge pull request #6953 from daverodgman/getting-started-2.28
Backport 2.28 - Getting started
2023-01-24 10:25:45 +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
Dave Rodgman
385c81a2d3 Minor fixes
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-23 12:35:45 +00:00
Dave Rodgman
aefb5e1211 Fix some additional over-long lines
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-23 12:35:40 +00: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
2cf3c83bf1
Merge pull request #6951 from daverodgman/fix-rsaalt-test-guards-2.28 2023-01-20 18:29:01 +00:00
Yanray Wang
2a7b2a6a9d Redirect stdout/stderr to SRV_OUT
Under Ubuntu-22.04, wait command prints out Terminated message.
Therefore server process is handled with identical ways like other
processes in compat.sh. In addition, PROCESS_ID is renamed as
SRV_PID to improve code readability.

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-01-20 15:51:25 +01:00
Yanray Wang
d2ad200ff9 Remove Terminated message from stdout
Under Ubuntu-22.04, wait command prints out Terminated message
if the process has been killed by kill command. This messes up
the output in compat.sh

Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-01-20 15:51:23 +01:00
Dave Rodgman
5fce4f6a45 Add regression test
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 13:24:01 +00:00
Dave Rodgman
339730091a Update the getting-started doc
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 12:48:35 +00:00
Dave Rodgman
6b8d42444d Add Changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 11:43:01 +00:00
Dave Rodgman
bd2b8e4e6a Fix test guards
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-01-20 11:42:54 +00:00
Andrzej Kurek
15a3f1d0b8 Add missing key exchange requirements to test_suite_ssl
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-19 17:12:38 -05:00
Andrzej Kurek
cbb34b9e22 Add missing KEX DHE-RSA requirement for one ssl test
This specific cipher is used to test record splitting.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-19 15:19:52 -05:00
Andrzej Kurek
eeb8624f2d Add missing RSA-type dependencies in test_suite_ssl
These are not run in development because of the overlapping
!TLS_1_3 requirement and usage of full config.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-19 15:18:35 -05:00
Andrzej Kurek
01bdab3e30 Add missing key exchange requirements to test_suite_ssl
Some of the tests use mbedtls_test_cli_key_rsa_der and
mbedtls_test_cli_crt_rsa_der, and these can be used with
specific ciphersuites.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-19 15:18:00 -05:00
Gilles Peskine
1d671c90db
Merge pull request #6835 from gilles-peskine-arm/code-style-files-2.28
Backport 2.28: code_style.py: Support restyling only the specified files
2023-01-19 12:26:07 +01:00
Gilles Peskine
b71d28b695 Fix example command
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-17 18:09:39 +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
4136a9ec5a Shorten lines of changelog entry
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-17 06:09:37 -05:00
Andrzej Kurek
721cff1a89 Fix a copy-paste error in define comment
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-17 05:44:06 -05:00
Andrzej Kurek
b36fa910e9 Add a changelog entry
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-17 05:28:25 -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
Dave Rodgman
71d3ae09c1
Merge pull request #6936 from daverodgman/patch-1-2.28
Use `grep -E` instead of `egrep`
2023-01-16 15:21:37 +00: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
Dave Rodgman
4afd4b9be5
Merge pull request #6928 from tom-cosgrove-arm/allow-more-than-255-errors-in-compat-and-all-sh-2.28 2023-01-14 11:19:08 +00:00
Andrzej Kurek
cf4e9999bc Enable the timing.c selftest with MBEDTLS_TIMING_ALT
This caused trouble for users that were using the selftest feature
along with an alternative implementation. They were forced to 
provide their own version of a selftest. Since it was not mentioned
in the define description, it should not be required, and is provided
roughly as it was before breaking changes in 77daaad198 were
introduced.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
2023-01-13 19:01:51 -05:00
Tom Cosgrove
c1ae9f95bf Have compat.sh and ssl-opt.sh not return success for > 255 errors
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-01-13 12:14:43 +00:00
Valerio Setti
8cf549d047 changelog: document the enforced check on x509 serial setting
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2023-01-13 08:41:15 +01:00
Valerio Setti
5b787142a9 test: x509: add function for testing long serials
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2023-01-13 08:40:26 +01:00
Valerio Setti
b37f6c1b95 x509write_crt: reject serial longer than X509_RFC5280_MAX_SERIAL_LEN
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2023-01-13 08:39:36 +01:00
Gilles Peskine
160df1d136
Merge pull request #6908 from Mbed-TLS/features/new-code-style/mbedtls-2.28
Switch to new code style: mbedtls-2.28
2023-01-11 19:26:59 +01: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
ec03b0431d Update generated files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-11 14:52:37 +01:00
Gilles Peskine
1b6c09a62e Switch to the new code style
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-11 14:52:35 +01:00
Gilles Peskine
480f683d15
Merge pull request #6906 from gilles-peskine-arm/code-style-casts-psa-headers-more-2.28
Backport 2.28: Remove redundant error code definitions
2023-01-11 14:40: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
dc633d9393 Remove redundant error code definitions
We're including psa/crypto_values.h, which defines the necessary error
codes. Remove redundant definitions, which hurt because they need to be
styled in exactly the same way (same presence/absence of spaces between
tokens).

This completes the fix of https://github.com/Mbed-TLS/mbedtls/issues/6875.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-01-11 11:33:11 +01:00