6922 Commits

Author SHA1 Message Date
Thomas Daubney
9da1769237 Remove MBEDTLS_ECP_ALT and associated options
Also removed are all options of the form
MBEDTLS_ECP_XXX_ALT as well as
MBEDTLS_ECP_NO_FALLBACK.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-05 14:35:10 +01:00
Thomas Daubney
e647d8f77a Remove MBEDTLS_ECJPAKE_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-05 14:35:10 +01:00
Thomas Daubney
5edad7f89f Remove MBEDTLS_DHM_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-05 14:35:10 +01:00
Thomas Daubney
f47b66eca5 Remove MBEDTLS_RSA_ALT
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-07-05 14:35:10 +01:00
Elena Uziunaite
cf5e3dd9f0 Replace MBEDTLS_MD_CAN_SHA384 in md.h and ssl.h
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-07-03 10:20:48 +01:00
Ronald Cron
550a18d4d6 Move Mbed TLS crypto headers
Move all the header files (roughly the crypto
and platform ones) necessary to build the
crypto library to
tf-psa-crypto/drivers/builtin/include/mbedtls.

Exceptions:
. some configuration related files that will not
be necessary anymore when the work on the
configuration file(s) is completed.
. build_info.h as TF-PSA-Crypto will have its
own when we had its CMake build system.

For the time being all headers are kept public
but eventually all headers in
tf-psa-crypto/drivers/builtin/include/mbedtls
will be private and the ones that remain
public (e.g. lms.h, pk.h probably ...) will be
moved to tf-psa-crypto/include/tf-psa-crypto/.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-07-01 14:59:35 +02:00
Ronald Cron
f0481f562a
Merge pull request #9258 from tom-daubney-arm/drop_padlock_support
Drop support for VIA Padlock
2024-06-26 07:36:04 +00:00
Thomas Daubney
4e5d183d78 Correct pluralisation errors in comments
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-06-25 15:21:48 +01:00
Manuel Pégourié-Gonnard
82658eb90c
Merge pull request #9138 from valeriosetti/issue9126
Do not perform adjustments on legacy crypto from PSA, when MBEDTLS_PSA_CRYPTO_CLIENT && !MBEDTLS_PSA_CRYPTO_C
2024-06-24 07:30:32 +00:00
Thomas Daubney
0d915a90ea Remove final references to padlock
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-06-20 16:45:51 +01:00
Ronald Cron
de0d7e6cd0
Merge pull request #9247 from ronald-cron-arm/move-psa-headers
Move PSA headers to a new tf-psa-crypto directory
2024-06-18 18:48:24 +00:00
Valerio Setti
0c0e418d63 config_psa: do not update legacy symbols in client-only PSA build
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-14 16:44:12 +02:00
Thomas Daubney
62af02c063 Drop support for VIA Padlock
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-06-14 10:37:13 +01:00
Ronald Cron
2581d91fda Adapt libraries installation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-13 09:02:30 +02:00
Ronald Cron
d80134b56d Move PSA headers
Move PSA headers to tf-psa-crypto
directory.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-06-12 15:22:26 +02:00
Sam Berry
3504c88916 Fix incorrect array length in function prototype
Issue #9179 (MBEDTLS_SSL_CID_OUT_LEN_MAX changed to
MBEDTLS_SSL_CID_IN_LEN_MAX in library\ssl.h and library\ssl_tls.c)

