Skip to content

Commit

Permalink
Merge pull request #34 from eleuzi01/replace-ecc-keys
Browse files Browse the repository at this point in the history
Replace MBEDTLS_PK_HAVE_ECC_KEYS with PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY

Validated for dev by the CI of Mbed-TLS/mbedtls#9492, for 3.6 by the CI of Mbed-TLS/mbedtls#9640.
  • Loading branch information
ronald-cron-arm authored Sep 30, 2024
2 parents 4e9e839 + f7b2465 commit 33ac133
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion scripts/generate_config_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
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,
Expand Down Expand Up @@ -87,7 +88,13 @@ 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'
#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
Expand Down
9 changes: 8 additions & 1 deletion scripts/generate_pkcs7_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import sys
from os.path import exists
from mbedtls_framework import build_tree

PKCS7_TEST_FILE = "../suites/test_suite_pkcs7.data"

Expand All @@ -37,7 +38,13 @@ 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):
Expand Down

0 comments on commit 33ac133

Please sign in to comment.