31432 Commits

Author SHA1 Message Date
Elena Uziunaite
9204c2b893 Update submodule
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-09-30 14:53:24 +01:00
David Horstmann
55b43e5cfb
Merge pull request #9541 from gilles-peskine-arm/ssl-opt-sample-programs-3.6
Backport 3.6: test sample programs in ssl-opt.sh
2024-09-26 14:33:13 +00:00
Elena Uziunaite
12cb9c2cda Update submodule to the head of framework PR
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
2024-09-26 15:24:33 +01:00
Manuel Pégourié-Gonnard
d93161f366
Merge pull request #9637 from gilles-peskine-arm/config-full-booleans-only-3.6
Backport 3.6: config.py: don't rely on section names
2024-09-26 10:04:06 +00:00
Manuel Pégourié-Gonnard
9fc3b7d243 Expand on block cipher modes/derivatives
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-09-26 11:00:02 +02:00
Gilles Peskine
fa1d84e102 Update framework to the main branch
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-26 10:18:36 +02:00
Manuel Pégourié-Gonnard
83f62ffc09 Expand on key derivations
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-09-26 10:14:55 +02:00
Manuel Pégourié-Gonnard
60769762d2 Clarify the superset rule
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-09-26 09:57:22 +02:00
Manuel Pégourié-Gonnard
4ceb71f53d Update and refine notes on restartable ECC and 4.0
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
2024-09-26 09:45:45 +02:00
Gilles Peskine
5bf54ca46f Skip ssl_server in config-suite-b
When building with `configs/config-suite-b.h`, the SSL I/O buffer size is
1024 bytes. Experimentally, this isn't quite enough for the test certificate
that we use: the server aborts the handshake with
`MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL` raised from
`mbedtls_ssl_write_certificate()`. State an ad hoc minimum output buffer
size to skip testing `ssl_server` in `config-suite-b`.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:53:39 +02:00
Gilles Peskine
e6fd7d57ca Use OPENSSL_NEXT for a test case that uses IPv6 when available
dtls_client connects to "localhost", which is usually IPv6 on modern
systems. On our CI, $OPENSSL is OpenSSL 1.0.2g which doesn't support IPv6.
Pitching dtls_client against $OPENSSL works on the CI at the moment, but
only because the CI runs in Docker with default network settings which has
IPv6 disabled. This would stop working if we changed the CI's Docker setup,
and the test case is likely to fail on a developer machine. So switch the
test case to using $OPENSSL_NEXT (which is a version of OpenSSL that has
IPv6 support).

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
927f2f1418 Note known issue about test cases skipped in TLS 1.3-only builds
https://github.com/Mbed-TLS/mbedtls/issues/9560

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
ca730a7c13 Test SSL sample programs against each other and ssl_client2, ssl_server2
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
ff85e91914 dtls_client: don't force the use of IPv6
Default to connecting to "localhost", like ssl_client1.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
3104685cc6 ssl_server: Allow the client to close the connection first
This is necessary when testing against OpenSSL 1.0.2g.

In the server, flush more often. Otherwise, when stdout is redirected to a
file, the server gets killed before it writes important information, such as
the logs that we expect in the test cases.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
8d64fe1c56 Compatibiliy with older OpenSSL and GnuTLS
GnuTLS 3.4.x doesn't allow repeated `-p PORT` arguments.

OpenSSL 1.0.2 has different logs. For TLS 1.2 test cases, use a line that
is present in logs from OpenSSL 1.0.2g, 3.3.0 and presumably all versions
in between.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
33aa202339 Declare GnuTLS version dependency for TLS 1.3 test cases
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
6117a0cb8b Declare OpenSSL version dependency for TLS 1.3 test cases
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
9d104e9857 Test dtls_server
Test against both OpenSSL and GnuTLS.

Don't use a proxy. It's not particularly useful here, and would complicate
figuring out port numbers.

Clean up compile-time requirements dtls_server.c: any certificate-based key
exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
2a0af359f1 Test ssl_fork_server
Test ssl_fork_server with both TLS 1.2 and TLS 1.3.
Test against both OpenSSL and GnuTLS.

In the server, flush more often. Otherwise, when stdout is redirected to a
file, the server gets killed before it writes important information, such as
the logs that we expect in the test cases.

In the server, only write output for 10 seconds, not 100. That's enough time
to start concurrent clients if desired. 100 seconds causes ssl-opt to take a
very long time when the client actually listens to the whole input (which
`gnutls-cli` does, but not `openssl s_client`).

Clean up compile-time requirements in ssl_fork_server.c: any certificate-based
key exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
fab6099d4a Test ssl_pthread_server
Test ssl_pthread_server with both TLS 1.2 and TLS 1.3.
Test against both OpenSSL and GnuTLS.

In the server, flush more often. Otherwise, when stdout is redirected to a
file, the server gets killed before it writes important information, such as
the logs that we expect in the test cases.

Clean up compile-time requirements in ssl_pthread_server.c: any certificate-based
key exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
37c374981c Test ssl_server
Test ssl_server with both TLS 1.2 and TLS 1.3.
Test against both OpenSSL and GnuTLS.

