From 9cfdbe933ef77cf3743773a4aa128e1f0733ea54 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Thu, 24 Oct 2024 15:47:08 +0100 Subject: [PATCH] Undo temporary solution Signed-off-by: Elena Uziunaite --- scripts/generate_config_tests.py | 8 +------- scripts/generate_pkcs7_tests.py | 9 ++------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/scripts/generate_config_tests.py b/scripts/generate_config_tests.py index 28690cb3f..4e5ae54f8 100755 --- a/scripts/generate_config_tests.py +++ b/scripts/generate_config_tests.py @@ -14,7 +14,6 @@ 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, @@ -88,12 +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_'): - #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' + return 'MBEDTLS_PK_C:' + test_case.psa_or_3_6_feature_macro('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 diff --git a/scripts/generate_pkcs7_tests.py b/scripts/generate_pkcs7_tests.py index e79539d0c..6e6fd987d 100755 --- a/scripts/generate_pkcs7_tests.py +++ b/scripts/generate_pkcs7_tests.py @@ -16,7 +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 +from mbedtls_framework import test_case PKCS7_TEST_FILE = "../suites/test_suite_pkcs7.data" @@ -38,12 +38,7 @@ 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(): - mandatory_dep = "MBEDTLS_MD_CAN_SHA256" - else: - mandatory_dep = "PSA_WANT_ALG_SHA_256" + mandatory_dep = test_case.psa_or_3_6_feature_macro("PSA_ALG_SHA_256", "") test_name = "PKCS7 Parse Failure Invalid ASN1" test_function = "pkcs7_asn1_fail:"