From 4f80439a5f53be5e597800a0aa44ef36adebd1d3 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Fri, 5 Jul 2024 12:14:16 +0100 Subject: [PATCH 1/4] Replace MBEDTLS_PK_HAVE_ECC_KEYS with PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY Signed-off-by: Elena Uziunaite --- scripts/generate_config_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate_config_tests.py b/scripts/generate_config_tests.py index 54c1eabbe..f3a529054 100755 --- a/scripts/generate_config_tests.py +++ b/scripts/generate_config_tests.py @@ -87,7 +87,7 @@ def dependencies_of_setting(cfg: config_common.Config, if name.startswith('MBEDTLS_CIPHER_PADDING_'): return 'MBEDTLS_CIPHER_C:MBEDTLS_CIPHER_MODE_CBC' if name.startswith('MBEDTLS_PK_PARSE_EC_'): - return 'MBEDTLS_PK_C:MBEDTLS_PK_HAVE_ECC_KEYS' + return 'MBEDTLS_PK_C:PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY' # For TLS settings, insist on having them once off and once on in # a configuration where both client support and server support are # enabled. The settings are also meaningful when only one side is From 010c1f1ae0fb110c58cce5642d3c8b766ffacf64 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 25 Sep 2024 14:51:35 +0100 Subject: [PATCH 2/4] Adapt changes to work with both 3.6 and 4.0 Signed-off-by: Elena Uziunaite --- scripts/generate_config_tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/generate_config_tests.py b/scripts/generate_config_tests.py index f3a529054..5eded853c 100755 --- a/scripts/generate_config_tests.py +++ b/scripts/generate_config_tests.py @@ -14,6 +14,7 @@ import config from mbedtls_framework import config_common from mbedtls_framework import test_case from mbedtls_framework import test_data_generation +from mbedtls_framework import build_tree def single_setting_case(setting: config_common.Setting, when_on: bool, @@ -87,7 +88,14 @@ def dependencies_of_setting(cfg: config_common.Config, if name.startswith('MBEDTLS_CIPHER_PADDING_'): return 'MBEDTLS_CIPHER_C:MBEDTLS_CIPHER_MODE_CBC' if name.startswith('MBEDTLS_PK_PARSE_EC_'): - return 'MBEDTLS_PK_C:PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY' + + #temporary solution to determine correct dependency macros between 3.6 and 4.0 + #see issue #51 in mbedtls-framework + if build_tree.is_mbedtls_3_6(): + return 'MBEDTLS_PK_C:MBEDTLS_PK_HAVE_ECC_KEYS' + else: + return 'MBEDTLS_PK_C:PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY' + # For TLS settings, insist on having them once off and once on in # a configuration where both client support and server support are # enabled. The settings are also meaningful when only one side is From 21a6a20c84179eb72485945a2d78f234279d837a Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 25 Sep 2024 11:54:13 +0100 Subject: [PATCH 3/4] Replace MBEDTLS_MD_CAN_SHA256 with PSA_WANT_ALG_SHA_256 And add temporary solution so it works with 3.6 and 4.0 Temporary solution to be resolved in #51. Signed-off-by: Elena Uziunaite --- scripts/generate_pkcs7_tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/generate_pkcs7_tests.py b/scripts/generate_pkcs7_tests.py index 0e484b023..1acaa3bd9 100755 --- a/scripts/generate_pkcs7_tests.py +++ b/scripts/generate_pkcs7_tests.py @@ -16,6 +16,7 @@ Given a valid DER pkcs7 file add tests to the test_suite_pkcs7.data file import sys from os.path import exists +from mbedtls_framework import build_tree PKCS7_TEST_FILE = "../suites/test_suite_pkcs7.data" @@ -37,7 +38,14 @@ class TestData: Take in test_suite_pkcs7.data file. Allow for new tests to be added. """ - mandatory_dep = "MBEDTLS_MD_CAN_SHA256" + + #temporary solution to determine correct dependency macros between 3.6 and 4.0 + #see issue #51 in mbedtls-framework + if build_tree.is_mbedtls_3_6(): + mandatory_dep = "MBEDTLS_MD_CAN_SHA256" + else: + mandatory_dep = "PSA_WANT_ALG_SHA_256" + test_name = "PKCS7 Parse Failure Invalid ASN1" test_function = "pkcs7_asn1_fail:" def __init__(self, file_name): From f7b24653d7024602b407a0696d5a1700e7e3a552 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Thu, 26 Sep 2024 14:14:01 +0100 Subject: [PATCH 4/4] Remove extra spaces Signed-off-by: Elena Uziunaite --- scripts/generate_config_tests.py | 1 - scripts/generate_pkcs7_tests.py | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/generate_config_tests.py b/scripts/generate_config_tests.py index 5eded853c..93c406a3c 100755 --- a/scripts/generate_config_tests.py +++ b/scripts/generate_config_tests.py @@ -88,7 +88,6 @@ def dependencies_of_setting(cfg: config_common.Config, if name.startswith('MBEDTLS_CIPHER_PADDING_'): return 'MBEDTLS_CIPHER_C:MBEDTLS_CIPHER_MODE_CBC' if name.startswith('MBEDTLS_PK_PARSE_EC_'): - #temporary solution to determine correct dependency macros between 3.6 and 4.0 #see issue #51 in mbedtls-framework if build_tree.is_mbedtls_3_6(): diff --git a/scripts/generate_pkcs7_tests.py b/scripts/generate_pkcs7_tests.py index 1acaa3bd9..e79539d0c 100755 --- a/scripts/generate_pkcs7_tests.py +++ b/scripts/generate_pkcs7_tests.py @@ -38,7 +38,6 @@ class TestData: Take in test_suite_pkcs7.data file. Allow for new tests to be added. """ - #temporary solution to determine correct dependency macros between 3.6 and 4.0 #see issue #51 in mbedtls-framework if build_tree.is_mbedtls_3_6():