From 29697c90ff089bb1181c351286561b02060cb3e6 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 7 Jan 2026 16:06:45 +0100 Subject: [PATCH] Support new destructor in PSA Crypto API 1.4 Recognize `PSA_ALG_SIGN_SUPPORTS_CONTEXT` as a destructor. Signed-off-by: Gilles Peskine --- scripts/mbedtls_framework/macro_collector.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/mbedtls_framework/macro_collector.py b/scripts/mbedtls_framework/macro_collector.py index bc10418b3..5db80df1e 100644 --- a/scripts/mbedtls_framework/macro_collector.py +++ b/scripts/mbedtls_framework/macro_collector.py @@ -281,7 +281,11 @@ class PSAMacroCollector(PSAMacroEnumerator): # Macro that is a destructor, not a constructor (i.e. takes a thing as # an argument and analyzes it, rather than constructing a thing). - _destructor_name_re = re.compile(r'.*(_GET_|_HAS_|_IS_)|.*_LENGTH\Z') + _destructor_name_re = re.compile('|'.join([ + r'.*(?:_GET_|_HAS_|_IS_)', + r'.*_LENGTH\Z', + r'PSA_ALG_SIGN_SUPPORTS_CONTEXT\Z', + ])) # Macro that converts between things, rather than building a thing from # scratch.