From a651607b378b867de35cf384faa4ab7c4597e3df Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 4 Jan 2023 19:52:38 +0100 Subject: [PATCH] Skip restyling of PSA macros also defined in psa-arch-tests Some preprocessor macro definitions must have a specific expansion so that the same macro name can be defined in different products. The definition of having the same expansion (per the C language specification) means the same sequence of tokens, and also the same absence/presence of spacing between tokens. Two macros are also defined in headers in the PSA Compliance test suite, so the test suite would fail to build if we changed the definitions. Preserve those definitions. Technically this is a bug in the test suite, since having extra spaces (or even a completely different constant expression with the same value) would still be compliant. Bug reported as https://github.com/ARM-software/psa-arch-tests/issues/337 Signed-off-by: Gilles Peskine --- include/psa/crypto_values.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index 9a0ff46148..ff50f7e4bf 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -892,7 +892,9 @@ (alg) & PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG) /** An invalid algorithm identifier value. */ +/* *INDENT-OFF* (https://github.com/ARM-software/psa-arch-tests/issues/337) */ #define PSA_ALG_NONE ((psa_algorithm_t)0) +/* *INDENT-ON* */ #define PSA_ALG_HASH_MASK ((psa_algorithm_t)0x000000ff) /** MD5 */ @@ -2387,7 +2389,9 @@ /** The null key identifier. */ +/* *INDENT-OFF* (https://github.com/ARM-software/psa-arch-tests/issues/337) */ #define PSA_KEY_ID_NULL ((psa_key_id_t)0) +/* *INDENT-ON* */ /** The minimum value for a key identifier chosen by the application. */ #define PSA_KEY_ID_USER_MIN ((psa_key_id_t)0x00000001)