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

17342 Commits

Author SHA1 Message Date
Manuel Pégourié-Gonnard
6d08dba4f6 Fix test function derive_key_exercise()
mbedtls_test_psa_setup_key_derivation_wrap() returns 1 for success, 0
for error, so the test here was wrong.

This is just a hotfix in order to avoid a testing gap. Larger issues not
addressed here:

- I don't think we should just exit and mark the test as passed; if
we're not doing the actual testing this should be marked as SKIP.
- Returning 1 for success and 0 for failure is a violation of our
documented coding guidelines. We're also supposed to test with == 0 or
!= 0. Having consistent conventions is supposed to help avoid errors
like this.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2023-01-05 10:53:10 +01:00
Gilles Peskine
d1a96b6b99
Merge pull request #6869 from davidhorstmann-arm/2.28-workaround-uncrustify-asm-defines
[Backport 2.28] Workaround Uncrustify parsing of "asm"
2023-01-04 10:37:55 +01:00
David Horstmann
b6bf5f5533 Workaround Uncrustify parsing of "asm"
The following code:

 #ifndef asm
 #define asm __asm
 #endif

causes Uncrustify to stop correcting the rest of the file. This may be
due to parsing the "asm" keyword in the definition.

Work around this by wrapping the idiom in an *INDENT-OFF* comment
wherever it appears.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2023-01-03 11:27:18 +00:00
Gilles Peskine
a6ad7f4702
Merge pull request #6837 from gilles-peskine-arm/code-style-more-kr-20221222-2.28
Backport 2.28: Tweak code style to be more like K&R
2022-12-23 18:23:24 +01:00
Gilles Peskine
68968f4d66 Require a space after a cast
Align with K&R2.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-22 23:29:42 +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
Dave Rodgman
97a85fe110
Merge pull request #6827 from daverodgman/mbedtls-2.28
Backport 2.28 - fix gettimeofday overflow
2022-12-20 16:01:34 +00:00
Dave Rodgman
e5c5b1d3ea Add Changelog entry
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-12-20 13:21:19 +00:00
Dave Rodgman
b03c55892a Fix overflow in mbedtls_timing_hardclock()
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2022-12-20 13:20:01 +00: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
Manuel Pégourié-Gonnard
910222bc1b
Merge pull request #6822 from mpg/basic-build-test-lcov-format-robustness-2.28
[Backport 2.28] Fix code_coverage broken by extra echo in make lcov
2022-12-19 13:03:40 +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
Gilles Peskine
cdae0d3752
Merge pull request #6811 from davidhorstmann-arm/2.28-fix-check-names-enum-regex
[Backport 2.28] Fix an incorrect regex in check_names.py
2022-12-17 01:52:29 +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
adc07aa708
Merge pull request #6696 from gilles-peskine-arm/fuzz-cflags-2.28
Backport 2.28: programs/fuzz: set sensible default CFLAGS
2022-12-15 19:47:28 +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
Manuel Pégourié-Gonnard
4a9fa30211
Merge pull request #6782 from gilles-peskine-arm/lcov-script-2.28
Backport 2.28: lcov script
2022-12-15 12:29:30 +01:00
Manuel Pégourié-Gonnard
df310768c8 Fix missing dependency declaration in test
muladd() (restartable or not) is only available when at least one short
weirstrass curve is enabled.

Found by depends.py curves in development.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-12-15 10:29:09 +01:00
Dave Rodgman
4547eae341
Merge pull request #984 from Mbed-TLS/mbedtls-2.28.2-merge-back
Mbedtls 2.28.2 merge back
2022-12-14 17:51:58 +00:00
Manuel Pégourié-Gonnard
a0a903fa3c
Merge pull request #6775 from gilles-peskine-arm/document-deprecation-process-2.28
Backport 2.28: Document deprecation process 2.28
2022-12-14 10:57:06 +01:00
Manuel Pégourié-Gonnard
8605571767
Merge pull request #6783 from davidhorstmann-arm/move-mbedtls-deprecated-prefix
2.28 only: Move `MBEDTLS_DEPRECATED` annotation to prefix
2022-12-14 10:09:05 +01:00
David Horstmann
9c021229bf Move MBEDTLS_DEPRECATED annotation to prefix
Refactor the MBEDTLS_DEPRECATED macro to be in front of the function
name rather than on its own line after the function arguments.

