32175 Commits

Author SHA1 Message Date
Waleed Elmelegy
93be7a175e Refactor PSA key agreement API implementation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
57fb2a687c Refactor interuptible key agreement testing helper function
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
26136ec98b Improve interruptible key agreement implementation
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
4cef20d00b Fix everest build issue
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
96a5c010d4 Add changelog entry for interuptible psa key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
a7fc0a676e Add PSA interruptible key agreement tests
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:49 +00:00
Waleed Elmelegy
a2891a9ac9 Add PSA interuptable key agreement APIs
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-11-06 16:03:46 +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
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
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
Manuel Pégourié-Gonnard
69868299a8
Merge pull request #9430 from davidhorstmann-arm/align-development-3.6-test-helpers
Align development test helpers with 3.6
2024-10-30 09:09:34 +00:00
Bence Szépkúti
15baf8b027
Merge pull request #9708 from ronald-cron-arm/target-compile-options
cmake: Define compile and link options target by target
2024-10-29 18:59:07 +00:00
Gilles Peskine
8ed4d94166
Merge pull request #9614 from gilles-peskine-arm/use_psa_crypto-always_on
Always enable MBEDTLS_USE_PSA_CRYPTO in all.sh
2024-10-29 14:58:55 +00:00
Bence Szépkúti
d6175c5b0c
Merge pull request #9389 from bensze01/graviton-testing
Add default config tests for the A64, A32, Thumb 1 and Thumb 2 instruction sets
2024-10-29 12:24:48 +00:00
Manuel Pégourié-Gonnard
26caae8152 Rm forgotten armc5
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 12:43:26 +01:00
Manuel Pégourié-Gonnard
705690af69 Drop building with armcc5 in all.sh
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-10-29 11:46:47 +01:00
Harry Ramsey
6d9c389957 Further improve error message clarity
This commit further improves error message clarity.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
2024-10-28 14:05:23 +00:00