Signed-off-by: Sam Berry <sam.berry@arm.com>
2024-06-11 14:46:31 +01:00
Tom Cosgrove
98ffc8e7c3
Merge pull request #9178 from valeriosetti/fix-psa-cmac
adjust_legacy_crypto: enable CIPHER_C when PSA CMAC is builtin
2024-06-03 15:35:32 +00:00
Valerio Setti
351efa0ece crypto.h: fix documentation for some functions
Some functions has input parameters which are erroneously
reported as "param[out]" in the documentation. This commit
fixes them.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-06-03 11:17:37 +02:00
Gilles Peskine
c8d45cd3fc Error on unexpectedly defined symbols
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Gilles Peskine
9df7806b37 Tweak wording
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Gilles Peskine
690fb5e0b0 Warn if mbedtls_config.h is included manually
Some projects using Mbed TLS have migrated their configuration
file (config.h -> mbedtls_config.h, or MBEDTLS_CONFIG_FILE) from Mbed TLS
2.x, and kept including check_config.h. This is unnecessary since Mbed TLS
3.0, and increasingly in 3.x it may report spurious errors because the
configuration adjustments have not been done yet.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Gilles Peskine
0b8ece6beb Error out if *adjust* headers are included manually
Some projects using Mbed TLS have migrated their configuration
file (config.h -> mbedtls_config.h, or MBEDTLS_CONFIG_FILE) from Mbed TLS
2.x, and kept including check_config.h. This is unnecessary since Mbed TLS
3.0, and increasingly in 3.x it may report spurious errors because the
configuration adjustments have not been done yet. This has led some
projects to include configuration adjustment headers manually, but only
partially or in the wrong order, which can result in silent inconsistencies.
Error out if this happens, with a message mentioning check_config.h since
that's the likely root cause.

```
perl -i -pe '$name = $ARGV; $name =~ s!include/!!; $name =~ s!_adjust_.*!_adjust_*.h!; $_ .= "\n#if !defined(MBEDTLS_CONFIG_FILES_READ)\n#error \"Do not include $name manually! This can lead to problems, \" \\\n    \"up to and including runtime errors such as buffer overflows. \" \\\n    \"If you're trying to fix a complaint from check_config.h, just remove it \" \\\n    \"from your configuration file: since Mbed TLS 3.0, it is included \" \\\n    \"automatically at the right time.\"\n#endif /* !MBEDTLS_CONFIG_FILES_READ */\n" if /^#define .*_H$/' include/*/*adjust*.h
```

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Gilles Peskine
d33eb55cce Macros to indicate the finalization level of the configuration
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Gilles Peskine
975e74cb1f Document check-config.h and *adjust*.h as internal headers
Including *adjust*.h directly is likely to cause them to be applied at the
wrong time, resulting in an invalid or unintended configuration.

