Adapt source file names from Mbed TLS 3.0 to 2.27

* There's no compat-2.x.h in Mbed TLS 2.x, but there's a compat-1.3.h which
  similarly needs to be excluded.
* mbedtls_config.h is called config.h.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2021-09-27 20:12:00 +02:00
parent 5b4caf21de
commit d47f636a19

View file

@ -225,7 +225,7 @@ class CodeParser():
# Globally excluded filenames.
# Note that "*" can match directory separators in exclude lists.
self.excluded_files = ["*/bn_mul", "*/compat-2.x.h"]
self.excluded_files = ["*/bn_mul", "*/compat-1.3.h"]
@staticmethod
def check_repo_path():
@ -580,8 +580,8 @@ class CodeParser():
# Back up the config and atomically compile with the full configratuion.
shutil.copy(
"include/mbedtls/mbedtls_config.h",
"include/mbedtls/mbedtls_config.h.bak"
"include/mbedtls/config.h",
"include/mbedtls/config.h.bak"
)
try:
# Use check=True in all subprocess calls so that failures are raised
@ -628,8 +628,8 @@ class CodeParser():
# Put back the original config regardless of there being errors.
# Works also for keyboard interrupts.
shutil.move(
"include/mbedtls/mbedtls_config.h.bak",
"include/mbedtls/mbedtls_config.h"
"include/mbedtls/config.h.bak",
"include/mbedtls/config.h"
)
return symbols