1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Add infrastructure for key attribute flags

Add infrastructure for internal, external and dual-use flags, with a
compile-time check (if static_assert is available) to ensure that the
same numerical value doesn't get declared for two different purposes
in crypto_struct.h (external or dual-use) and
psa_crypto_core.h (internal).
This commit is contained in:
Gilles Peskine
2019-08-02 19:19:39 +02:00
parent 0c77b0e2f9
commit 91e8c33f48
3 changed files with 45 additions and 1 deletions

View File

@@ -64,6 +64,11 @@ typedef struct
} data;
} psa_key_slot_t;
/* A mask of key attribute flags used only internally.
* Currently there aren't any. */
#define MBEDTLS_PSA_KA_MASK_INTERNAL_ONLY ( \
0 )
/** Test whether a key slot is occupied.
*
* A key slot is occupied iff the key type is nonzero. This works because