11179 Commits

Author SHA1 Message Date
Gilles Peskine
ff3b8211ff Driver-only FFDH is not good enough for DHE support in TLS 1.2
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Gilles Peskine
6191f4aeb5 Add seme missing dependencies on renegotiation support
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Gilles Peskine
dd782f4197 Default NEXT versions to be the base executables
This allows many tests to pass with the system openssl and gnutls-*. As
before, not all test cases will pass due to differences between versions and
build options.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Gilles Peskine
01fde2c3cc Force some test cases to use TLS 1.2
Some OpenSSL or GnuTLS interoperability test cases fail if the other
implementation is recent enough to support TLS 1.3. Force those test cases
to use TLS 1.2 so that the script works with more recent $OPENSSL or
$GNUTLS_CLI or $GNUTLS_SERV than our official CI versions.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Gilles Peskine
3b81ea1e9c Add some missing dependencies on crypto features
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-30 16:20:20 +02:00
Gilles Peskine
77c13e67d4 Fix PSK invocation: GnuTLS PSK length
ssl-opt.sh uses a 3-byte PSK in many test cases. Unfortunately GnuTLS >=3.4.0
rejects a PSK that is less than 4 bytes long:

> Error setting the PSK credentials: The request is invalid.

Use a longer PSK throughout ssl-opt. Only the test cases involving GnuTLS
need to change, but it's easier to do a global search-and-replace, and it's
easier to not have to worry about mismatches in constructed test cases
later, so replace everything.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-29 16:09:52 +02:00
Gilles Peskine
c158fe6eb8 Fix PSK invocation: GnuTLS prompting
When given a PSK key but no username, gnutls-cli prompts for a password.
Prevent that by passing --pskusername with the same identity that
ssl_server2 uses by default.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-29 16:05:54 +02:00
Gilles Peskine
2776240af4 Fix PSK invocation: OpenSSL client
Only s_server has a -nocert option, s_client doesn't. Fixes OpenSSL client
test cases in PSK-only builds.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-29 16:05:38 +02:00
Gilles Peskine
d00b93b621 Require RSA when using server1* key or certificate
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-29 16:03:29 +02:00
Gilles Peskine
e855317957 Fix skipped tests in configurations without RSA
Tighten the matching when detecting which certificates are in use to
determine algorithm requirements. This fixes a bug whereby all tests were
skipped in configurations without RSA except for an Mbed TLS client against
a GnuTLS or OpenSSL server, due to *server2* matching ssl_server2.
Fixes #8366.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-04-26 21:28:49 +02:00
Manuel Pégourié-Gonnard
771fd7d1dc
Merge pull request #9022 from mpg/compat-fixes-dev
[dev] Small fixes to compat.sh (partial forward-port)
2024-04-24 07:11:49 +00:00
Ryan Everett
fcd744fe69 Set MBEDTLS_PSA_CRYPTO_CONFIG in component_test_no_rsa_key_pair_gen
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-04-22 10:44:24 +01:00
Manuel Pégourié-Gonnard
eb86b906d7 Fix full invocation of ssl-opt.sh
The previous commit had:
- one obvious mistake (-f NULL with default -e runs nothing)
- one unforeseen issue: OPENSSL_NEXT skips static ECDH
- arguably scope creep: the stated goal was to simplify the full
invocation (in particular, make it obvious that everything is run
without having to remember the default value of EXCLUDE), but it also
made an unrelated change: running most tests with OPENSSL_NEXT (hence
the previous point).

This commit should fix all this, in particular it switches back to
running most tests with OPENSSL and using OPENSSL_NEXT only when needed.

Hopefully in the future we'll do the opposite: most tests will run with
a recent OpenSSL, and only those that need an older one will use
something older. But that will be another PR.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-22 10:25:09 +02:00
Ryan Everett
daa322a2de Update component_test_psa_crypto_rsa_no_genprime
Prepare this component for PSA_CRYPTO_CONFIG to be on by default.
Rename it so that the name is still accurate when we remove legacy symbols

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
2024-04-18 16:50:02 +01:00
Manuel Pégourié-Gonnard
62d0bb8f2c Simplify full invocation of compat.sh
We actually only need two invocations.

This also moves all the default tests to OPENSSL_NEXT, which is good
because OPENSSL is ancient.

I have no idea why NULL doesn't work with OPENSSL_NEXT (1.1.1a) server,
because according to the manpage [1], "ALL,COMPLEMENTOFALL" (which is
what we are using) should do it, and indeed

    $OPENSSL_NEXT ciphers "ALL,COMPLEMENTOFALL" | tr ':' '\n'

lists NULL ciphersuites, and also they work client-side with
OPENSSL_NEXT...

[1] https://www.openssl.org/docs/man1.1.1/man1/ciphers.html

Also, while at it, remove partial invocation (only non-default) from one
component, as we already have a full invocation in the same config (plus
ASan) in another component.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-17 12:39:00 +02:00
Manuel Pégourié-Gonnard
68deadd455
Merge pull request #8566 from mpg/driver-status
Document driver testing status
2024-04-17 07:57:15 +00:00
Manuel Pégourié-Gonnard
1fb4750aed
Merge pull request #8998 from ronald-cron-arm/openssl3
Use latest installed OpenSSL 3 as OPENSSL_NEXT
2024-04-15 08:32:42 +00:00
Manuel Pégourié-Gonnard
45fe86db99 Fix a typo in a comment
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
70cd911405 Improve comment in a header file
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
4c81c343ac Fix copy-pasta in top-of-file comment
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
1f4c9051cd all.s: Rm redundant build-only accel components
Most of them (2 exceptions, see below) are of the "driver + built-in"
type, so they're all a subset of test_psa_crypto_driver which tests
everything with driver + built-in at once.

