mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-10-02 06:57:24 +00:00
Merge branch 'Mbed-TLS:development' into fix/tls12-rsa-pss-sigalgs
This commit is contained in:
@@ -10,14 +10,15 @@ Please remove the segment/s on either side of the | symbol as appropriate, and a
|
|||||||
If the provided content is part of the present PR remove the # symbol.
|
If the provided content is part of the present PR remove the # symbol.
|
||||||
|
|
||||||
- [ ] **changelog** provided | not required because:
|
- [ ] **changelog** provided | not required because:
|
||||||
- [ ] **development PR** provided # | not required because:
|
|
||||||
- [ ] **TF-PSA-Crypto PR** provided # | not required because:
|
|
||||||
- [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required
|
- [ ] **framework PR** provided Mbed-TLS/mbedtls-framework# | not required
|
||||||
- [ ] **3.6 PR** 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:
|
- **tests** provided | not required because:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Notes for the submitter
|
## Notes for the submitter
|
||||||
|
|
||||||
Please refer to the [contributing guidelines](https://github.com/Mbed-TLS/mbedtls/blob/development/CONTRIBUTING.md), especially the
|
Please refer to the [contributing guidelines](https://github.com/Mbed-TLS/mbedtls/blob/development/CONTRIBUTING.md), especially the
|
||||||
|
|||||||
+1
-1
Submodule framework updated: dff9da0443...c6610dde67
@@ -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.
|
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 re
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
import scripts_path # pylint: disable=unused-import
|
import scripts_path # pylint: disable=unused-import
|
||||||
from mbedtls_framework import outcome_analysis
|
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):
|
class CoverageTask(outcome_analysis.CoverageTask):
|
||||||
"""Justify test cases that are never executed."""
|
"""Justify test cases that are never executed."""
|
||||||
|
|
||||||
@staticmethod
|
UNCOVERED_TESTS = {
|
||||||
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 = {
|
|
||||||
'ssl-opt': [
|
'ssl-opt': [
|
||||||
# We don't run ssl-opt.sh with Valgrind on the CI because
|
# We don't run ssl-opt.sh with Valgrind on the CI because
|
||||||
# it's extremely slow. We don't intend to change this.
|
# 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
|
# https://github.com/Mbed-TLS/mbedtls/issues/9586
|
||||||
'Config: !MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED',
|
'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': [
|
'test_suite_config.psa_boolean': [
|
||||||
# We don't test with HMAC disabled.
|
# We don't test with HMAC disabled.
|
||||||
# https://github.com/Mbed-TLS/mbedtls/issues/9591
|
# 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
|
# 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]] = {
|
KNOWN_TASKS: typing.Dict[str, typing.Type[outcome_analysis.Task]] = {
|
||||||
'analyze_coverage': CoverageTask,
|
'analyze_coverage': CoverageTask,
|
||||||
|
|||||||
+1
-1
Submodule tf-psa-crypto updated: 426f86031a...8c29e401e9
Reference in New Issue
Block a user