From 9bbba5ea69244f333883070fb63feb841dd164e9 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 12 Jan 2021 00:55:55 +0100 Subject: [PATCH] Add a function to remove classic crypto dependencies A list of symbols to remove will be added in a subsequent commit. Signed-off-by: Gilles Peskine --- tests/scripts/set_psa_test_dependencies.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/scripts/set_psa_test_dependencies.py b/tests/scripts/set_psa_test_dependencies.py index 8bbb711a6c..8deff8226c 100755 --- a/tests/scripts/set_psa_test_dependencies.py +++ b/tests/scripts/set_psa_test_dependencies.py @@ -22,6 +22,15 @@ import os import re import sys +CLASSIC_DEPENDENCIES = frozenset([ +]) + +def is_classic_dependency(dep): + """Whether dep is a classic dependency that PSA test cases should not use.""" + if dep.startswith('!'): + dep = dep[1:] + return dep in CLASSIC_DEPENDENCIES + def is_systematic_dependency(dep): """Whether dep is a PSA dependency which is determined systematically.""" return dep.startswith('PSA_WANT_') @@ -50,7 +59,8 @@ def updated_dependencies(file_name, function_name, arguments, dependencies): """ automatic = systematic_dependencies(file_name, function_name, arguments) manual = [dep for dep in dependencies - if not is_systematic_dependency(dep)] + if not (is_systematic_dependency(dep) or + is_classic_dependency(dep))] return automatic + manual def keep_manual_dependencies(file_name, function_name, arguments):