From 21a6a20c84179eb72485945a2d78f234279d837a Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 25 Sep 2024 11:54:13 +0100 Subject: [PATCH] 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):