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

2871 Commits

Author SHA1 Message Date
ba2376c580 Merge pull request #10275 from ariwo17/remove-des-core-before-crypto
Remove DES from Mbed TLS core (except references blocked by TF PSA Crypto)
2025-07-09 09:52:31 +00:00
86422e5509 Remove: DES selftest, component_test_psa_crypto_config_accel_des and dead DES mentions prior to TF-PSA-Crypto cleanup
Signed-off-by: Ari Weiler-Ofek <ariwei01@e134794.arm.com>
2025-07-07 11:29:50 +01:00
ed87da7ad7 Merge remote-tracking branch 'restricted/development-restricted' into future_rc
As set by process the tf-psa-crypto submodule is set
to point to tf-psa-crypto-release-sync input.
2025-06-27 10:50:33 +01:00
d1e4ccf0a0 cmake: Fix library order
A library that depends on another one should come first
in the list of libraries to link against.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-06-17 09:48:05 +02:00
a3b562aa17 programs: test: Let zeroize be an Mbed TLS test program
In TF-PSA-Crypto there is the crypto specific one.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-06-16 15:55:05 +02:00
0815c67ce1 programs: pkey: Use tf-psa-crypto/build_info.h
pkey programs are crypto programs (only linked to
the TF-PSA-Crypto library) thus use the TF-PSA-Crypto
build-time configuration info file
tf-psa-crypto/build_info.h instead of the Mbed TLS one.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2025-06-16 15:54:49 +02:00
a81d6dfb05 tests|programs: remove usage of mbedtls_ecp_set_max_ops()
PK restartable operations are now implemented using PSA interruptible
ones, so mbedtls_ecp_set_max_ops() can be removed in favor of
psa_interruptible_set_max_ops().

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-06-12 06:39:18 +02:00
cdd91da1af Merge pull request #10145 from gabor-mezei-arm/remove_sha3_config_option
Remove `MBEDTLS_SHA3_C` config option
2025-06-10 09:57:22 +00:00
4aa974f7c7 Remove MBEDTLS_SHA3_C config option
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2025-06-03 17:49:23 +02:00
a4ffc4e4c6 Merge remote-tracking branch 'public/development' into development-restricted
* public/development: (23 commits)
  tests: suite_x509parse: set PSA max operations in x509_verify_restart()
  library: debug: remove mbedtls_debug_printf_ecdh()
  library: debug: make mbedtls_debug_print_psa_ec() static
  Remove call to pk_decrypt() in ssl_server2
  Change hardcoded error values in ssl-opt to take in the PSA error alias
  Test with GCC 15 with sloppy union initialization
  Update crypto with the union initialization fixes
  Mark ssl_tls12_preset_suiteb_sig_algs const
  Mark ssl_tls12_preset_default_sig_algs const
  Use PSA macros for the `pkalgs` domain
  reverted compat-2.x.h removal from psa-transition.md
  Correct ChangeLog file extension
  Add ChangeLog
  remove compat-2.x.h
  Remove trace of secp224k1
  Update submodules
  Improve comments
  Allow gcc-15 to be in $PATH
  Enable drivers when testing with GCC 15
  GCC 15: Silence -Wunterminated-string-initialization
  ...
2025-05-28 12:41:28 +02:00
7f363dfe62 programs: ssl_client2: set max restartable op also in PSA
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-05-27 11:59:32 +02:00
6b8f517e4d Avoid a useless copy in cert_{req,write}
I'm just trying to have a shorter name to avoid repeating a long
expression. This is a job for a pointer, not copying a struct.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-21 11:53:59 +02:00
bb8c0aba74 Add comment on apparent type mismatch
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-21 11:53:59 +02:00
8de781d99d Remove redundant free loop
This version is incomplete. I failed to noticed it when adding a more
complete version, making the existing one redundant.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-21 11:53:59 +02:00
92a9bd345c Remove call to pk_decrypt() in ssl_server2
We no longer use decrypt TLS 1.2 (never did in 1.3) so we no longer need
this path. Further simplifications could probably be made (we currently
have an enum type with only one possible value...) but for now I'm
trying to keep changes minimal.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-20 12:04:26 +02:00
b095862722 Fix memory leak in cert_write & cert_req
That memory leak had been present ever since the san command-line
argument has been added.

Tested that the following invocation is now fully valgrind clean:

programs/x509/cert_write san=DN:C=NL,CN=#0000,CN=foo;DN:CN=#0000,O=foo,OU=bar,C=UK;IP:1.2.3.4;IP:4.3.2.1;URI:http\\://example.org/;URI:foo;DNS:foo.example.org;DNS:bar.example.org

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-12 12:34:11 +02:00
6b1147993c Fix runtime error in cert_write & cert_req
The runtime error was introduced two commits ago (while avoiding a
use-after-free). Now the programs run cleanly but still leak memory.

