1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-07 06:42:56 +03:00
Commit Graph

18895 Commits

Author SHA1 Message Date
Dave Rodgman
403ce0a6cc Bump version numbers
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-02 15:35:45 +01:00
Dave Rodgman
ccba2b7507 Assemble 2.28.4 changelog
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-02 14:47:25 +01:00
Dave Rodgman
973494d193 Clarify changelog not needed for compiler warnings
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-02 13:52:20 +01:00
Tom Cosgrove
c5f24c0128 Merge pull request #8001 from AgathiyanB/fix-control-bypass-2.28
Fix control bypass warnings
2023-08-02 07:45:22 +00:00
Bence Szépkúti
fb806b68ed Merge pull request #7969 from gowthamsk-arm/use_earliest_latest_compilers_2.28
Backport 2.28: Use earliest latest compilers 2.28
2023-08-01 23:50:14 +00:00
Agathiyan Bragadeesh
06d5e10989 Fix IAR warning about unnecessary type quantifier
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-08-01 14:23:01 +01:00
Gowtham Suresh Kumar
cc029afbd0 Update default variable values for compilers
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:48:32 +01:00
Gowtham Suresh Kumar
2afb24f96a Use variables for selecting compilers
The latest and earliest clang/GCC compilers are now used through
variables instead of symlinks and also the all.sh script is updated
to support options for overriding the default values.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:45:57 +01:00
Gowtham Suresh Kumar
13850f387b Use compgen to gather components in all.sh
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:40:01 +01:00
Gowtham Suresh Kumar
53453cf250 Remove test_clang_opt check
The component functions in all.sh will be listed using
compgen instead of sed so this check is not needed.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-08-01 09:39:56 +01:00
Tom Cosgrove
dcaa5ea4e5 Update CONTRIBUTING.md
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-08-01 08:41:45 +01:00
Marek Jansta
0a6743b2de Fixed AlgorithmIdentifier parameters when used with ECDSA signature algorithm in x509 certificate
Signed-off-by: Marek Jansta <jansta@2n.cz>
2023-07-31 17:33:23 +02:00
Marek Jansta
f5257c06d1 Cherry picked required prerequisites from dev branch, git hash 0167244b
Signed-off-by: Marek Jansta <jansta@2n.cz>
2023-07-31 17:33:16 +02:00
Agathiyan Bragadeesh
e7eb8052be Seperate declarations from function body
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-31 16:20:27 +01:00
Agathiyan Bragadeesh
5521b4ce37 Assign have_rng in declaration of ecp_mul_mxz
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-31 16:15:56 +01:00
Tom Cosgrove
e15b8d21d6 Merge pull request #8004 from daverodgman/code_style_since-2.28
backport 2.28 - Make code_style.py --since more precise
2023-07-28 08:22:04 +00:00
Dave Rodgman
dd7b24c3bf whitespace fix
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-07-27 20:01:04 +01:00
Dave Rodgman
e67ffd6d20 pylint tidy-up
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:50:50 +01:00
Dave Rodgman
73b87e39d6 Make code_style.py -s default to -s=mbedtls-2.28
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:52 +01:00
Dave Rodgman
b96dbc6486 Make code_style.py -s more precise
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-07-27 18:44:45 +01:00
Agathiyan Bragadeesh
7b0ee1e655 Fix control bypass warnings
Declarations have been moved to the top of functions to fix this

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-27 15:51:46 +01:00
Gilles Peskine
ae68c09a69 Merge pull request #7987 from gilles-peskine-arm/ssl_premaster_secret-empty-2.28
Backport 2.28: Fix empty union when TLS is disabled
2023-07-27 10:29:27 +02:00
Gowtham Suresh Kumar
34d8bd37d9 Fix warnings from clang-16
Running clang-16 on mbedtls reports warnings of type "-Wstrict-prototypes".
This patch fixes these warnings by adding void to functions with no
arguments. The generate_test_code.py is modified to insert void into test
functions with no arguments in *.function files.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-07-27 00:03:21 +01:00
Gowtham Suresh Kumar
1e3af2485f Update test scripts to use latest/earliest compilers
The Ubuntu 16.04 and 22.04 docker images have been updated with
earliest and latest versions of gcc and clang respectively.
This patch adds the necessary component and support functions
required for the CI to run these compilers.