Clean up compile-time requirements in ssl_server.c: any certificate-based
key exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
f8b373e869 Test dtls_client
Test against both OpenSSL and GnuTLS.

Don't use a proxy. It's not particularly useful here, and would complicate
figuring out port numbers.

Clean up compile-time requirements in dtls_client.c: any certificate-based
key exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
e6b8250a94 Test ssl_client1
Test ssl_client1 with both TLS 1.2 and TLS 1.3.
Test against both OpenSSL and GnuTLS.

Clean up compile-time requirements in ssl_client1.c: any certificate-based
key exchange is ok, so don't insist on built-in RSA.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
6c798ef36d Allow test cases to use a specific port
This is necessary for the SSL sample programs: they hard-code port 4433.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
478f6068b5 Prepare to test SSL sample programs
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
dd51826b4e ssl_client1: Exit with an error status if the TLS connection failed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 17:52:48 +02:00
Gilles Peskine
f5f90d517f Don't pass the section name to adapters
We have finished removing the reliance of named configuration on section
names.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 14:00:07 +02:00
Gilles Peskine
e5920a4ae8 Change "realfull" to activate everything
Change "realfull" to activate everything. After investigation, it seems that
having "realfull" not activate everything was a historical oddity due to
proximity with "full", not a goal in itself.

https://github.com/Mbed-TLS/mbedtls/issues/520#issuecomment-727190862
https://github.com/Mbed-TLS/mbedtls/pull/965/files#r523409092

This changes the output of `scripts/config.py realfull`: now all non-boolean
options are uncommented.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 14:00:07 +02:00
Gilles Peskine
bfdffc33b3 Change "full" to affect boolean settings rather than use sections
To get rid on the reliance on sections, change "full" and friends to enable
settings based on whether the setting is boolean, rather than based on the
section it contains.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 14:00:07 +02:00
Gilles Peskine
0ff1d984f8 Pass the setting's value to adapters
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 14:00:07 +02:00
Ronald Cron
1dbfb4b8e2
Merge pull request #9563 from gilles-peskine-arm/tls13-middlebox-compat-disabled-3.6
Backport 3.6: Fix interoperability when MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE is disabled
2024-09-25 11:50:31 +00:00
Gilles Peskine
ae7e1c7861 Have make ssl-opt generate tls13-compat.sh (make edition)
This is necessary if you haven't run `make generated_files` first.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 10:27:47 +02:00
Gilles Peskine
278b417752 Have make ssl-opt generate tls13-compat.sh
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-25 09:52:28 +02:00
Gilles Peskine
02f0f9f1ff Merge remote-tracking branch 'mbedtls-3.6' into tls13-middlebox-compat-disabled-3.6 2024-09-25 09:52:14 +02:00
Gilles Peskine
c67a0ad5da Fix copypasta
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-24 17:33:24 +02:00
Gilles Peskine
f0d2eb5828
Merge pull request #9603 from gilles-peskine-arm/test-ref-configs-go-away-3.6
Backport 3.6: Switch from test-ref-configs.pl to separate components
2024-09-24 13:00:54 +00:00
Paul Elliott
d8c7eae2cf
Merge pull request #9596 from gilles-peskine-arm/make_generated_files-document_CC-3.6
Backport 3.6: make_generated_files.bat: document C compiler requirement
2024-09-24 12:36:28 +00:00
Tom Cosgrove
81163122e4
Merge pull request #9601 from gilles-peskine-arm/use_psa_crypto-key_id_encodes_owner-compatible-config-3.6
Fix obsolete comment about MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER
2024-09-24 10:44:44 +00:00
Ronald Cron
cbacb065f3
Merge pull request #9511 from gabor-mezei-arm/9325_bp36_move_config.py_to_framework
[Backport 3.6] Move `config.py` functionalities to the framework
2024-09-20 16:07:47 +00:00
Gabor Mezei
5a2bcf6f3e
Remove PSA macros usage from adapters
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2024-09-20 12:41:24 +02:00
Gilles Peskine
94f7e409eb CMake: generate tls13-compat.sh in the default build target
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
10e58e7b05 Move generation of tls13-compat.sh to tests/CMakeLists.txt
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
8ca70ac470 Print a "Gen" line when generating a file
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
2cdcec942c Remove obsolete requirement for GnuTLS %DISABLE_TLS13_COMPAT_MODE
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
5a668dd5af Reduce level of non-error debug message
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
015d222008 Remove transitional always-on internal option
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
2aecb1369f Changelog entry: fix #9551
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
4daaafebe0 Fix sensitivity of tls13-compat.sh to the exact generation method
Fix `tls13-compat.sh` changing based on exactly how
`generate_tls13_compat_tests.py` was run (e.g. from which directory). This
made `check-generated-files.sh` behave differently from `make`. The script
has no official variations of the content of its output file, so we don't
need to record the full command line.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00
Gilles Peskine
0e9ba089b9 Automatically generate tests/opt-testcases/tls13-compat.sh
`tests/opt-testcases/tls13-compat.sh` is supposed to be automatically
generated by `tests/scripts/generate_tls13_compat_tests.py`. So far, the
output has been updated by running the script manually and committing the
output. Switch to using our framework for generated files.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
2024-09-20 07:44:36 +02:00