diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e48e44beda..2259b1d1eb 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,13 +9,14 @@ Please write a few sentences describing the overall goals of the pull request's Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line. If the provided content is part of the present PR remove the # symbol. -- [ ] **changelog** provided | not required because: -- [ ] **development PR** provided # | not required because: -- [ ] **TF-PSA-Crypto PR** provided # | not required because: +- [ ] **changelog** provided | not required because: - [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required -- [ ] **3.6 PR** provided # | not required because: -- **tests** provided | not required because: - +- [ ] **TF-PSA-Crypto development PR** provided Mbed-TLS/TF-PSA-Crypto# | not required because: +- [ ] **TF-PSA-Crypto 1.1 PR** provided Mbed-TLS/TF-PSA-Crypto# | not required because: +- [ ] **mbedtls development PR** provided # | not required because: +- [ ] **mbedtls 4.1 PR** provided # | not required because: +- [ ] **mbedtls 3.6 PR** provided # | not required because: +- **tests** provided | not required because: ## Notes for the submitter diff --git a/ChangeLog b/ChangeLog index 12191e1116..b7a79ce348 100644 --- a/ChangeLog +++ b/ChangeLog @@ -143,7 +143,7 @@ Removals in favour of mbedtls_ssl_conf_groups() since Mbed TLS 3.1. * Remove support for the DHE-PSK key exchange in TLS 1.2. * Remove support for the DHE-RSA key exchange in TLS 1.2. - * Following the removal of DHM module (#9972 and TF-PSA-Crypto#175) the + * Following the removal of DHM module (#9972 and Mbed-TLS/TF-PSA-Crypto#175) the following SSL functions are removed: - mbedtls_ssl_conf_dh_param_bin - mbedtls_ssl_conf_dh_param_ctx diff --git a/ChangeLog.d/cmake-destdir-instal.txt b/ChangeLog.d/cmake-destdir-instal.txt new file mode 100644 index 0000000000..1638a4bea9 --- /dev/null +++ b/ChangeLog.d/cmake-destdir-instal.txt @@ -0,0 +1,3 @@ +Features + * Restore DESTDIR support for CMake installs of compatibility + libmbedcrypto symlinks. Fixes #10627. diff --git a/ChangeLog.d/fix-tls12-rsa-pss-sigalgs.txt b/ChangeLog.d/fix-tls12-rsa-pss-sigalgs.txt new file mode 100644 index 0000000000..34296b602e --- /dev/null +++ b/ChangeLog.d/fix-tls12-rsa-pss-sigalgs.txt @@ -0,0 +1,4 @@ +Bugfix + * Fix a TLS 1.2 regression that caused clients to reject valid + ServerKeyExchange signatures using RSA-PSS signature algorithms. + Fixes #10668. diff --git a/ChangeLog.d/pr_10695__fix_build_llvm_mingw.txt b/ChangeLog.d/pr_10695__fix_build_llvm_mingw.txt new file mode 100644 index 0000000000..3fed87143f --- /dev/null +++ b/ChangeLog.d/pr_10695__fix_build_llvm_mingw.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix a build error using the LLVM based MinGW toolchain. + Bug reported and fix contributed by valord577. diff --git a/ChangeLog.d/security-advice.txt b/ChangeLog.d/security-advice.txt new file mode 100644 index 0000000000..1f7677a882 --- /dev/null +++ b/ChangeLog.d/security-advice.txt @@ -0,0 +1,2 @@ +Security + * Added advice about compiler options in SECURITY.md. diff --git a/SECURITY.md b/SECURITY.md index e36162abd7..b485d0112e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -107,6 +107,12 @@ model, they need to be mitigated by physical countermeasures. ### Caveats +#### Compiler-induced side channels + +Mbed TLS is mostly written in C. We use standard C except with known compilers, so we do not expect compilers to introduce direct vulnerabilities. However, compilers can introduce [timing side channels](#timing-attacks) in code that was intended to be constant-time. Mbed TLS includes countermeasures to try to prevent this. But given the diversity of compilers, compiler options and target platforms, this prevention may not be complete. + +We recommend compiling Mbed TLS with commonly used levels of optimizations, such as `-O2` or `-Os`. We will generally treat exploitable timing side channels as a vulnerability if they appear with a common compiler at a common level of optimization. Higher levels of optimization such as `-O3` or `-Oz` are still likely to be safe but are less scrutinized. We do not recommend using individual options that might introduce data-dependent timing, and we will not try to work around such optimizations if they are not part of a commonly used level. + #### Out-of-scope countermeasures Mbed TLS has evolved organically and a well defined threat model hasn't always diff --git a/framework b/framework index dff9da0443..e92a819966 160000 --- a/framework +++ b/framework @@ -1 +1 @@ -Subproject commit dff9da04438d712f7647fd995bc90fadd0c0e2ce +Subproject commit e92a81996656d82941a9afce843453c57e1d51f5 diff --git a/include/mbedtls/debug.h b/include/mbedtls/debug.h index b8273bc757..8cd101cbf4 100644 --- a/include/mbedtls/debug.h +++ b/include/mbedtls/debug.h @@ -59,7 +59,7 @@ */ #if defined(__has_attribute) #if __has_attribute(format) -#if defined(__MINGW32__) +#if defined(__MINGW32__) && !defined(__clang__) #define MBEDTLS_PRINTF_ATTRIBUTE(string_index, first_to_check) \ __attribute__((__format__(gnu_printf, string_index, first_to_check))) #else /* defined(__MINGW32__) */ diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f1b7c74aba..5436a96d42 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -361,7 +361,7 @@ foreach(target IN LISTS tf_psa_crypto_library_targets) RENAME "libmbedcrypto.so.${MBEDTLS_VERSION}" ) install(CODE " - set(_libdir \"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") + set(_libdir \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\") execute_process(COMMAND \"\${CMAKE_COMMAND}\" -E create_symlink \"libmbedcrypto.so.${MBEDTLS_VERSION}\" diff --git a/library/mbedtls_check_config.h b/library/mbedtls_check_config.h index f6ca813a37..b482771714 100644 --- a/library/mbedtls_check_config.h +++ b/library/mbedtls_check_config.h @@ -60,7 +60,7 @@ #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ ( !defined(MBEDTLS_CAN_ECDH) || !defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(PSA_WANT_ALG_RSA_PKCS1V15_CRYPT) || !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) ) + !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) ) #error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" #endif @@ -138,10 +138,19 @@ defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) -#error "One or more versions of the TLS protocol are enabled " \ - "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" +#error "TLS 1.2 protocol is enabled but no key exchange method is defined" \ + "with MBEDTLS_KEY_EXCHANGE_xxxx" #endif +#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && \ + !(defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED) || \ + defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) || \ + defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) ) +#error "TLS 1.3 protocol is enabled but no key exchange method is defined" \ + "with MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_xxxx" +#endif + + #if defined(MBEDTLS_SSL_EARLY_DATA) && \ ( !defined(MBEDTLS_SSL_SESSION_TICKETS) || \ ( !defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) && \ diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c index a0170d51f6..c101ccd91e 100644 --- a/library/ssl_tls12_client.c +++ b/library/ssl_tls12_client.c @@ -12,6 +12,7 @@ #include "mbedtls/platform.h" #include "mbedtls/ssl.h" +#include "ssl_debug_helpers.h" #include "ssl_client.h" #include "debug_internal.h" #include "mbedtls/error.h" @@ -1742,32 +1743,77 @@ static int ssl_parse_signature_algorithm(mbedtls_ssl_context *ssl, { if (mbedtls_ssl_get_pk_sigalg_and_md_alg_from_sig_alg(sig_alg, pk_alg, md_alg) != 0) { MBEDTLS_SSL_DEBUG_MSG(1, - ("Server used unsupported value in SigAlg extension 0x%04x", - sig_alg)); + ("Server used unsupported %s signature algorithm", + mbedtls_ssl_sig_alg_to_str(sig_alg))); return MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER; } /* - * mbedtls_ssl_get_pk_sigalg_and_md_alg_from_sig_alg() understands sig_alg code points across - * TLS versions. Make sure that the received sig_alg extension is valid in TLS 1.2. + * mbedtls_ssl_get_pk_sigalg_and_md_alg_from_sig_alg() understands + * signature algorithm code points from both TLS 1.2 and TLS 1.3. Make sure + * that the selected signature algorithm is acceptable when TLS 1.2 is + * negotiated. + * + * In TLS 1.2, RSA-PSS signature algorithms (rsa_pss_rsae_*) are not + * defined by RFC 5246. However, RFC 8446 Section 4.2.3 requires that + * implementations which advertise support for RSASSA-PSS must be + * prepared to accept such signatures even when TLS 1.2 is negotiated, + * provided they were offered in the signature_algorithms extension. + * + * Therefore, we allow rsa_pss_rsae_* here if: + * - the implementation supports them, and + * - they were offered in the signature_algorithms extension (checked by + * `mbedtls_ssl_sig_alg_is_offered()` below). + * + * If we were to add full support for rsa_pss_rsae_* signature algorithms + * in TLS 1.2 (not defined by RFC 5246; RFC 8446 requires implementations + * that advertise RSASSA-PSS to accept such signatures even when TLS 1.2 + * is negotiated; in practice, several TLS implementations also offer and + * use these algorithms in TLS 1.2-only configurations), we should then + * integrate RSA-PSS into the TLS 1.2 signature algorithm support logic + * (`mbedtls_ssl_tls12_sig_alg_is_supported()`) instead of handling it as a + * special case here. */ if (!mbedtls_ssl_sig_alg_is_supported(ssl, sig_alg)) { - MBEDTLS_SSL_DEBUG_MSG(1, - ("Server used unsupported value in SigAlg extension 0x%04x", - sig_alg)); - return MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER; + switch (sig_alg) { +#if defined(PSA_WANT_ALG_RSA_PSS) +#if defined(PSA_WANT_ALG_SHA_256) + case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA256: +#endif +#if defined(PSA_WANT_ALG_SHA_384) + case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA384: +#endif +#if defined(PSA_WANT_ALG_SHA_512) + case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA512: +#endif +#if defined(PSA_WANT_ALG_SHA_256) || defined(PSA_WANT_ALG_SHA_384) || defined(PSA_WANT_ALG_SHA_512) + MBEDTLS_SSL_DEBUG_MSG(3, + ( + "Accepting TLS 1.2 RSA-PSS signature algorithm %s via compatibility exception", + mbedtls_ssl_sig_alg_to_str(sig_alg))); + break; +#endif +#endif /* PSA_WANT_ALG_RSA_PSS */ + default: + MBEDTLS_SSL_DEBUG_MSG(1, + ("Server used unsupported %s signature algorithm", + mbedtls_ssl_sig_alg_to_str(sig_alg))); + return MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER; + } } /* * Check if the signature algorithm is acceptable */ if (!mbedtls_ssl_sig_alg_is_offered(ssl, sig_alg)) { - MBEDTLS_SSL_DEBUG_MSG(1, ("Server used SigAlg value 0x%04x that was not offered", sig_alg)); + MBEDTLS_SSL_DEBUG_MSG(1, + ("Server used the signature algorithm %s that was not offered", + mbedtls_ssl_sig_alg_to_str(sig_alg))); return MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER; } - MBEDTLS_SSL_DEBUG_MSG(2, ("Server used SignatureAlgorithm %d", sig_alg & 0x00FF)); - MBEDTLS_SSL_DEBUG_MSG(2, ("Server used HashAlgorithm %d", sig_alg >> 8)); + MBEDTLS_SSL_DEBUG_MSG(2, ("Server used the signature algorithm %s", + mbedtls_ssl_sig_alg_to_str(sig_alg))); return 0; } diff --git a/scripts/maintainer/maintainer_scripts_path.py b/scripts/maintainer/maintainer_scripts_path.py new file mode 100644 index 0000000000..0ea13110cc --- /dev/null +++ b/scripts/maintainer/maintainer_scripts_path.py @@ -0,0 +1,20 @@ +"""Add our Python library directories for maintainer scripts to the module search path. + +Usage: + + import maintainer_scripts_path # pylint: disable=unused-import +""" + +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later +# + +import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), + os.path.pardir, os.path.pardir, + 'framework', 'scripts')) +sys.path.append(os.path.join(os.path.dirname(__file__), + os.path.pardir, os.path.pardir, + 'framework', 'util')) diff --git a/tests/scripts/analyze_outcomes.py b/tests/scripts/analyze_outcomes.py index b6f18c5b88..1a73a2a619 100755 --- a/tests/scripts/analyze_outcomes.py +++ b/tests/scripts/analyze_outcomes.py @@ -6,34 +6,37 @@ This script can also run on outcomes from a partial run, but the results are less likely to be useful. """ +# Copyright The Mbed TLS Contributors +# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later + +import importlib +import importlib.machinery +import importlib.util +import os import re import typing import scripts_path # pylint: disable=unused-import from mbedtls_framework import outcome_analysis +from mbedtls_framework import typing_util + + +class CryptoAnalyzeOutcomesType(typing_util.Protocol): + """Our expectations on tf-psa-crypto/tests/scripts/tf_psa_crypto_test_case_info.py. + + See CoverageTask._load_crypto_module(). + """ + #pylint: disable=too-few-public-methods + + # Test cases that are about internal aspects of TF-PSA-Crypto, + # which Mbed TLS is therefore not required to cover. + INTERNAL_TEST_CASES: outcome_analysis.TestCaseSetDescription class CoverageTask(outcome_analysis.CoverageTask): """Justify test cases that are never executed.""" - @staticmethod - def _has_word_re(words: typing.Iterable[str], - exclude: typing.Optional[str] = None) -> typing.Pattern: - """Construct a regex that matches if any of the words appears. - - The occurrence must start and end at a word boundary. - - If exclude is specified, strings containing a match for that - regular expression will not match the returned pattern. - """ - exclude_clause = r'' - if exclude: - exclude_clause = r'(?!.*' + exclude + ')' - return re.compile(exclude_clause + - r'.*\b(?:' + r'|'.join(words) + r')\b.*', - re.DOTALL) - - IGNORED_TESTS = { + UNCOVERED_TESTS = { 'ssl-opt': [ # We don't run ssl-opt.sh with Valgrind on the CI because # it's extremely slow. We don't intend to change this. @@ -71,12 +74,6 @@ class CoverageTask(outcome_analysis.CoverageTask): # https://github.com/Mbed-TLS/mbedtls/issues/9586 'Config: !MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED', ], - 'test_suite_config.crypto_combinations': [ - # New thing in crypto. Not intended to be tested separately - # in mbedtls. - # https://github.com/Mbed-TLS/mbedtls/issues/10300 - 'Config: entropy: NV seed only', - ], 'test_suite_config.psa_boolean': [ # We don't test with HMAC disabled. # https://github.com/Mbed-TLS/mbedtls/issues/9591 @@ -227,6 +224,51 @@ class CoverageTask(outcome_analysis.CoverageTask): ], } + def _load_crypto_module(self) -> None: + """Try to load the information about test cases from the tf-psa-crypto submodule..""" + # All this complexity is because we don't want to add the directory + # to the import path. + if self.crypto_module is not None: + return + crypto_script_path = 'tf-psa-crypto/tests/scripts/tf_psa_crypto_test_case_info.py' + if not os.path.exists(crypto_script_path): + # During a transition period, while the crypto script is not + # yet present in all branches we care about, allow it not to + # exist. + return + crypto_spec = importlib.util.spec_from_file_location( + 'tf_psa_crypto_test_case_info', + crypto_script_path) + # Assertions and type annotation to help mypy. + assert crypto_spec is not None + assert crypto_spec.loader is not None + self.crypto_module: typing.Optional[CryptoAnalyzeOutcomesType] = \ + importlib.util.module_from_spec(crypto_spec) + crypto_spec.loader.exec_module(self.crypto_module) + + def _load_crypto_instructions(self) -> None: + """Try to load instructions from the tf-psa-crypto submodule's outcome analysis.""" + self._load_crypto_module() + if self.crypto_module is not None: + crypto_internal_test_cases = self.crypto_module.INTERNAL_TEST_CASES + else: + # Legacy set of tests covered by TF-PSA-Crypto only, + # from before Mbed TLS's outcome analysis read that information + # from TF-PSA-Crypto. This branch can be removed once + # the presence of the crypto module becomes mandatory. + crypto_internal_test_cases = { + 'test_suite_config.crypto_combinations': [ + 'Config: entropy: NV seed only', + ], + } + self.ignored_tests.extend(crypto_internal_test_cases) + + def __init__(self, options) -> None: + super().__init__(options) + self.crypto_module = None # declared with a type in _load_crypto_module above + self._load_crypto_instructions() + + # List of tasks with a function that can handle this task and additional arguments if required KNOWN_TASKS: typing.Dict[str, typing.Type[outcome_analysis.Task]] = { 'analyze_coverage': CoverageTask, diff --git a/tests/scripts/components-build-system.sh b/tests/scripts/components-build-system.sh index ce923b5cc4..bf0262484e 100644 --- a/tests/scripts/components-build-system.sh +++ b/tests/scripts/components-build-system.sh @@ -155,6 +155,60 @@ support_test_cmake_as_package_install () { support_test_cmake_out_of_source } +component_test_cmake_install_with_destdir () { + # Remove existing generated files so that we use the ones CMake + # generates + $MAKE_COMMAND neat + + msg "install: cmake with DESTDIR staging" + MBEDTLS_ROOT_DIR="$PWD" + mkdir "$OUT_OF_SOURCE_DIR" + cd "$OUT_OF_SOURCE_DIR" + cmake -DGEN_FILES=ON -DENABLE_PROGRAMS=OFF -DENABLE_TESTING=OFF -DUSE_SHARED_MBEDTLS_LIBRARY=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr "$MBEDTLS_ROOT_DIR" + make + + DESTDIR="$OUT_OF_SOURCE_DIR/stage" make install + + install_lib_subdir="$(sed -n 's/^CMAKE_INSTALL_LIBDIR:PATH=//p' CMakeCache.txt)" + [ -n "$install_lib_subdir" ] # Failed to read CMAKE_INSTALL_LIBDIR from CMakeCache.txt + + install_lib_path="$OUT_OF_SOURCE_DIR/stage/usr/${install_lib_subdir}" + + if [[ "$OSTYPE" == darwin* ]]; then + # On macOS the custom install logic installs libmbedcrypto.dylib + # directly without a versioned symlink chain. + for lib in tfpsacrypto mbedcrypto mbedx509 mbedtls; do + [ -f "$install_lib_path/lib${lib}.a" ] + [ -e "$install_lib_path/lib${lib}.dylib" ] + done + else + # library/CMakeLists.txt installs libmbedcrypto.so with a versioned + # symlink chain on Linux. + for lib in tfpsacrypto mbedcrypto mbedx509 mbedtls; do + if [ "$QUIET" -eq 0 ]; then + echo "Checking lib=$lib" + fi + [ -f "$install_lib_path/lib${lib}.a" ] + [ -L "$install_lib_path/lib${lib}.so" ] + [ -e "$install_lib_path/lib${lib}.so" ] + + # Match ABI-version names such as libxxx.so.17 + # and check that symlink. + versioned=( "$install_lib_path/lib${lib}.so".+([0-9]) ) + if [ "$QUIET" -eq 0 ]; then + declare -p versioned + fi + [ "${#versioned[@]}" -eq 1 ] + [ -L "${versioned[0]}" ] + [ -e "${versioned[0]}" ] + done + fi +} + +support_test_cmake_install_with_destdir () { + support_test_cmake_out_of_source +} + component_build_cmake_custom_config_file () { # Make a copy of config file to use for the in-tree test cp "$CONFIG_H" include/mbedtls_config_in_tree_copy.h diff --git a/tests/scripts/depends.py b/tests/scripts/depends.py index a9d1d09507..24f120b05e 100755 --- a/tests/scripts/depends.py +++ b/tests/scripts/depends.py @@ -274,9 +274,9 @@ REVERSE_DEPENDENCIES = { 'PSA_WANT_ALG_JPAKE': ['MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED'], 'PSA_WANT_ALG_RSA_OAEP': ['PSA_WANT_ALG_RSA_PSS', 'MBEDTLS_X509_RSASSA_PSS_SUPPORT'], - 'PSA_WANT_ALG_RSA_PKCS1V15_CRYPT': ['PSA_WANT_ALG_RSA_PKCS1V15_SIGN', - 'MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED'], + 'PSA_WANT_ALG_RSA_PKCS1V15_SIGN': ['MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED'], 'PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC': [ + 'PSA_WANT_ALG_RSA_PKCS1V15_SIGN', 'PSA_WANT_ALG_RSA_PKCS1V15_CRYPT', 'PSA_WANT_ALG_RSA_OAEP', 'PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY', @@ -495,6 +495,7 @@ class DomainData: 'PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC', 'PSA_WANT_ALG_RSA_OAEP', 'PSA_WANT_ALG_RSA_PKCS1V15_CRYPT', + 'PSA_WANT_ALG_RSA_PKCS1V15_SIGN', 'PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC', 'MBEDTLS_X509_RSASSA_PSS_SUPPORT'], build_and_test), diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 47ff800ed1..4a4ee4d1ef 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -13938,7 +13938,6 @@ run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->O" \ -c "Protocol is TLSv1.2" \ -c "HTTP/1.0 200 [Oo][Kk]" - requires_gnutls_tls1_3 requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 requires_config_enabled MBEDTLS_DEBUG_C @@ -13954,6 +13953,43 @@ run_test "TLS 1.2: Check rsa_pss_rsae compatibility issue, m->G" \ -c "Protocol is TLSv1.2" \ -c "HTTP/1.0 200 [Oo][Kk]" +requires_openssl_tls1_3_with_compatible_ephemeral +requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 +requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 +requires_config_enabled MBEDTLS_DEBUG_C +requires_config_enabled MBEDTLS_SSL_CLI_C +requires_config_enabled PSA_WANT_ALG_RSA_PSS +requires_config_enabled PSA_WANT_ALG_SHA_256 +run_test "TLS 1.2: Server forces TLS 1.2 and rsa_pss_rsae_sha256, m->O" \ + "$O_NEXT_SRV_NO_CERT -cert $DATA_FILES_PATH/server2-sha256.crt -key $DATA_FILES_PATH/server2.key + -tls1_2 -sigalgs rsa_pss_rsae_sha256 " \ + "$P_CLI debug_level=3" \ + 0 \ + -c "sent signature scheme \\[804\\] rsa_pss_rsae_sha256" \ + -c "Perform .* computation of digest of ServerKeyExchange" \ + -c "Server used the signature algorithm rsa_pss_rsae_sha256" \ + -c "Protocol is TLSv1.2" \ + -c "HTTP/1.0 200 [Oo][Kk]" + +requires_gnutls_tls1_3 +requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 +requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3 +requires_config_enabled MBEDTLS_DEBUG_C +requires_config_enabled MBEDTLS_SSL_CLI_C +requires_config_enabled PSA_WANT_ALG_RSA_PSS +requires_config_enabled PSA_WANT_ALG_SHA_256 +run_test "TLS 1.2: Server forces TLS 1.2 and rsa_pss_rsae_sha256, m->G" \ + "$G_NEXT_SRV_NO_CERT --x509certfile $DATA_FILES_PATH/server2-sha256.crt --x509keyfile $DATA_FILES_PATH/server2.key + --disable-client-cert + --priority=NORMAL:-VERS-ALL:+VERS-TLS1.2:-SIGN-ALL:+SIGN-RSA-PSS-RSAE-SHA256" \ + "$P_CLI debug_level=3" \ + 0 \ + -c "sent signature scheme \\[804\\] rsa_pss_rsae_sha256" \ + -c "Perform .* computation of digest of ServerKeyExchange" \ + -c "Server used the signature algorithm rsa_pss_rsae_sha256" \ + -c "Protocol is TLSv1.2" \ + -c "HTTP/1.0 200 [Oo][Kk]" + requires_config_enabled MBEDTLS_SSL_SRV_C requires_config_enabled MBEDTLS_DEBUG_C requires_config_enabled MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED diff --git a/tf-psa-crypto b/tf-psa-crypto index 426f86031a..93fa04691f 160000 --- a/tf-psa-crypto +++ b/tf-psa-crypto @@ -1 +1 @@ -Subproject commit 426f86031a37bf317fbf0fee9251eb6e612ae58e +Subproject commit 93fa04691f6d5628f51a369953856bf5bf75d31f