32197 Commits

Author SHA1 Message Date
Gilles Peskine
4c58e89976
Merge pull request #9613 from gilles-peskine-arm/remove-rsa-psk-key-exchange
Remove RSA-PSK key exchange
2024-11-07 15:09:05 +00:00
Manuel Pégourié-Gonnard
e248de54bf
Merge pull request #9720 from mpg/all.sh-tf-psa-crypto-dev
All.sh add support for tf-psa-crypto components
2024-11-07 08:49:44 +00:00
Paul Elliott
fc140d0c6b
Merge pull request #9672 from gilles-peskine-arm/coverity-20241004
Fix edge cases of mbedtls_psa_raw_to_der and mbedtls_psa_der_to_raw
2024-11-06 19:03:13 +00:00
Gilles Peskine
b48d5263c5
Merge pull request #9758 from gilles-peskine-arm/move-test_suite_psa_crypto_ecp
Move new test suite to the tf-psa-crypto directory
2024-11-06 17:56:30 +00:00
Janos Follath
6eb9df7fc5
Merge pull request #9752 from gilles-peskine-arm/psa_init-20241104-dev
Fix MD_PSA_INIT called before initializing some data structures
2024-11-06 09:15:32 +00:00
Janos Follath
502ff7bcef
Merge pull request #9639 from waleed-elmelegy-arm/add-iop-key-gen-setup
Add PSA interruptible key generation setup & abort APIs
2024-11-06 09:10:42 +00:00
Bence Szépkúti
7618fbf293
Merge pull request #9724 from eleuzi01/issue-51-fw
Add a Python utility function to get the 3.6 feature macro
2024-11-05 17:27:02 +00:00
Gilles Peskine
ae5353bb62 Move new test suite to the tf-psa-crypto directory
It's a crypto test suite, but it was added in the main tree in a careless
forward port from 3.6.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 17:43:02 +01:00
Gilles Peskine
ff60a0bf4e Changelog entry for removal of the RSA-PSK key exchange
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
0068fceba3 Note the equivalence of two macros, thanks to RSA-PSK removal
Removing the now-duplicate internal macro is left for future work.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
fdf7db019b Remove support for RSA-PSK in compat.sh
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
91e7ebebfe Remove RSA_PSK suites from cipher suite lists
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
b3ec125580 Remove mentions of RSA-PSK key exchange from documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
712e9a1c3e Remove MBEDTLS_KEY_EXCHANGE_RSA_PSK
Remove mentions of MBEDTLS_KEY_EXCHANGE_RSA_PSK that were not guarded by the
configuration option MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED. This finishes the
removal of library code that supports the RSA-PSK key exchange in TLS 1.2.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:12 +01:00
Gilles Peskine
ac767e5c69 Remove MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
Remove the configuration option MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED and all
code guarded by it. This remove support for the RSA-PSK key exchange in TLS
1.2.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:49:01 +01:00
Gilles Peskine
7dfe7c9e4a Remove RSA-PSK test cases
The test cases removed by this commit are specific to RSA-PSK, not
incidentally using RSA-PSK when testing other features, so there is no loss
of test coverage.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-05 15:48:11 +01:00
Waleed Elmelegy
1ea62b11e1 Remove generate key brainpool160r1 & SECP224K1 test cases
Remove generate key brainpool160r1 & SECP224K1 test cases
as they are scheduled to be removed in 4.0 .

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-05 12:39:16 +00:00
Manuel Pégourié-Gonnard
e71f3c3a50
Merge pull request #9571 from Harry-Ramsey/improve-submodule-error-messages-development
Improve submodule error messages for Github archives
2024-11-05 10:26:52 +00:00
Elena Uziunaite
3a5f03d097 Update submodule with the merge
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-05 09:56:58 +00:00
Waleed Elmelegy
df186be8f5 Add extra tests cases for different Weierstrass curves for key generation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-04 17:28:54 +00:00
Waleed Elmelegy
1f5075b23f Revert "Add testing valid attributes after aborting an invalid input in iop key generation"
This reverts commit 005b78c307eab92b8ebbee922ed54a145417e3e9.

Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-04 17:28:34 +00:00
Gilles Peskine
9602ce7d8b Fix MD_PSA_INIT called before initializing some data structures
This fixes accesses to uninitialized memory in test code if
`psa_crypto_init()` fails.

A lot of those were pointed out by Coverity. I quickly reviewed all calls to
`MD_PSA_INIT()` manually, rather than follow any particular list.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 18:28:01 +01:00
Gilles Peskine
98a4f88760
Merge pull request #9751 from gilles-peskine-arm/mbedtls_psa_ecp_generate_key-no_public_key-dev
PSA ECC key generation: don't generate the public key
2024-11-04 16:36:44 +00:00
Gilles Peskine
f1210191e3 Don't use Unicode in .function file
generate_test_code.py doesn't support UTF-8 in .function files (but does
in .data files) when run in a non-UTF-8 locale with Python <=3.6.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Gilles Peskine
dc7d7875ac More explanation of what we do and do not test
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Gilles Peskine
18e8389452 Add changelog entry
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Gilles Peskine
fce3f0dd84 mbedtls_psa_ecp_generate_key: don't calculate the public key
mbedtls_ecp_gen_key() generates a private key and calculates the public key.
Calculating the public key takes most of the CPU time. But the PSA key store
doesn't store the key, in order to simplify the plumbing when drivers are
involved. So the time spent calculating the public key is a waste.

