21793 Commits

Author SHA1 Message Date
Alexander Harkness
5962c69b26
Merge pull request #5 from cuberite/pr
Update To version 2.28
2024-11-07 20:02:59 +00:00
Alexander Harkness
e9488b6bd1
Merge pull request #6 from cuberite/pr-2
Update 2.28 PR to 2.28.9
2024-11-07 19:56:05 +00:00
Alexander Harkness
94e728a582 Merge commit '5e146adef63b326b04282252639bebc2730939c6' into pr-2 2024-11-05 18:28:49 +00:00
David Horstmann
5e146adef6
Merge pull request #1284 from mpg/mbedtls-2.28.9rc0-pr
Mbedtls 2.28.9rc0 pr DO NOT MERGE
2024-08-29 15:24:32 +01:00
Manuel Pégourié-Gonnard
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
Manuel Pégourié-Gonnard
2cb0cc26a4 Update BRANCHES.md
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:49:28 +02:00
Manuel Pégourié-Gonnard
c0743dd5c6 Assemble ChangeLog
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-26 12:48:10 +02:00
Manuel Pégourié-Gonnard
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
Manuel Pégourié-Gonnard
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
Gilles Peskine
69555ea884 Merge remote-tracking branch 'mbedtls-2.28' into mbedtls-2.28-restricted 2024-08-23 11:15:46 +02:00
David Horstmann
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
Gilles Peskine
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
Tom Cosgrove
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
Gowtham Suresh Kumar
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
Gilles Peskine
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
Gilles Peskine
4c9d43fb18 Improve documentation in some tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:57 +02:00
Gilles Peskine
d0ba2b0d1f Fix inverted assertion message
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-08 15:57:48 +02:00
Manuel Pégourié-Gonnard
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
Manuel Pégourié-Gonnard
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Bence Szépkúti
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
Tomás González
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Paul Elliott
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
Gilles Peskine
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
David Horstmann
0c3c39e38e Upgrade python dependencies in requirements file
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-07-15 16:39:31 +01:00
Wenxing Hou
20e964f1c6 Fix some typo for include folder
Signed-off-by: Wenxing Hou <wenxing.hou@intel.com>
2024-07-12 11:43:33 +03:00
Gilles Peskine
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
Ronald Cron
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
Gilles Peskine
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
Gilles Peskine
93708fe126 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-28 19:16:25 +02:00
Gilles Peskine
b19fa4e6c7 Declare the new generated files
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:34 +02:00
Gilles Peskine
d33c48b407 Add generated config tests
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:12:22 +02:00
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
c08d5bfda7 Fix missing negation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-06-26 20:03:23 +02:00
Gilles Peskine
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
Gilles Peskine
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
Gilles Peskine
693611e532 Generate config test cases for single options
Generate option-on and option-off cases for test_suite_config, for all
boolean options (MBEDTLS_xxx and PSA_WANT_xxx, collected from the mbedtls
and PSA config files).

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