Commit Graph

31413 Commits

Author SHA1 Message Date
Elena Uziunaite
e0c6f80403 Tiny fix in ChangeLog
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-22 09:00:57 +01:00
Elena Uziunaite
f72a510590 Edit ChangeLog entry
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-21 11:12:34 +01:00
Elena Uziunaite
16f0e18e41 Update ChangeLog
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-19 12:12:34 +01:00
Elena Uziunaite
f48bfb00bd Add test cases for extKeyUsage
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-16 17:24:44 +01:00
Elena Uziunaite
6a04b168b2 Rationalize extKeyUsage tests
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-16 17:24:34 +01:00
Manuel Pégourié-Gonnard
aeda1fd0a8 Use P_CLI when O_CLI's status is not reliable
Generally speaking, in this group of test we use O_SRV when testing our
client's behaviour, and O_CLI when testing our server's behaviour. I
don't think that's essential, but why not.

Well, for these two tests there's a reason why not: O_CLI often exits 0,
seemingly not minding that the server aborted the handshake with a fatal
alert, but sometimes it exits 1. (I've observed 0 on my machine, on two
runs of OpenCI and Internal CI, and 1 in some test in one run of
Internal CI.)

So, use our client instead, which exits non-zero consistently.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:26 +01:00
Manuel Pégourié-Gonnard
19d6d3421c Rationalize keyUsage testing, round 2
- cli-auth 1.2 was missing a test with an irrelevant bit set in addition
to the relevant bit (which was added for 1.3 previously)
- use consistent naming for fail (hard/soft)

Note: currently there are no "fail (soft)" cases for 1.3 authentication
of server by client, as server auth is mandatory in 1.3 (this will
change in 3.6.1).

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:16 +01:00
Manuel Pégourié-Gonnard
92a391e0fe Always print detailed cert errors in test programs
Previously the client was only printing them on handshake success, and
the server was printing them on success and some but not all failures.

This makes ssl-opt.sh more consistent as we can always check for the
presence of the expected message in the output, regardless of whether
the failure is hard or soft.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:24:05 +01:00
Manuel Pégourié-Gonnard
4956e32538 Fix 1.3 failure to update flags for (ext)KeyUsage
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:47 +01:00
Manuel Pégourié-Gonnard
5a4c8f0ba0 Rationalize ssl-opt tests for keyUsage
- consistent naming with explicit version
- in each section, have a positive case with just the needed bit set,
and one with an irrelevant bit set in addition (cli 1.3 only had the
former, and cli-auth 1.3 only the later)
- when auth_mode optional is supported failing cases should come in
pairs: soft+hard, this wasn't the case for cli-auth 1.3. (Note: cli 1.3
currently does not support auth_mode optional.)
- failing cases should check that the correct flag is printed and the
expected alert is sent.

The last (two) points have uncovered a bug in 1.3 code:
- In fail (hard) cases the correct alert isn't send, but a more generic
one instead.
- In fail (soft) cases the issue with the certificate is not reported,
actually the certificate is reported as valid.

Both share the same root cause: the flags are not updated properly when
checking the keyUsage extension. This will be addressed in future
commits.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:40 +01:00
Manuel Pégourié-Gonnard
8e70c2bcd9 Test cert alert KEY_USAGE -> UNSUPPORTED_CERT
In terms of line coverage, this was covered, except we never checked the
behaviour was as intended.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-08-16 17:23:31 +01:00
Gilles Peskine
1782cc8b95
Merge pull request #1264 from Mbed-TLS/pre3.6.1_test_merge_upstream_dev
Merge development into -restricted
2024-08-12 11:24:35 +02:00
Minos Galanakis
123a625386 Resolved merge conflicts caused by file moved in #8226
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-08 14:11:53 +01:00
Tom Cosgrove
195e1647b2
Merge pull request #9427 from valeriosetti/psasim-small-fixes
psasim: small fixes to all.sh and test bash scripts
2024-08-07 13:13:46 +00:00
Manuel Pégourié-Gonnard
821b908456
Merge pull request #9364 from eleuzi01/replace-ccm
Replace MBEDTLS_SSL_HAVE_CCM with PSA_WANT_ALG_CCM
2024-08-07 08:18:52 +00:00
Tom Cosgrove
2d5b17be03
Merge pull request #8609 from tom-daubney-arm/standardise_proj_detection
Standardise Project Detection in Shell Scripts
2024-08-07 07:18:36 +00:00
Gilles Peskine
bac7c9699d
Merge pull request #9446 from gilles-peskine-arm/psa_generate_key_custom-development-forward_then_remove
psa_generate_key_custom
2024-08-06 16:41:42 +00:00
Thomas Daubney
b55679736b Move some proj detection code inside pre_check_environment
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2024-08-06 17:35:38 +01:00
Valerio Setti
2016d66741 psasim: small fixes to all.sh and test bash scripts
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2024-08-06 11:52:00 +02:00
Elena Uziunaite
c256172b30 Replace MBEDTLS_SSL_HAVE_CCM with PSA_WANT_ALG_CCM
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-05 15:40:00 +01:00
Gilles Peskine
7db1bcdb34 Update generated PSA wrappers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
fd46f7f173 Migrate psasim wrappers to psa_custom_key_parameters_t
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
3077f2f9c6 Remove experimental, superseded function psa_generate_key_ext
Remove the experimental functions psa_generate_key_ext() and
psa_key_derivation_output_key_ext(), which require a flexible array member
and therefore break C++ code that includes Mbed TLS headers. They have been
replaced by psa_generate_key_custom() and
psa_key_derivation_output_key_custom().

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
6b3bca5c78 Follow include path updates for C++ builds
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
d5d69bb4a0 Match spacing in pointer types in documentation with the code style
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
63d06efc38 Rename one more deprecated identifier
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
6b2709bf06 Documentation improvements
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
ae8fa71669 Rename internal function psa_key_production_parameters_are_default
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
1084e8eb4f key_custom: update analyze_outcomes.py
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:37 +02:00
Gilles Peskine
62ee8fdcf5 Test cpp_dummy_build in pedantic mode
In public headers, we want to avoid things that are not standard C++,
including features that GCC and Clang support as extensions, such as
flexible array members. So compile with `-pedantic`.

