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

33531 Commits

Author SHA1 Message Date
cf007ca8bb Add more tests for keying material export
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:06:47 +01:00
a5b63c5e40 Mention MBEDTLS_SSL_KEYING_MATERIAL_EXPORT in change log
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
0747388254 Fix #endif comment
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
51bec543bb Enable MBEDTLS_SSL_KEYING_MATERIAL_EXPORT by default
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
2fe35f61bf Create MBEDTLS_SSL_KEYING_MATERIAL_EXPORT option
Add the option MBEDTLS_SSL_KEYING_MATERIAL_EXPORT to mbedtls_config.h
to control if the function mbedtls_ssl_export_keying_material() should
be available. By default, the option is disabled.

This is because the exporter for TLS 1.2 requires client_random and
server_random need to be stored after the handshake is complete.

Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:58 +01:00
281fb79116 Remove TLS 1.2 Exporter if we don't have randbytes
The TLS-Exporter in TLS 1.2 requires client_random and server_random.
Unless MBEDTLS_SSL_CONTEXT_SERIALIZATION is defined, these aren't stored
after the handshake is completed.

Therefore, mbedtls_ssl_export_keying_material() exists only if either
MBEDTLS_SSL_CONTEXT_SERIALIZATION is defined or MBEDTLS_SSL_PROTO_TLS1_2
is *not* defined.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
c9f2c9adba Revert "Store randbytes for TLS 1.2 TLS-Exporter"
This reverts commit cb01dd1333f8083af469e9a0c59f316f1eb0cfe3.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
dbe864569e Fix typos in comments
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
155cea0900 Use fewer magic numbers in TLS-Exporter functions
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
f2dda15ce8 Add label length argument to tls_prf_generic()
This way, it's not required that the label is null-terminated. This
allows us to avoid an allocation in
mbedtls_ssl_tls12_export_keying_material().

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
48150f5dc3 Store randbytes for TLS 1.2 TLS-Exporter
Previously, if MBEDTLS_SSL_CONTEXT_SERIALIZATION is not defined,
randbytes are not stored after the handshake is done, but they are
needed for TLS-Exporter in TLS 1.2.

This commit also saves randbytes if MBEDTLS_SSL_PROTO_TLS1_2 is defined.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:58 +01:00
e10c9849e2 Fix coding style
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:58 +01:00
29beade80f Fix build when one of TLS 1.2 or 1.3 is disabled
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:58 +01:00
7b72220d42 Fix coding style
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:58 +01:00
9073e041fc Fix TLS exporter changelog entry
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:58 +01:00
ae7d66a1d5 Fix doxygen comment parameter name
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:57 +01:00
5561994020 Fix typos in comment
Signed-off-by: Max Fillinger <max@max-fillinger.net>
2025-03-28 16:53:57 +01:00
9c9989fc6d Fix mismatches in function declarations
Missed some const keywords in function declarations.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
91cff4406b Fix key_len check in TLS-Exporter
The length of the generated key must fit into a uint16_t, so it must not
be larger than 0xffff.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
81dfc8830b Actually set exporter defaults in ssl_client2
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
334c367052 Simplify mbedtls_ssl_tls13_exporter
RFC 8446 made it look like we can't use Derive-Secret for the second
step, but actually, Transcript-Hash and Hash are the same thing, so we
can.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
c7986427d4 Add test for TLS-Exporter in TLS 1.3
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
136fe9e4be Fix commented out function declaration
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
b84cb4b049 Add changelog entry for TLS-Exporter feature
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
b2718e17e6 Add TLS-Exporter options to ssl_client2
Prints out the exported key on the command line for testing purposes.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
32ba7f4a17 Add TLS-Exporter options to ssl_server2
The program prints out the derived symmetric key for testing purposes.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
bd81c9d0f7 Implement TLS-Exporter feature
The TLS-Exporter is a function to derive shared symmetric keys for the
server and client from the secrets generated during the handshake.
It is defined in RFC 8446, Section 7.5 for TLS 1.3 and in RFC 5705 for
TLS 1.2.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 16:53:57 +01:00
3189752b2f Merge pull request #10073 from felixc-arm/remove-inject-entropy
[development] Remove MBEDTLS_PSA_INJECT_ENTROPY
2025-03-28 13:22:00 +00:00
1459e75d3d Update tf-psa-crypto pointer
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-03-28 10:36:00 +00:00
064f68ec85 Merge pull request #10032 from valeriosetti/psasim-doc-update
psasim: update README file
2025-03-28 09:11:13 +00:00
48426b12ef Add MBEDTLS_PSA_INJECT_ENTROPY back into config-split.md
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-03-28 09:01:32 +01:00
133f7aab2c Add MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES to ignore list for CI
With the removal of the component_test_psa_inject_entropy test,
MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES is no longer set in any tests, and so
the CI will complain unless it is added to the ignore list.

Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-03-28 09:01:32 +01:00
92efce2b84 [development] Remove code relating to MBEDTLS_PSA_INJECT_ENTROPY
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-03-28 09:01:05 +01:00
b430f8235c removed whitespace
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-28 07:47:50 +00:00
d1c2d254ca Add ChangeLog for rng removal
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-28 07:47:50 +00:00
e57ea21a1c Merge pull request #10042 from bjwtaylor/remove-ssl-conf
Remove mbedtls_ssl_conf_rng()
2025-03-27 14:05:42 +00:00
05a978752b Remove MBEDTLS_PK_RSA_ALT
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-27 09:53:46 +00:00
06bdb16719 Merge pull request #10000 from bjwtaylor/remove-sample-programs
Delete some sample programs
2025-03-27 09:47:10 +00:00
df9491fe16 Merge pull request #10093 from mpg/2.28-eol-dev
The LTS branch 2.28 is now EOL
2025-03-27 09:47:00 +00:00
7a84f0f3a9 removed rng parameters from struct mbedtls_ssl_config
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-27 09:34:21 +00:00
f19a08fb96 Merge pull request #10062 from ronald-cron-arm/check-generated-files
Companion PR of "Add check generated files and check code style test components"
#201-merge==#201-head thus not updating the TF-PSA-Crypto pointer to #201-merge
#10062-merge==#10062-head and the merge queue is empty thus merging directly, not through the merge queue.
2025-03-27 10:24:06 +01:00
b9d7b5f165 Update TF-PSA-Crypto pointer
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
4cd8fbbb2d Use TF_PSA_CRYPTO_ROOT_DIR
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
aa5c159e36 all.sh: check generated files: Use make_generated_files.py
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
99226e9b9b cmake: Generate test_keys.h and test_certs.h in the build tree
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
81a674eee8 Adapt to generate_config_tests.py changes
Adapt builds and check-generated-files.sh to the fact
that generate_config_tests.py does not generate
test_suite_config.psa_boolean.data in Mbed TLS 4.x
context anymore.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
a1e1c2ce3c Update framework pointer
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
ddbf729ef7 Add directory and list arguments to generate_visualc_files.pl
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-03-26 21:19:28 +01:00
6bf29fd417 Merge pull request #10050 from valeriosetti/issue8151-development
[development] Remove the dynamic SE interface in 4.0
2025-03-26 17:07:00 +00:00
82bac6e076 Merge pull request #1334 from davidhorstmann-arm/add-missing-credit
Add missing credit for `set_hostname` issue
2025-03-26 14:09:47 +00:00