1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00
Commit Graph

17518 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
862e4a3f8d Add a bit of documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2022-12-13 18:44:14 +01:00
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
d1e13e0de7 Minor grammatical fix
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 10:36:02 +01:00
c9dcb4e83e Merge and reorder paragraphs for clarity
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-13 10:36:01 +01:00
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
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
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
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
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
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
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
4364fc94c1 Fix typo in library/entropy.c
Signed-off-by: Zachary Fleckenstein <ZachFleck42@Gmail.com>
2022-12-09 09:26:42 -05:00
d6f774f63f Fix ChangeLog
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-09 12:53:04 +00:00
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
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
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
3dc7f238e6 Document that ECP_RESTARTABLE depends on ECP_C
This is not new, it had always been the case, just not documented.

Pointed out by depends.py pkalgs (again, now that restartable is part of
full).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-12-09 10:24:52 +01:00
875d1eb2c9 Document all effects of MBEDTLS_ECP_RESTARTABLE
It might not be obvious that this option goes beyond adding new
functions, but also automagically modifies the behaviour of TLS
in some circumstances. Moreover, the exact modifications and
circumstances were not documented anywhere outside the ChangeLog.

Fix that.

While at it, adjust the test that checks no restartable behaviour with
other key exchanges, to use a key exchange that allows cert-based client
authentication so that we can check that this is not restartable either.

We don't have any automated test checking that the server is never
affected. That would require adding an ec_max_ops command-line option to
ssl_server2 that never has any effect, just to check that it indeed
doesn't. I'm not sure that's worth it. I tested manually and could
confirm that the server never has restartable behaviour, even for the
parts that are shared between client and server such as cert chain
verification.

Note (from re-reading the code): all restartable behaviour is controlled
by the flag ssl->handshake->ecrs_enabled which is only client-side with
the ECDHE-ECDSA key exchange (TLS 1.2).

Note: this commit is backported from development, which has more
dependency declarations in tests/ssl-opt.sh. While at it, add them to
the existing tests.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2022-12-09 10:24:52 +01:00
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
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
eead72ec9e Reindent line continuations for pylint
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
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
1f8b4d9c6b Add spaces around '+'
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
4f51601292 Remove legacy comments from config
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
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
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
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
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
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
99a669a50d Fix typo in code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
448cfec2a5 Use helper function for error printing
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
27b3704eef Miscellaneous improvements to code style script
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 17:47:10 +00:00
29cf15dfbc Improve CMake backward compatibility
Use code with clear behavior in CMake 2.8.12 (which we try to support in
Mbed TLS 2.28, although that's mostly for the sake of RHEL, not Windows).
The code in the previous commit relied on features introduced in CMake 3.x,
although it worked as desired by accident because `LIST_DIRECTORIES false`
was effectively ignored and `configure_file` on a directory had no
harmful effect.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2022-12-08 12:16:59 +01:00
7428c61df2 Bump LTS version to 2.28.2
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-08 11:05:11 +00:00
a26938aec6 Assemble ChangeLog
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2022-12-08 11:04:16 +00:00
dbefba7b5c Merge branch 'mbedtls-2.28-restricted' into mbedtls-2.28.2rc0-pr 2022-12-08 10:57:08 +00:00
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
b0423a260c Copy files instead of hard-linking on Windows
Fixes an issue on Windows where when source and build directory are on different drives hard-linking
to files or directory fails as it doesn't work across filesystem boundaries. Note that symlinking is also
not possible because it requires administrator privileges on Windows.

The solution copies the files using the built-in cmake `configure_file(src dest COPYONLY)` command.
As this command only operates on files, if a directory is specified the files will be globbed recursively
and through symlinks.

Signed-off-by: Dominik Gschwind <dominik.gschwind99@gmail.com>
2022-12-07 19:34:52 +01:00
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
3019ee631e Merge pull request #6739 from daverodgman/rsa-pss-doc-fix-2.28 2022-12-06 20:32:31 +00:00