mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-07-30 16:26:33 +08:00
Merge branch 'development' into development-restricted
* development: (46 commits) Update tf-psa-crypto pointer to bring in fix for python imports Update framework pointer to bring in fix for python imports check_config: fix error message for missing TLS 1.2 key exchanges check_config: add check for TLS 1.3 key exchanges update ChangeLog Pacify uncrustify ChangeLog: Fixed a reference to TF-PSA-Crypto ssl: add TLS 1.2 RSA-PSS debug trace add ChangeLog Fix build warning/error using llvm-mingw ssl: narrow TLS 1.2 RSA-PSS handling and add interop coverage test: improve symlink checks test: versioned symlink order fix test: reorder if-else structure test: add debug output and fix for win config ChangeLog fix Unify TF-PSA-Crypto and mbedtls templates tests: fix DESTDIR install checks and add macOS compatibility ChangeLog fixes Update crypto submodule with analyze_outcomes.py ...
This commit is contained in:
commit
00dfa64627
13
.github/pull_request_template.md
vendored
13
.github/pull_request_template.md
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
3
ChangeLog.d/cmake-destdir-instal.txt
Normal file
3
ChangeLog.d/cmake-destdir-instal.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Features
|
||||
* Restore DESTDIR support for CMake installs of compatibility
|
||||
libmbedcrypto symlinks. Fixes #10627.
|
||||
4
ChangeLog.d/fix-tls12-rsa-pss-sigalgs.txt
Normal file
4
ChangeLog.d/fix-tls12-rsa-pss-sigalgs.txt
Normal file
@ -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.
|
||||
3
ChangeLog.d/pr_10695__fix_build_llvm_mingw.txt
Normal file
3
ChangeLog.d/pr_10695__fix_build_llvm_mingw.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Bugfix
|
||||
* Fix a build error using the LLVM based MinGW toolchain.
|
||||
Bug reported and fix contributed by valord577.
|
||||
2
ChangeLog.d/security-advice.txt
Normal file
2
ChangeLog.d/security-advice.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Security
|
||||
* Added advice about compiler options in 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
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit dff9da04438d712f7647fd995bc90fadd0c0e2ce
|
||||
Subproject commit e92a81996656d82941a9afce843453c57e1d51f5
|
||||
@ -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__) */
|
||||
|
||||
@ -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}\"
|
||||
|
||||
@ -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) && \
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
20
scripts/maintainer/maintainer_scripts_path.py
Normal file
20
scripts/maintainer/maintainer_scripts_path.py
Normal file
@ -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'))
|
||||
@ -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,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 426f86031a37bf317fbf0fee9251eb6e612ae58e
|
||||
Subproject commit 93fa04691f6d5628f51a369953856bf5bf75d31f
|
||||
Loading…
x
Reference in New Issue
Block a user