Non-regression for https://github.com/Mbed-TLS/mbedtls/issues/9020.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:52:32 +02:00
Gilles Peskine
b0cc2ad6bd Changelog entry for the move from key_ext to key_custom functions
Document psa_generate_key_ext() and psa_key_derivation_output_key_ext() as
deprecated in favor of psa_generate_key_custom() and
psa_key_derivation_output_key_custom(), and no longer declared in C++ builds.

Resolves #9020.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
ae1da9858c Remove some tests of psa_generate_key_ext
We know it's a thin wrapper around psa_generate_key_custom, so we just need
to check that it's passing the information through, we don't need coverage
of the parameter interpretation.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
8ae5028a1d Document the key_ext functions as deprecated
Don't formally deprecate them because we don't do that in a
long-time support branch. But do point readers away from them.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
e863f868ec Documentation: point to key_custom instead of key_ext
Replace references to the deprecated functions `psa_generate_key_ext()` and
`psa_key_derivation_output_key_ext()` by their replacements
Implement `psa_generate_key_custom()` and
`psa_key_derivation_output_key_custom()`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
b45af2f507 Update PSA wrappers
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
f9408282e8 Implement psa_generate_key_custom
Implement `psa_generate_key_custom()` and
`psa_key_derivation_output_key_custom()`. These functions replace
`psa_generate_key_ext()` and `psa_key_derivation_output_key_ext()`.
They have the same functionality, but a slightly different interface:
the `ext` functions use a structure with a flexible array member to pass
variable-length data, while the `custom` functions use a separate parameter.

Keep the `ext` functions for backward compatibility with Mbed TLS 3.6.0.
But make them a thin wrapper around the new `custom` functions.

Duplicate the test code and data. The test cases have to be duplicated
anyway, and the test functions are individually more readable this way.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-05 15:49:22 +02:00
Gilles Peskine
be6a47140b
Merge pull request #9365 from eleuzi01/replace-gcm
Replace MBEDTLS_SSL_HAVE_GCM with PSA_WANT_ALG_GCM
2024-08-05 09:43:23 +00:00
Manuel Pégourié-Gonnard
aa6f6d25e2
Merge pull request #8226 from davidhorstmann-arm/all-sh-separate-components
Separate `all.sh` from its components
2024-08-05 08:38:23 +00:00
Gilles Peskine
9c9a3df3bf
Merge pull request #9366 from eleuzi01/replace-chachapoly
Replace MBEDTLS_SSL_HAVE_CHACHAPOLY with PSA_WANT_ALG_CHACHA20_POLY1305
2024-08-02 14:26:27 +00:00
Tom Cosgrove
5b85d709c3
Merge pull request #9442 from gilles-peskine-arm/psa_sim_generate-parse_headers
psa_sim_generate.pl: don't copy the headers
2024-08-02 13:47:27 +00:00
Gilles Peskine
4b3b4fe56e Remove cruft and update documentation
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-08-02 12:42:01 +02:00
Elena Uziunaite
83a0d9deec Replace MBEDTLS_SSL_HAVE_GCM with PSA_WANT_ALG_GCM
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-08-02 09:52:20 +01:00
Gilles Peskine
56b4e5a65d
Merge pull request #9443 from gilles-peskine-arm/psa-keystore-design-doc-development
Document the key store design
2024-08-02 07:16:13 +00:00
Minos Galanakis
bf47cf7437 all.sh/components: Moved component_build_zeroize_checks -> compiler.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
9ceb2c3e0a all.sh/components: Moved test_malloc_0_null,test_memory_buffer_allocator -> configuration.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
aa09e48854 all.sh/components: Moved test_sw_inet_pton -> x509.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
c06fd308c2 all.sh/components: Moved crypto components out of tls.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
1c26ef555c all.sh/components: Moved component_test_no_strings -> configuration.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
b5891d5dec all.sh/components: Moved aesni and armce components -> platform.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00
Minos Galanakis
1ef3a66540 all.sh/components: Moved test_aesni_m32_clang -> platform.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-08-01 19:38:47 +01:00