From 9de97d7773d98fd57eab08c0b03a14fa9ee9b2c7 Mon Sep 17 00:00:00 2001 From: Hanno Becker Date: Mon, 19 Nov 2018 14:05:48 +0000 Subject: [PATCH] Don't use multiline comments in enums to silence check-names.sh The sanity checking script tests/scripts/check-names.sh uses a simple state machine paired with a sequence of `sed` commands to extract enumeration constants from the code. This code, however, doesn't work properly when using multiline comments in enumerations such as recently done in the constants MBEDTLS_CIPHER_PSA_KEY_XXX. This commit doesn't attempt to make check-names.sh more robust but instead uses /* ... */ comment indicators in each comment line, while silences check-names.sh. Increasing the robustness of check-names.sh is instead tracked in #2210. --- include/mbedtls/cipher_internal.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/mbedtls/cipher_internal.h b/include/mbedtls/cipher_internal.h index cecad9a8d..6687b362d 100644 --- a/include/mbedtls/cipher_internal.h +++ b/include/mbedtls/cipher_internal.h @@ -122,16 +122,16 @@ typedef struct typedef enum { MBEDTLS_CIPHER_PSA_KEY_UNSET = 0, - MBEDTLS_CIPHER_PSA_KEY_OWNED, /* Used for PSA-based cipher contexts - * which use raw key material internally - * imported into a freshly allocated key slot, - * and which hence need to destroy that key - * slot when they are no longer needed. */ - MBEDTLS_CIPHER_PSA_KEY_NOT_OWNED, /* Used for PSA-based cipher contexts - * which use a key from a key slot - * provided by the user, and which hence - * should not be destroyed when the - * context is no longer needed. */ + MBEDTLS_CIPHER_PSA_KEY_OWNED, /* Used for PSA-based cipher contexts which */ + /* use raw key material internally imported */ + /* into a allocated key slot, and which */ + /* hence need to destroy that key slot */ + /* when they are no longer needed. */ + MBEDTLS_CIPHER_PSA_KEY_NOT_OWNED, /* Used for PSA-based cipher contexts */ + /* which use a key from a key slot */ + /* provided by the user, and which */ + /* hence should not be destroyed when */ + /* the context is no longer needed. */ } mbedtls_cipher_psa_key_ownership; typedef struct