From 7f3659a7130aef293093826789eccc91ce8a9f55 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 45c16b0a0..a9fddb797 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -828,7 +828,9 @@ (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_KEY_DERIVATION) /** 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) /** MD2 */ @@ -2094,7 +2096,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)