Including check_config.h at the wrong time is likely to cause spurious
errors.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-05-29 09:44:20 +02:00
Valerio Setti
a37ea269a9 adjust_legacy_crypto: enable CIPHER_C when PSA CMAC is builtin
psa_crypto_mac.c uses mbedtls_cipher_xxx() functions to perform
CMAC operations. Therefore we need to enable CIPHER_C when
PSA CMAC is builtin.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-05-24 14:37:05 +02:00
Ronald Cron
b48c8704e6 Fix crypto_adjust_config_dependencies.h documentation
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-17 14:34:11 +02:00
Ronald Cron
c4c8bdf32e Fix PBKDF2_AES_CMAC_PRF_128 dependencies
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-17 14:34:06 +02:00
Ronald Cron
97f0ea7611 Fix the resolution of dependencies on HMAC
The Mbed TLS implementations of ALG_TLS12_PRF,
ALG_TLS12_PSK_TO_MS, ALG_HKDF, ALG_HKDF_EXTRACT,
ALG_HKDF_EXPAND and ALG_PBKDF2 rely on HMAC
operations through the driver interface. Thus
if one of these algorithms is enabled and not
accelerated, we need ALG_HMAC to be enabled
(PSA_WANT_ALG_HMAC and PSA_WANT_KEY_TYPE_HMAC
defined). As HMAC operations occur through
the driver interface, HMAC operations can be
accelerated even if the caller algorithm
is not.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-17 14:33:44 +02:00
Ronald Cron
a33a824d8a Resolve PBKDF2_AES_CMAC_PRF_128 dependencies
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-16 08:12:03 +02:00
Ronald Cron
b0c96f47e7 Resolve some HMAC dependencies automatically
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-05-16 08:12:03 +02:00
Valerio Setti
89f5af84af adjust_legacy_crypto: enable ASN1_[PARSE|WRITE]_C when RSA_C
RSA needs ASN1 functions to parse/write private and public keys,
but there is no guards in the code for that. So we need to enable
ASN1 support whenever RSA is enabled.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-18 18:47:34 +02:00
Manuel Pégourié-Gonnard
a4b773d3bb
Merge pull request #6955 from inorick/nofa_no_session_tickets
Guard ticket specific TLS 1.3 function with macro
2024-04-08 08:56:17 +00:00
Ronald Cron
fe15d90f72 tls13: Fix doc of mbedtls_ssl_session_set() - 2
Fix documentation of mbedtls_ssl_session_set()
regarding its dependency on MBEDTLS_SSL_SESSION_TICKETS
in TLS 1.3 case.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-04 15:52:34 +02:00
Bence Szépkúti
a376f84eb1
Merge pull request #8937 from valeriosetti/issue8712
Clarify the documentation of mbedtls_pk_setup_opaque
2024-04-04 13:40:57 +00:00
Ronald Cron
d85eeae740 tls13: Fix doc of mbedtls_ssl_session_set() - 1
It was eventually decided to not support multiple
tickets in TLS 1.3 ClientHello messages thus
removing the parts in mbedtls_ssl_session_set()
documentation that were anticipating that.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-04 15:39:20 +02:00
Ronald Cron
66a206c26c tls13: Fix doc of mbedtls_ssl_session_get() - 2
Fix documentation of mbedtls_ssl_session_get()
regarding its interaction with session
ticket enablement.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-04 15:34:22 +02:00
Ronald Cron
81bb589090 tls13: Fix doc of mbedtls_ssl_session_get() - 1
The API has eventually not been changed to
return multiple tickets through multiple
subsequent call to it.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-04 15:30:55 +02:00
Ronald Cron
9314df617b tls: Fix doc of mbedtls_ssl_session_save()
Fix documentation of mbedtls_ssl_session_save()
regarding its dependency on MBEDTLS_SSL_SESSION_TICKETS
in TLS 1.3 session case.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-04 14:07:50 +02:00
Valerio Setti
1c7f5dea8b pk: fix documentation of mbedtls_pk_setup_opaque()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-04-04 09:39:12 +02:00
Minos Galanakis
078f823843 Merge pull request #8990 from tom-cosgrove-arm:record-size-limit-support-is-now-released
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-26 12:32:00 +00:00
Tom Cosgrove
f02c6ef86d Fix typo in psa_key_production_parameters_t doc: 65535 should be 65537
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-03-26 12:25:07 +00:00
Tom Cosgrove
1b3b1743f5 Record size limit support is released, so remove warning about only for testing
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2024-03-26 12:23:49 +00:00
Valerio Setti
f9f63edbe4 pk: fix typos in description of mbedtls_pk_setup_opaque()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-25 09:38:05 +01:00
Valerio Setti
ac81e23c33 pk: add check_pair info to mbedtls_pk_setup_opaque() documentation
This also updates use-psa-crypto.md accordingly.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-22 14:36:41 +01:00
Minos Galanakis
4492dbd286 Version Bump for 3.6.0
./scripts/bump_version.sh --version 3.6.0 --so-crypto 16 --so-x509 7  --so-tls 21

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-22 11:46:25 +00:00
Valerio Setti
42a3954cd3 pk: fix description of mbedtls_pk_setup_opaque for sign_ext()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-21 16:55:24 +01:00
Valerio Setti
fc6b22c95c pk: fix indentation in description of mbedtls_pk_setup_opaque()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-21 16:55:24 +01:00
Valerio Setti
80cd479fe0 pk: fix description of mbedtls_pk_setup_opaque()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-21 16:55:24 +01:00
Valerio Setti
18702d980f pk: update documentation of mbedtls_pk_setup_opaque() based on #8951
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-21 16:55:24 +01:00
Valerio Setti
55ed91e0aa pk: fix documentation for mbedtls_pk_setup_opaque()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-21 16:55:24 +01:00