Furthermore, all those components were build-only, while
test_psa_crypto_driver runs the test suites.

Special cases: two of the components looked like they were trying to go for
driver-only (ecdh disabling ECDH_C and hkdf disabling HKDF_C).

For ECDH, built-in would actually be re-enabled because not enough was
accelerated: you also need ECC key types and curves - see
component_test_psa_crypto_config_accel_ecdh which does this correctly.

For HKDF, we don't have test driver support for key derivation yet. I
guess that shows how little testing value these build-only components
really had.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
1ad29c818b Rm redundant driver+built-in all.sh component
As the comment says, this component's only goal was to make sure the
legacy+driver test cases in test_suite_md.psa were executed.

But actually these are already executed in
component_test_psa_crypto_drivers which tests with everything having
both a driver and the built-in, as can be seen in the outcomes file.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
3dbd236b13 Update user-config-for-tests
Was missing several key types and algs. Also, list those that are not
implemented, but comment them out, to make it clearer what's not
implemented yet.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
733a67bb9a all.sh: group helper functions in sections
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-12 12:40:01 +02:00
Manuel Pégourié-Gonnard
cb424097be compat.sh: properly skip unsupported DTLS 1.2
Skipping DTLS 1.2 with old versions was already done, but now properly
test support only once and use the results.

Note that historically, this script's policy was that it's the user's
job to find the right value of -e (EXCLUDE) for their version for
OpenSSL & config. Now it's a weird mix of that and the script doing some
detection and skipping.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-11 10:29:35 +02:00
Manuel Pégourié-Gonnard
0dd6ca4175 compat.sh: properly report skipped tests
Don't just silently continue.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-11 10:29:34 +02:00
Manuel Pégourié-Gonnard
f53112e98b Fix closing comment to match opening guard
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-09 10:48:24 +02:00
Manuel Pégourié-Gonnard
0a4ffa4c3e Fix style of preprocessor expression
We use logical '&&' everywhere, let's be consistent.

(Unless I'm mistaken, binary '&' happens to give the same results for
booleans so this wasn't an actual bug, just style/readability issue.)

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
ebdca796a1 Fix failures in psa_cryto_driver_wrappers suite
- "in-driver" test should depend on the present
  of a driver.
- add new counter in key manangement driver test
  hook which counts the calls of generate_key.
- We only care about the hits when processing
  `psa_generate_key`.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
057ceb281c Add missing dependency of fallback test in driver wrappers suite
To pass a fallback test, we need a dependency on built-in
implementation.

Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
03fe253533 Add missing definition of AT_LEAST_ONE_BUILTIN_KDF
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
7cca290120 Fix wrong dependency in psa_crypto_driver_wrappers suite
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
b482a471d4 Fix wrong dependency in psa_crypto_pake suite
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
7ee283362b Fix typo in ssl test suite
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +02:00
Pengyu Lv
e2776d16ef Correct dependancy on MBEDTLS_X509_INFO for x509parse
Signed-off-by: Pengyu Lv <pengyu.lv@arm.com>
2024-04-09 10:48:24 +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
Bence Szépkúti
e4d9013518
Merge pull request #8987 from valeriosetti/issue8903
Test gap: mbedtls_pk_check_pair with MBEDTLS_PK_OPAQUE
2024-04-04 13:44:24 +00: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
dd96c0a2df all.sh: Use full instead of default as the base for the new component
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 17:46:44 +02:00
Ronald Cron
3d0f182a41 ssl-opt.sh: Fix some test dependencies
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 17:05:00 +02:00
Ronald Cron
c5e81d2e64 Use latest installed OpenSSL 3 as OPENSSL_NEXT
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 15:20:41 +02:00
Ronald Cron
ceea3e26c6 ssl-opt.sh: Adapt tests to OpenSSL 3
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 14:30:26 +02:00
Ronald Cron
9785cf1821 Add RSA key certificates
Add RSA key certificates using SHA256
instead of SHA1 for the signature
algorithm. Those are needed for some
TLS 1.3 compatibility tests with OpenSSL 3
to avoid having to enable in OpenSSL 3
the support for the deprecated SHA-1 based
signature algorithms.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 14:28:35 +02:00
Ronald Cron
d64fcee58c tests: ssl: Fix dependencies of SRV TLS 1.3 session serialization tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-04-02 12:25:56 +02:00
minosgalanakis
e146940714
Merge pull request #1216 from Mbed-TLS/mbedtls-3.6.0_mergeback
Mbedtls 3.6.0 mergeback
2024-03-28 14:31:03 +00:00
Minos Galanakis
9860056006 Revert "Autogenerated files for 3.6.0"
This reverts commit e8a6833b2878f1c08b8f96fe35e2812367e32ef3.

Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2024-03-27 17:36:15 +00:00
Ronald Cron
ceae4f85ea ssl-opt.sh: Add tests where tickets are ignored
Add tests where we explicitely check that
tickets are ignored on client side when
the support is not enabled.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Norbert Fabritius
4f1c9278cc ssl-opt.sh: Add missing MBEDTLS_SSL_SESSION_TICKETS dependencies
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Norbert Fabritius
d30e91150e all.sh: Add component testing default minus session tickets
Signed-off-by: Norbert Fabritius <norbert.fabritius@esrlabs.com>
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00
Ronald Cron
161e14faf6 tests: ssl: Fix dependencies of TLS 1.3 session serialization tests
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
2024-03-27 09:37:37 +01:00