11212 Commits

Author SHA1 Message Date
Waleed Elmelegy
5bc5263b2c Add code improvments and refactoring in dealing with ALPN
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Waleed Elmelegy
883f77cb08 Add mbedtls_ssl_session_set_alpn() function
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Waleed Elmelegy
2824a209bc Add ALPN information in session tickets
Signed-off-by: Waleed Elmelegy <waleed.elmelegy@arm.com>
2024-03-13 16:50:01 +00:00
Ryan Everett
f111f35478 Add test cases for concurrently_use_same_persistent_key
There is a 1-1 correlation between these test cases and the test cases for import_and_exercise_key.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-13 14:31:11 +00:00
Ryan Everett
50619991c8 Add test function for concurrently using the same persistent key
The thread functions can also be used in future tests for other key types
and other test scenarios

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-13 14:31:11 +00:00
Ryan Everett
fbf815d9cb Add key_destroyable parameter to key export smoke tests
These are only called from mbedtls_test_psa_exercise_key

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-13 14:31:11 +00:00
Ryan Everett
73e4ea37f4 Add key_destroyable parameter to non-raw key agreement smoke tests
All current usages have this parameter set to 0 (this means the tests are unchanged).
Remove the GENERIC_ERROR return behaviour, in favour of returning the actual status.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-13 14:31:11 +00:00
Dave Rodgman
775c7768ee
Merge pull request #8877 from gilles-peskine-arm/split-minimal-3.6
Create a minimal framework submodule
2024-03-13 14:30:09 +00:00
Paul Elliott
0493ab56a4 Add PSA threaded init tests
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2024-03-13 12:39:02 +00:00
BensonLiou
bedd2519e6 fix code style
Signed-off-by: BensonLiou <momo1208@gmail.com>
2024-03-13 20:31:24 +08:00
Ronald Cron
40043d03a5
Merge pull request #8884 from ronald-cron-arm/improve-early-data-status
TLS 1.3: CLI: Split early data user status and internal state
2024-03-13 11:59:49 +00:00
Bence Szépkúti
fac1122b85 Rename solution files to referece VS2017
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2024-03-13 11:23:16 +01:00
Dave Rodgman
60c2f47f98
Merge pull request #8888 from minosgalanakis/features/add_ssl_session_accessor_8529
[MBEDTLS_PRIVATE] Add accessor for session and ciphersuite_id
2024-03-13 10:02:15 +00:00
Paul Elliott
4de4cc4a29
Merge pull request #8891 from Ryan-Everett-arm/document-SE_C-not-threadsafe
Officially document non thread-safety of MBEDTLS_PSA_CRYPTO_SE_C
2024-03-13 09:42:49 +00:00
Valerio Setti
13beaa2e60 psa_crypto_stubs: extend stub functions for the CRYPTO_CLIENT tests
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-13 09:52:36 +01:00
Valerio Setti
63097759f8 all.sh: modify/add test components for CRYPTO_CLIENT
The already existing component_test_psa_crypto_client() is renamed
as component_test_default_psa_crypto_client_without_crypto_provider()
while component_build_full_psa_crypto_client_without_crypto_provider()
was added.

- Both of them check that the missing symbols at link time (if any)
  belong to the psa_xxx() family.
- The former builds with default config + CRYPTO_CLIENT - CRYPTO_C and
  then runs test suites.
- The latter only perform the builds using the full config and then
  it checks that PK-PSA bridge functions are present.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-03-13 09:52:36 +01:00