The memory leak is long pre-existing and larger than just DN components
(which are made temporarily slightly worse by this commit) and will be
fixed properly in the next commit.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2025-05-12 12:34:11 +02:00
06af417cea Disable warning from gcc -pedantic on dlsym/dlopen
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2025-05-07 17:15:37 +02:00
2439c4c14a Merge pull request #10090 from valeriosetti/issue9618-development
[development] MBEDTLS_PLATFORM_GET_ENTROPY_ALT in 4.0
2025-05-06 22:35:03 +02:00
5f6c6334f8 Merge pull request #10157 from diopoex/development
Remove use of mbedtls_md_get_name() from ssl_context_info.c
2025-04-30 07:00:01 +00:00
02c80e631f Fix test and formatting in ssl_context_info
Signed-off-by: Paul Höhn <paul.hoehn@icloud.com>
2025-04-29 22:02:24 +02:00
5a7a5305e8 removed trailing whitespace
Signed-off-by: Paul Höhn <paul.hoehn@icloud.com>
2025-04-29 18:53:07 +02:00
da95274730 ssl context fix for 4.0
Signed-off-by: Paul Höhn <paul.hoehn@icloud.com>
2025-04-29 18:53:07 +02:00
1971eab465 programs: test: add C++ specific commands to cpp_dummy_build
Add C++ specific instructions to the generated *.cpp source file so
that the build will fail in case a C compiler is used.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-04-29 11:01:46 +02:00
3775c9b48f programs: selftest: remove direct call to mbedtls_platform_entropy_poll()
The function is now internal so it cannot be referenced from programs.
A dummy alternative is used instead.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-04-29 11:01:46 +02:00
73bd210a94 tests: remove usage of MBEDTLS_NO_PLATFORM_ENTROPY
Use MBEDTLS_PLATFORM_GET_ENTROPY_ALT instead.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2025-04-29 11:01:46 +02:00
4695204872 remove mbedtls_nist_kw_self_test from selftests
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-04-29 07:43:37 +01:00
748e24d78e Merge pull request #10143 from diopoex/development
Removed use of mbedtls_cipher_info from ssl_context_info.c
2025-04-28 12:35:12 +00:00
ad6953f788 Merge pull request #10114 from felixc-arm/switch-to-which-aes
Switch all.sh components from selftest to which_aes
2025-04-28 06:58:38 +00:00
4156c49342 Merge pull request #10122 from felixc-arm/move-public-headers
Adjust build scripts to accommodate public header move
2025-04-24 17:47:17 +00:00
9949f00930 Add tf-psa-crypto/programs/test/which_aes to Makefile
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-04-22 10:35:52 +01:00
b12205ca7a Removed use of mbedtls_cipher_info from ssl_context_info.c
Signed-off-by: Paul Höhn <paul.hoehn@icloud.com>
2025-04-22 11:18:34 +02:00
232da48471 Merge pull request #9421 from mfil/feature/implement_tls_exporter
Implement TLS-Exporter
2025-04-17 14:47:13 +00:00
61bd2729b2 Check include/mbedtls exists before including from it
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-04-17 10:24:20 +01:00
e6605f9185 Adjust build scripts to accommodate public header move
Signed-off-by: Felix Conway <felix.conway@arm.com>
2025-04-08 14:26:29 +01:00
ed4a2b4f0a Merge branch 'development-restricted' into merge-from-restricted
* development-restricted:
  Add missing credit for set_hostname issue
  Add changelog entry for TLS 1.2 Finished fix
  TLS1.2: Check for failures in Finished calculation
  ssl_session_reset: preserve HOSTNAME_SET flag
  Document the need to call mbedtls_ssl_set_hostname
  Improve documentation of mbedtls_ssl_set_hostname
  Changelog entries for requiring mbedls_ssl_set_hostname() in TLS clients
  Add a note about calling mbedtls_ssl_set_hostname to mbedtls_ssl_setup
  mbedtls_ssl_set_hostname tests: add tests with CA callback
  Call mbedtls_ssl_set_hostname in the generic endpoint setup in unit tests
  Require calling mbedtls_ssl_set_hostname() for security
  Create error code for mbedtls_ssl_set_hostname not called
  Keep track of whether mbedtls_ssl_set_hostname() has been called
  Access ssl->hostname through abstractions in certificate verification
  mbedtls_ssl_set_hostname tests: baseline
  Add a flags field to mbedtls_ssl_context
  Automate MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK dependency
  Make guards more consistent between X.509-has-certs and SSL-has-certs
  Fix Doxygen markup
  Make ticket_alpn field private

 Conflicts:
	programs/ssl/ssl_test_common_source.c
2025-04-01 09:40:47 +02:00
22728dc5e3 Use mbedtls_calloc, not regular calloc
Also fix the allocation size.

Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +01:00
144cccecb7 Fix memory leak in example programs
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
2025-03-28 17:08:12 +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
dbe864569e Fix typos in comments
Signed-off-by: Max Fillinger <maximilian.fillinger@foxcrypto.com>
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
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
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
e57ea21a1c Merge pull request #10042 from bjwtaylor/remove-ssl-conf
Remove mbedtls_ssl_conf_rng()
2025-03-27 14:05:42 +00:00
b9f83b3d07 Remove srand from fuzz
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:34:03 +00:00
47111a1cb1 initial remove of mbedtls_ssl_conf_rng
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:32:10 +00:00
fc66d5876d Delete some sample programs
Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 13:24:14 +00:00
440cb2aac2 Remove RNG from x509 and PK
remove the f_rng and p_rng parameter from x509 and PK.

Signed-off-by: Ben Taylor <ben.taylor@linaro.org>
2025-03-26 08:17:38 +00:00