If it is placed on its own line, Uncrustify moves it to the start of
the line which causes check_names.py to think it is an identifier.
As a result check_names.py doesn't treat it as a macro name and it
gets detected as a typo.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 17:56:12 +00:00
Gilles Peskine
eaac1afcf1 Remove obsolete target covtest
This target dates back from before basic-build-test.sh existed. Refer to
that script instead.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
141b551df6 No need for -g or -O in LDFLAGS
Fix a mistake in the previous commit.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
bb3d31659b You need --coverage when linking as well
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
26aae47042 Add option to reset the traces, to use after rework
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
f11c33c27c Put temporary files in a temporary directory
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
b0f11f1429 Fix "make lcov" in CMake out-of-tree builds
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
a5bff8f17e Call the new lcov script from CMake builds
The code in CMakeLists.txt was an old copy of the code in Makefile. This
brings in branch coverage, which had only been added to Makefile.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
862e4a3f8d Add a bit of documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
Gilles Peskine
7f4705d8d4 Move lcov commands to a separate script
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
David Horstmann
d1e13e0de7 Minor grammatical fix
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 10:36:02 +01:00
David Horstmann
c9dcb4e83e Merge and reorder paragraphs for clarity
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 10:36:01 +01:00
David Horstmann
bbe8f66bb4 Reword the documentation for deprecation
Change the wording of the section of CONTRIBUTING.md on function
deprecation to make it easier to understand.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 10:36:00 +01:00
Manuel Pégourié-Gonnard
97ead79cd7
Merge pull request #6204 from wernerlewis/ecp_group_test_2.28
[Backport 2.28] Add test for ECP group metadata
2022-12-13 09:29:40 +01:00
Manuel Pégourié-Gonnard
1d1baa7fc3
Merge pull request #6586 from lpy4105/2.28-check-psa-name-typo
Backport 2.28: check_names: extend typo check to PSA macro/enum names
2022-12-13 09:24:56 +01:00
Dave Rodgman
a5edd2b553
Merge pull request #6762 from ZachFleck42/2.28-backport
Backport 2.28: Fix typo in `library/entropy.c`
2022-12-12 16:31:00 +00:00
Dave Rodgman
89f040a5c9
Merge pull request #978 from Mbed-TLS/mbedtls-2.28.2rc0-pr
Mbedtls 2.28.2rc0 pr [DO NOT MERGE]
v2.28.2 mbedtls-2.28.2
2022-12-12 15:17:36 +00:00
Manuel Pégourié-Gonnard
08f7f0d1f6
Merge pull request #6744 from gilles-peskine-arm/windows-different-drives-build-error-2.28
Backport 2.28: Copy files instead of hard-linking on Windows
2022-12-12 11:59:06 +01:00
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
Zachary Fleckenstein
4364fc94c1 Fix typo in library/entropy.c
Signed-off-by: Zachary Fleckenstein <ZachFleck42@Gmail.com>
2022-12-09 09:26:42 -05:00
Aditya Deshpande
d6f774f63f Fix ChangeLog
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-09 12:53:04 +00:00
Manuel Pégourié-Gonnard
b884f7e3dc Clarify documentation of ECP_RESTARTABLE
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-12-09 12:07:06 +01:00
Aditya Deshpande
1aa138a9e5 Update BRANCHES.md so that it links to the LTS release tag on GitHub.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-09 10:41:46 +00:00
aditya-deshpande-arm
bf864160a9 Fix ChangeLog Formatting
Co-authored-by: Dave Rodgman <dave.rodgman@arm.com>

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-09 10:38:40 +00:00