For FreeBSD we invoke the function by name so a condition is added
to disable the existing test_clang_opt function for linux.

Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2023-07-26 16:55:39 +01:00
Gilles Peskine
e5507d5f20 Fix empty union when TLS is disabled
When all TLS 1.2 support is disabled, union mbedtls_ssl_premaster_secret was
empty, which is not valid C even if the union is never used. Fixes #6628.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-26 17:22:04 +02:00
Tom Cosgrove
f6ba9ce585 Have a single source of truth for licensing information
We had information in both README.md and CONTRIBUTING.md about Mbed TLS licensing,
but the information in CONTRIBUTING.md was missing that authors still need to
accept that their contributions may be distributed under both Apache 2.0 and
GPLv2-or-later.

Move all but the most high-level “Mbed TLS files are provided under the
Apache-2.0 license” statement to CONTRIBUTING.md, and tidy up the text a bit.

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-07-26 13:02:21 +01:00
Gilles Peskine
ba986f3725 PermissionIssueTracker is obsoleted by ShebangIssueTracker
ShebangIssueTracker implements the rule that scripts must be executable if
and only if they have a shebang line. By removing PermissionIssueTracker, we
now allow files with any extension to be executable (provided they have a
shebang line), and allow *.sh and *.pl to be non-executable modules if they
don't have a shebang line (as was already the case for *.py).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
f5a2ce056c Skip dlopen demo in static builds
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
7f2b98c162 Use demo_common.sh in dlopen test script
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
46c30b85e1 Pacify Pylint
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
f4ae0792fd Make --quiet a little less quiet
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
e1d4f9da23 Error out if run from the wrong directory
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
369f190b37 Add --quiet option to suppress demos' output
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
61ae791e72 Fix some mistakes in descriptive messages
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
e721827803 Minor readability improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
ec37a9bf55 Explain why $root_dir needs a complicated calculation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:36 +02:00
Gilles Peskine
b1ec5cdd00 Print only missing dependencies
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
d9b3209f51 cleanup is part of the external interface
Since there's no EXIT trap in plain sh, the main script must call it
explicitly when it exits.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
93aaf2e998 Run demo scripts in some builds
Run the sample program demo scripts in builds with a configuration
that is at least as complete as the default configuration.

Do not run sample programs in all configurations since they are
expected to fail if a required feature is missing.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
019416c3db Declare the dependencies of key_ladder_demo.sh
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
b63e79d6f7 Let demo scripts declare their dependencies
Demo scripts should declare their build-time dependencies, to make
them more user-friendly. If a dependency is not met, users should see
an explicit message rather than an incomprehensible error.

Don't rely on the dependencies of individual programs because some
demo scripts use multiple programs and because some scripts might have
additional requirements.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
1e18775882 Demo scripts: create a seedfile if the configuration requires it
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
d0a4dc887e Move common code of demo scripts into a library
The new file programs/demo_common.sh contains initialization code,
utility functions and cleanup code meant to be used by all demo
scripts written in sh.

Initial features:

* msg: Display a message.
* run, run_bad: Run a command, visibly.
* $root_dir, $programs_dir: location of the mbedtls source tree.
* $files_to_clean: files that are cleaned up on exit.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Gilles Peskine
2c8bbce36d Run demo scripts and check that they work
run_demos.py is the frontend to a framework for smoke-testing the
sample programs. It runs scripts called programs/*/*_demo.sh
("demo scripts") and check that they succeed. A typical demo script
runs one sample program or a combination of sample programs to
demonstrate their usage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-25 21:54:35 +02:00
Agathiyan Bragadeesh
1dd20a32e2 Remove trailing backslash
Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
2023-07-24 10:50:53 +01:00
Gilles Peskine
b98d39ce2a Merge pull request #7965 from gilles-peskine-arm/psa_inject_entropy-file-stability-2.28
Backport 2.28: Fix and test MBEDTLS_PSA_INJECT_ENTROPY
2023-07-21 17:37:19 +02:00
Gilles Peskine
27d8c21a87 Merge pull request #1039 from Mbed-TLS/mbedtls-2.28
Merge mbedtls-2.28 into mbedtls-2.28-restricted
2023-07-21 15:39:20 +02:00
Gilles Peskine
1fc71160b1 Add missing dependencies on real entropy
Tests that call mbedtls_test_ssl_endpoint_init() need mbedtls_entropy_func()
to work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 20:04:27 +02:00
Gilles Peskine
24d0124868 Fix copypasta in function documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 18:11:22 +02:00
Gilles Peskine
581c6e12ce MBEDTLS_PSA_INJECT_ENTROPY: ignore seed file
The test framework leaves the seed file behind (like it does with the
corresponding file in the legacy API, namely seedfile), so ignore it.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2023-07-20 18:11:22 +02:00