Manuel Pégourié-Gonnard
3b20bda352
Merge pull request #8899 from gilles-peskine-arm/pk_copy_public_from_psa
New function mbedtls_pk_copy_public_from_psa
2024-03-13 06:56:17 +00:00
Gilles Peskine
68f46414cb
Merge pull request #8894 from daverodgman/quietbuild2
Follow-up non-verbose logs
2024-03-13 00:50:42 +00:00
David Horstmann
80a5dbd1cd Regenerate PSA wrappers for new PSA functions
Signed-off-by: David Horstmann <david.horstmann@arm.com>
2024-03-12 17:02:48 +00:00
Ryan Everett
8163028fbd Add key_destroyable parameter to raw key agreement smoke tests
All current usages have this parameter set to 0 (meaning the behaviour
of these tests hasn't changed). We also now return the actual error code, not GENERIC_ERROR

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
c1cc6686f0 Add key_destroyable parameter to key derivation smoke tests
All current usages have this parameter set to 0 (in this case the behaviour of
the test is unchanged)

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
d48fc102d3 Add key_destroyable parameter to exercise_asymmetric_encryption_key
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
6edd40819e Add key_destroyable parameter to exercise_signature_key
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
fbe703de2a Add key_destroyable parameter to exercise_aead_key
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
70691f3082 Add key_destroyable parameter to psa_exercise_cipher_key
If the key has been destroyed (and the new parameter is 1), we test that
psa_cipher_abort succeeds in this scenario.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
7763550884 Add key_destroyable parameter to exercise_mac_key
If the key has been destroyed (and the new parameter is 1) then we test that
psa_mac_abort succeeds in this scenario.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
f08a93fbe5 Add key_destroyable parameter to check_key_attributes_sanity
This function is currently only used in the exercise_key smoke test.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ryan Everett
0a271fde76 Add key_destroyable parameter to mbedtls_test_psa_exercise_key
This will allow us to use this smoke test to ensure that key slot content reads are
only performed when we are registered to read a full slot. We will destroy the key
on another thread while the key is being exercised, and fail the test if an unexpected
error code is hit. Future commits will incrementally implement this new parameter.

All current usages of this function have this parameter set to 0, in which case
the new behaviour must be the same as the old behaviour

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-03-12 17:01:09 +00:00
Ronald Cron
840de7ff2f tls13: cli: Rename STATUS_NOT_SENT to STATUS_NOT_INDICATED
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:18 +01:00
Ronald Cron
3641df2980 tls13: cli: Rename STATE_SENT to STATE_IND_SENT
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:18 +01:00
Ronald Cron
3c5a68339b tls13: cli: Rename STATE_NOT_SENT to STATE_NO_IND_SENT
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:18 +01:00
Ronald Cron
0c80dc1ed5 tls13: cli: Rename STATUS_NOT_SENT to STATUS_NO_IND_SENT
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:18 +01:00
Ronald Cron
05d7cfbd9c tls13: cli: Rename STATE_UNKNOWN to STATE_IDLE
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:18 +01:00
Ronald Cron
d2884662c1 tls13: cli: Split early data user status and internal state
Do not use the return values of
mbedtls_ssl_get_early_data_status()
(MBEDTLS_SSL_EARLY_DATA_STATUS_ macros)
for the state of the negotiation and
transfer of early data during the
handshake.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:48:15 +01:00
Ronald Cron
10797e3da1 ssl-opt.sh: Add O->m server version selection tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 17:16:05 +01:00
Ronald Cron
114c5f0321 ssl-opt.sh: Expand MbedTLS only version negotiation tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:46:37 +01:00
Ronald Cron
dcfd00c128 ssl-opt.sh: Change MbedTLS only version negotiation tests
Change description and dependencies before to
expand MbedTLS only version negotiation tests.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:46:37 +01:00
Ronald Cron
fe18d8db76 ssl-opt.sh: Group MbedTLS only version negotiation tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:46:37 +01:00
Ronald Cron
a1e7b6a66a ssl-opt.sh: Group cli ver nego tests against GnuTLS and OpenSSL
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:46:37 +01:00
Ronald Cron
dfad493e8b ssl-opt.sh: Expand G->m server version selection tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:46:35 +01:00
Ronald Cron
98bdcc4f29 ssl-opt.sh: Change G->m server version selection tests
Change description and dependencies before
to expand G->m server version selection tests.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:45:27 +01:00
Ronald Cron
cd1370e8d8 ssl-opt.sh: Group G->m server version selection checks
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-12 16:44:37 +01:00
David Horstmann
93fa4e1b87 Merge branch 'development' into buffer-sharing-merge 2024-03-12 15:05:06 +00:00
Gilles Peskine
d6a710a397 Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-03-12 15:06:47 +01:00
Gilles Peskine
0dc79a754d Fix and test pk_copy_from_psa with an unsupported algorithm
Fix mbedtls_pk_copy_from_psa() and mbedtls_pk_copy_public_from_psa() to
still work when the algorithm in the key policy is not an RSA
algorithm (typically PSA_ALG_NONE). Add a dedicated test case and adjust the
test code. Fixes the test case "Copy from PSA: non-exportable -> public, RSA"
when MBEDTLS_PKCS1_V15 is disabled.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-03-12 15:06:47 +01:00
Gilles Peskine
17d5b6bda2 Test mbedtls_pk_copy_public_from_psa on non-exportable keys
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-03-12 15:06:47 +01:00
Gilles Peskine
bf69f2e682 New function mbedtls_pk_copy_public_from_psa
Document and implement mbedtls_pk_copy_public_from_psa() to export the
public key of a PSA key into PK.

Unit-test it alongside mbedtls_pk_copy_from_psa().

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-03-12 15:06:45 +01:00
Manuel Pégourié-Gonnard
d7e7f48323
Merge pull request #8774 from valeriosetti/issue8709
Implement mbedtls_pk_copy_from_psa
2024-03-12 13:45:27 +00:00
Dave Rodgman
235799bc23 Simplify locating original tool
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-12 13:33:09 +00:00
Dave Rodgman
294a3c2ccb Remove unnecessary use of export
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2024-03-12 13:32:36 +00:00