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

18895 Commits

Author SHA1 Message Date
c61187f508 Don't set LD to a path with a typo for mingw
Our makefiles don't use $(LD) so the typo was harmless.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 15:09:02 +02:00
17d2fb8521 Merge pull request #9529 from jaimeMF/backport-gcc-14-calloc-fix
[Backport 2.28] tests: fix calloc() argument list (gcc-14 fix)
2024-09-04 08:49:04 +00:00
990a88cd53 tests: fix calloc() argument list (gcc-14 fix)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `mbedtls`:

    In file included from /build/mbedtls/tests/include/test/ssl_helpers.h:19,
                     from /build/mbedtls/tests/src/test_helpers/ssl_helpers.c:11:
    /build/mbedtls/tests/src/test_helpers/ssl_helpers.c: In function 'mbedtls_test_init_handshake_options':
    /build/mbedtls/tests/include/test/macros.h:128:46:
      error: 'calloc' sizes specified with 'sizeof' in the earlier argument
        and not in the later argument [-Werror=calloc-transposed-args]
      128 |             (pointer) = mbedtls_calloc(sizeof(*(pointer)),  \
          |                                              ^

Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
2024-09-02 22:09:13 +02:00
42c82aefed Merge pull request #1287 from Mbed-TLS/mbedtls-2.28.9_mergeback
Mbedtls 2.28.9 mergeback
2024-08-30 13:38:32 +01:00
5e146adef6 Merge pull request #1284 from mpg/mbedtls-2.28.9rc0-pr
Mbedtls 2.28.9rc0 pr DO NOT MERGE
v2.28.9 mbedtls-2.28.9
2024-08-29 15:24:32 +01:00
c45a5e881d Add CVE ID to the ChangeLog
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-29 10:02:39 +02:00
2cb0cc26a4 Update BRANCHES.md
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:49:28 +02:00
c0743dd5c6 Assemble ChangeLog
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:48:10 +02:00
9f7cc4c14f Bump version to 2.28.9
Soversions unchanged.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:44:41 +02:00
18e5f888f0 Merge pull request #1283 from gilles-peskine-arm/merge-2.28-restricted-20240823
Merge 2.28 into -restricted
2024-08-26 12:07:17 +02:00
69555ea884 Merge remote-tracking branch 'mbedtls-2.28' into mbedtls-2.28-restricted 2024-08-23 11:15:46 +02:00
d1d27337bb Merge pull request #1280 from gilles-peskine-arm/memory_allocation_cleanup_psa_crypto_rsa-changelog-2.28
Backport 2.28: Changelog entry for the RSA memory leak
2024-08-22 15:45:11 +01:00
578f66e5f0 Changelog entry for the RSA memory leak
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-22 13:01:29 +02:00
7c5160c491 Merge pull request #1273 from gowthamsk-arm/mem-alloc-cleanup-2.28
Backport 2.28: Fix: Memory allocation cleanup in internal crypto api functions
2024-08-19 15:50:30 +01:00
d9e16c4870 Free allocated memory where methods were returning without freeing
Signed-off-by: Sam Berry <sam.berry@arm.com>
Signed-off-by: Gowtham Suresh Kumar <gowtham.sureshkumar@arm.com>
2024-08-19 13:22:35 +01:00
36548eefa4 Merge pull request #9256 from gilles-peskine-arm/psa-keystore-dynamic-backport-2.28
Backport 2.28: prepare for dynamically sized key store
2024-08-09 08:00:01 +00:00
4c9d43fb18 Improve documentation in some tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:57 +02:00
d0ba2b0d1f Fix inverted assertion message
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:48 +02:00
b492272bab Merge pull request #1262 from mpg/merge-2.28
[2.28] merge public into 2.28-restricted
2024-08-08 12:25:12 +02:00
55aa72fe21 Merge remote-tracking branch 'public/mbedtls-2.28' into merge-2.28
* public/mbedtls-2.28: (88 commits)
  tests/ssl_helpers: Check that message queue is popped
  Upgrade python dependencies in requirements file
  Fix some typo for include folder
  Adjust TLS protocol cases for 2.28
  Fix copypasta
  Declare the new generated files
  Add generated config tests
  Remove some settings that don't exist in 2.28
  Adjust generate_config_tests.py for 2.28
  Terminology: use "dependencies" for a list of settings
  Terminology: consistently use "setting", not "option"
  Explain why we require TLS client and server simultaneously
  Fix missing negation
  Pacify mypy
  Detect sub-options
  Generate config test cases for single options
  Anchor relative paths
  New test suite to report configuration options
  Recognize that a double-inclusion guard is not a config setting
  Add and update some .gitignore files
  ...
2024-08-08 10:03:24 +02:00
3a51fdc8c6 Improve full-key-store tests
Split the "many transient keys" test function in two: one that expects to
successfully create many keys, and one that expects to fill the key store.
This will make things easier when we add a dynamic key store where filling
the key store is not practical unless artificially limited.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
70de13d920 Improve the documentation of MBEDTLS_PSA_KEY_SLOT_COUNT
The description was misleading: setting the option doesn't “restrict” the
number of slots, that restriction exists anyway. Setting the option merely
determines the value of the limit.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
18f659b1e7 Assert that the key ID range for volatile keys is large enough
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
f16263e286 Assert that key ID ranges don't overlap
Ensure that a key ID can't be in range for more than one of volatile keys,
persistent (i.e. user-chosen) keys or built-in keys.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
91773db331 Add a test for the built-in key range
Restricting the built-in key range would be an API break since applications
can hard-code a built-in key value and expect that it won't clash with
anything else. Make it harder to accidentally break the API.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
37a4fcc5b4 Prevent mbedtls_psa_register_se_key with volatile keys
mbedtls_psa_register_se_key() is not usable with volatile keys, since there
is no way to return the implementation-chosen key identifier which would be
needed to use the key. Document this limitation. Reject an attempt to create
such an unusable key. Fixes #9253.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
f555a4e26f MBEDTLS_STATIC_ASSERT: make it work outside of a function
At the top level, the macro would have had to be used without a following
semicolon (except with permissive compilers that accept spurious semicolons
outside of a function), which is confusing to humans and indenters. Fix
that.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-07 11:17:32 +02:00
6c3ad6aa36 Merge pull request #9440 from sezrab/mbedtls_test_ssl_message_queue_pop_info-2.28
[Backport 2.28] tests/ssl_helpers: Check that message queue is popped
2024-08-01 18:38:38 +00:00
a526528de3 tests/ssl_helpers: Check that message queue is popped
mbedtls_test_mock_tcp_recv_msg is currently popping a message
queue and does not check if this was done correctly.

This extra check makes the test more complete/robust.

Signed-off-by: Tomás González <tomasagustin.gonzalezorlando@arm.com>
2024-07-31 17:25:40 +01:00
ea178ddd20 Merge pull request #1258 from gilles-peskine-arm/psa-drbg-no-hmac-document-2.28
Backport 2.28: Document that MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does not force HMAC
2024-07-31 16:47:29 +02:00
e752eaf73a Force MBEDTLS_PSA_HMAC_DRBG_MD_TYPE based on CTR_DRBG
If MBEDTLS_CTR_DRBG_C is enabled, force MBEDTLS_PSA_HMAC_DRBG_MD_TYPE to be
disabled. This resolves the former inconsistency in builds where
MBEDTLS_PSA_HMAC_DRBG_MD_TYPE is explicitly defined but MBEDTLS_CTR_DRBG_C
remains enabled, where PSA called the CTR_DRBG functions but other parts of
the code based assumed that HMAC was in use, in particular error code
conversions (leading to a test failure in test_suite_psa_crypto_init).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-07-25 18:30:51 +02:00
6b32ac74e7 Document that MBEDTLS_PSA_HMAC_DRBG_MD_TYPE does not force HMAC
MBEDTLS_PSA_HMAC_DRBG_MD_TYPE was documented and announced as causing the
PSA DRBG to be HMAC_DRBG. However, that was never actually implemented:
CTR_DRBG is prioritized if enabled.

Since there is a simple workaround of disabling MBEDTLS_CTR_DRBG_C if you
want to use HMAC_DRBG, we have decided to accept the actual behavior and fix
the documentation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-07-25 18:25:30 +02:00
9aa9120b9a Merge pull request #9387 from eleuzi01/backport-9287-2.28
[Backport 2.28] Fix some typo for include folder
2024-07-17 13:11:22 +00:00
b4167a33fc Merge pull request #9399 from davidhorstmann-arm/upgrade-python-dependencies-2.28
[Backport 2.28] Upgrade python dependencies in requirements file
2024-07-15 17:15:51 +00:00
0c3c39e38e Upgrade python dependencies in requirements file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-07-15 16:39:31 +01:00
20e964f1c6 Fix some typo for include folder
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2024-07-12 11:43:33 +03:00
ff2c049eaf Merge pull request #9270 from sezrab/silence-2.28
[Backport 2.28] Silence gcc 12.2.0 warning
2024-07-04 14:49:34 +00:00
3218ccf6ba Merge pull request #9316 from gilles-peskine-arm/test_suite_config-booleans-2.28
Backport 2.28: Report configuration settings in the outcome file
2024-07-03 13:09:49 +00:00
a76a6ff8df Adjust TLS protocol cases for 2.28
TLS 1.3 is still experimental and partial, and SSL3 is obsolete, so we don't
expect much coverage about them, in particular we don't expect them to be
the sole supported version. TLS 1.0 and 1.1 exist and we expect good
coverage for them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-07-01 11:32:33 +02:00
93708fe126 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-28 19:16:25 +02:00
b19fa4e6c7 Declare the new generated files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:34 +02:00
d33c48b407 Add generated config tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:22 +02:00
cfba2477e6 Remove some settings that don't exist in 2.28
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:11:59 +02:00
744741bf2c Adjust generate_config_tests.py for 2.28
* Move to the correct location.
* Adjust the package name for auxiliary modules.
* Adjust the hack to import a module from scripts.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:05:10 +02:00
1afb70351e Terminology: use "dependencies" for a list of settings
"Super settings" were effectively the dependencies of a setting, so align on
that terminology.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:37 +02:00
5454a84772 Terminology: consistently use "setting", not "option"
The two were used interchangeably. Align on "setting", which is what
config.py uses in its documentation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:32 +02:00
f75c70bb81 Explain why we require TLS client and server simultaneously
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:27 +02:00
c08d5bfda7 Fix missing negation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:23 +02:00
556249e134 Pacify mypy
I had accidentally reused a variable name inside the same function. Python
copes but mypy doesn't.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:18 +02:00
c79ecea42b Detect sub-options
When option A is only meaningful if option B is enabled, when enumerating
single-option test cases, emit A:B and !A:B rather than A and !A. This way
the "!A" case is actually meaningful.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:11 +02:00