diff --git a/scripts/check_names.py b/scripts/check_names.py index 8f344448e..12daae090 100755 --- a/scripts/check_names.py +++ b/scripts/check_names.py @@ -44,7 +44,7 @@ import shutil import subprocess import logging -import scripts_path # pylint: disable=unused-import +import project_scripts # pylint: disable=unused-import from mbedtls_framework import build_tree @@ -235,70 +235,110 @@ class CodeParser(): ) all_macros = {"public": [], "internal": [], "private":[]} - all_macros["public"] = self.parse_macros([ - "include/mbedtls/*.h", - "include/psa/*.h", - "tf-psa-crypto/include/psa/*.h", - "tf-psa-crypto/include/tf-psa-crypto/*.h", - "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", - "tf-psa-crypto/drivers/everest/include/everest/everest.h", - "tf-psa-crypto/drivers/everest/include/everest/x25519.h" - ]) - all_macros["internal"] = self.parse_macros([ - "library/*.h", - "tf-psa-crypto/core/*.h", - "tf-psa-crypto/drivers/builtin/src/*.h", - "framework/tests/include/test/drivers/*.h", - ]) - all_macros["private"] = self.parse_macros([ - "library/*.c", - "tf-psa-crypto/core/*.c", - "tf-psa-crypto/drivers/builtin/src/*.c", - ]) - enum_consts = self.parse_enum_consts([ - "include/mbedtls/*.h", - "include/psa/*.h", - "tf-psa-crypto/include/psa/*.h", - "tf-psa-crypto/include/tf-psa-crypto/*.h", - "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", - "library/*.h", - "tf-psa-crypto/core/*.h", - "tf-psa-crypto/drivers/builtin/src/*.h", - "library/*.c", - "tf-psa-crypto/core/*.c", - "tf-psa-crypto/drivers/builtin/src/*.c", - "tf-psa-crypto/drivers/everest/include/everest/everest.h", - "tf-psa-crypto/drivers/everest/include/everest/x25519.h" - ]) - identifiers, excluded_identifiers = self.parse_identifiers([ - "include/mbedtls/*.h", - "include/psa/*.h", - "tf-psa-crypto/include/psa/*.h", - "tf-psa-crypto/include/tf-psa-crypto/*.h", - "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", - "library/*.h", - "tf-psa-crypto/core/*.h", - "tf-psa-crypto/drivers/builtin/src/*.h", - "tf-psa-crypto/drivers/everest/include/everest/everest.h", - "tf-psa-crypto/drivers/everest/include/everest/x25519.h" - ], ["tf-psa-crypto/drivers/p256-m/p256-m/p256-m.h"]) - mbed_psa_words = self.parse_mbed_psa_words([ - "include/mbedtls/*.h", - "include/psa/*.h", - "tf-psa-crypto/include/psa/*.h", - "tf-psa-crypto/include/tf-psa-crypto/*.h", - "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", - "library/*.h", - "tf-psa-crypto/core/*.h", - "tf-psa-crypto/drivers/builtin/src/*.h", - "tf-psa-crypto/drivers/everest/include/everest/everest.h", - "tf-psa-crypto/drivers/everest/include/everest/x25519.h", - "library/*.c", - "tf-psa-crypto/core/*.c", - "tf-psa-crypto/drivers/builtin/src/*.c", - "tf-psa-crypto/drivers/everest/library/everest.c", - "tf-psa-crypto/drivers/everest/library/x25519.c" - ], ["tf-psa-crypto/core/psa_crypto_driver_wrappers.h"]) + if build_tree.is_mbedtls_3_6(): + all_macros["public"] = self.parse_macros([ + "include/mbedtls/*.h", + "include/psa/*.h", + "3rdparty/everest/include/everest/everest.h", + "3rdparty/everest/include/everest/x25519.h" + ]) + all_macros["internal"] = self.parse_macros([ + "library/*.h", + "framework/tests/include/test/drivers/*.h", + ]) + all_macros["private"] = self.parse_macros([ + "library/*.c", + ]) + enum_consts = self.parse_enum_consts([ + "include/mbedtls/*.h", + "include/psa/*.h", + "library/*.h", + "library/*.c", + "3rdparty/everest/include/everest/everest.h", + "3rdparty/everest/include/everest/x25519.h" + ]) + identifiers, excluded_identifiers = self.parse_identifiers([ + "include/mbedtls/*.h", + "include/psa/*.h", + "library/*.h", + "3rdparty/everest/include/everest/everest.h", + "3rdparty/everest/include/everest/x25519.h" + ], ["3rdparty/p256-m/p256-m/p256-m.h"]) + mbed_psa_words = self.parse_mbed_psa_words([ + "include/mbedtls/*.h", + "include/psa/*.h", + "library/*.h", + "3rdparty/everest/include/everest/everest.h", + "3rdparty/everest/include/everest/x25519.h", + "library/*.c", + "3rdparty/everest/library/everest.c", + "3rdparty/everest/library/x25519.c" + ], ["library/psa_crypto_driver_wrappers.h"]) + else: + all_macros["public"] = self.parse_macros([ + "include/mbedtls/*.h", + "include/psa/*.h", + "tf-psa-crypto/include/psa/*.h", + "tf-psa-crypto/include/tf-psa-crypto/*.h", + "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", + "tf-psa-crypto/drivers/everest/include/everest/everest.h", + "tf-psa-crypto/drivers/everest/include/everest/x25519.h" + ]) + all_macros["internal"] = self.parse_macros([ + "library/*.h", + "tf-psa-crypto/core/*.h", + "tf-psa-crypto/drivers/builtin/src/*.h", + "framework/tests/include/test/drivers/*.h", + ]) + all_macros["private"] = self.parse_macros([ + "library/*.c", + "tf-psa-crypto/core/*.c", + "tf-psa-crypto/drivers/builtin/src/*.c", + ]) + enum_consts = self.parse_enum_consts([ + "include/mbedtls/*.h", + "include/psa/*.h", + "tf-psa-crypto/include/psa/*.h", + "tf-psa-crypto/include/tf-psa-crypto/*.h", + "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", + "library/*.h", + "tf-psa-crypto/core/*.h", + "tf-psa-crypto/drivers/builtin/src/*.h", + "library/*.c", + "tf-psa-crypto/core/*.c", + "tf-psa-crypto/drivers/builtin/src/*.c", + "tf-psa-crypto/drivers/everest/include/everest/everest.h", + "tf-psa-crypto/drivers/everest/include/everest/x25519.h" + ]) + identifiers, excluded_identifiers = self.parse_identifiers([ + "include/mbedtls/*.h", + "include/psa/*.h", + "tf-psa-crypto/include/psa/*.h", + "tf-psa-crypto/include/tf-psa-crypto/*.h", + "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", + "library/*.h", + "tf-psa-crypto/core/*.h", + "tf-psa-crypto/drivers/builtin/src/*.h", + "tf-psa-crypto/drivers/everest/include/everest/everest.h", + "tf-psa-crypto/drivers/everest/include/everest/x25519.h" + ], ["tf-psa-crypto/drivers/p256-m/p256-m/p256-m.h"]) + mbed_psa_words = self.parse_mbed_psa_words([ + "include/mbedtls/*.h", + "include/psa/*.h", + "tf-psa-crypto/include/psa/*.h", + "tf-psa-crypto/include/tf-psa-crypto/*.h", + "tf-psa-crypto/drivers/builtin/include/mbedtls/*.h", + "library/*.h", + "tf-psa-crypto/core/*.h", + "tf-psa-crypto/drivers/builtin/src/*.h", + "tf-psa-crypto/drivers/everest/include/everest/everest.h", + "tf-psa-crypto/drivers/everest/include/everest/x25519.h", + "library/*.c", + "tf-psa-crypto/core/*.c", + "tf-psa-crypto/drivers/builtin/src/*.c", + "tf-psa-crypto/drivers/everest/library/everest.c", + "tf-psa-crypto/drivers/everest/library/x25519.c" + ], ["tf-psa-crypto/core/psa_crypto_driver_wrappers.h"]) symbols = self.parse_symbols() # Remove identifier macros like mbedtls_printf or mbedtls_calloc