Instead, call mbedtls_ecp_gen_privkey(), which does not calculate the public
key.

This also saves 8 instructions in a sample arm thumb build.

Resolves #9732.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Gilles Peskine
091941e849 Basic statistical tests for mbedtls_psa_ecp_generate_key()
Run a few iterations and check that there is some diversity in the results.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Gilles Peskine
77587ce12d Unit tests for mbedtls_psa_ecp_generate_key()
Run the function on a few different curves with shorter, just-right and
larger buffer sizes. Perform some basic sanity checks on the output (which
is random).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-11-04 14:07:20 +01:00
Harry Ramsey
0f07e76b4b Fix undefined variable in makefile
This commit replaces an undefined variable ${MBEDTLS_FRAMEWORK_DIR} for
${MBEDTLS_PATH}.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 12:16:50 +00:00
Harry Ramsey
66ce986ef3 Improve makefile error message
This commit improves the makefile error message when using make, it no
longer incorrectly reports that CMakeLists.txt cannot be found instead
of exported.make.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-11-04 11:40:50 +00:00
Janos Follath
e7c28d6847
Merge pull request #9727 from gilles-peskine-arm/use_psa_crypto-always_forced
Force MBEDTLS_USE_PSA_CRYPTO enabled
2024-11-04 11:32:45 +00:00
Manuel Pégourié-Gonnard
dea700dd38 all.sh: improve wrapper error reporting
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-11-04 11:40:44 +01:00
Manuel Pégourié-Gonnard
0b7faf9011
Merge pull request #9746 from gilles-peskine-arm/ffdh-memsan-skip-dev
Skip slowest FFDH tests against GnuTLS with MSan or Valgrind
2024-11-04 08:10:26 +00:00
Waleed Elmelegy
005b78c307 Add testing valid attributes after aborting an invalid input in iop key generation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-01 17:08:57 +00:00
Elena Uziunaite
4cf5a0e368 Add a Python utility function to get the 3.6 feature macro
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-11-01 14:52:05 +00:00
Gilles Peskine
05030d4141 Skip slowest FFDH tests against GnuTLS with MSan or Valgrind
Skip 6144-bit and 8192-bit FFDH tests in MSan or Valgrind test
configurations. These test cases are slow and sometimes trigger GnuTLS's
built-in timeout (which cannot be configured until more recent versions).

Resolves #9742.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-31 18:52:40 +01:00
Waleed Elmelegy
b16edbef72 Improve comments for interuptible key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:41:00 +00:00
Waleed Elmelegy
bb0683274b Remove useless define check for interuptible key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:39:38 +00:00
Waleed Elmelegy
e3abcc3ff5 Improve interuptible key generation testing
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:39:02 +00:00
Waleed Elmelegy
75a412f5a3 Remove mention of drivers for interuptible key generation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:37:09 +00:00
Waleed Elmelegy
1c3c5b15c2 Add Testing interuptible key generation initialization
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-10-31 16:35:38 +00:00
Bence Szépkúti
cd0fb1d178
Merge pull request #9105 from jetm/ssl-client2-get-req-host
ssl_client2: Add Host to HTTP GET request
2024-10-31 11:32:49 +00:00
Manuel Pégourié-Gonnard
467b487d95
Merge pull request #9738 from mpg/drop-armcc5-dev
[dev] Drop building with armcc5 in all.sh
2024-10-31 08:12:40 +00:00
Gilles Peskine
9863b04dec Make MBEDTLS_USE_PSA_CRYPTO no longer a selectable option
The macro MBEDTLS_USE_PSA_CRYPTO is now always defined. It is no longer a
configuration option.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00
Gilles Peskine
b434192dcb Remove explicit setting of MBEDTLS_USE_PSA_CRYPTO
Now that it's always on, this is no longer necessary.
Also this is a step towards no longer being able to set it, because it soon
won't be a selectable configuration option anymore.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00
Gilles Peskine
005370f0be Skip "no USE_PSA" test cases in ssl-opt.sh
These test cases are desirable, but they will fail until we resolve
https://github.com/Mbed-TLS/mbedtls/issues/7294 .

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00
Gilles Peskine
fb31ebd6d5 Remove code for MBEDTLS_USE_PSA_CRYPTO disabled in ssl-opt.sh
Now that MBEDTLS_USE_PSA_CRYPTO is always on, remove code that handles the
case when it's disabled.
Also this is a step towards no longer expecting it to be reported by
query_compile_time_config.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00
Gilles Peskine
5e443f983b Remove direct requirements on MBEDTLS_USE_PSA_CRYPTO in ssl-opt.sh
Now that MBEDTLS_USE_PSA_CRYPTO is always on, we don't need to check for it.
Also this is a step towards no longer expecting it to be reported by
query_compile_time_config.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00
Gilles Peskine
a1be1b8fbb Remove ECJPAKE interoperability testing
We no longer have two (only partially distinct) implementations of ECJ-PAKE
cipher suites in TLS, now that the non-MBEDTLS_USE_PSA_CRYPTO implementation
is being removed.

We may want to add this testing back in the future, but we'll have to use an
old Mbed TLS instead of a differently-built one.
https://github.com/Mbed-TLS/mbedtls/issues/9740

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-10-30 14:23:16 +01:00