Make PSA headers more self-contained
Several files among include/psa/crypto_*.h are not meant to be included directly, and are not guaranteed to be valid if included directly. This makes it harder to perform some static analyses. So make these files more self-contained so that at least, if included on their own, there is no missing macro or type definition (excluding the deliberate use of forward declarations of structs and unions). Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
e0bbedfe7a
commit
09c02ee95f
3 changed files with 5 additions and 1 deletions
|
@ -42,6 +42,9 @@
|
||||||
* of these types. */
|
* of these types. */
|
||||||
#include "crypto_types.h"
|
#include "crypto_types.h"
|
||||||
#include "crypto_values.h"
|
#include "crypto_values.h"
|
||||||
|
/* Include size definitions which are used to size some arrays in operation
|
||||||
|
* structures. */
|
||||||
|
#include <psa/crypto_sizes.h>
|
||||||
|
|
||||||
/** For encrypt-decrypt functions, whether the operation is an encryption
|
/** For encrypt-decrypt functions, whether the operation is an encryption
|
||||||
* or a decryption. */
|
* or a decryption. */
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "mbedtls/platform_util.h"
|
#include "mbedtls/platform_util.h"
|
||||||
|
|
||||||
|
#include "crypto_types.h"
|
||||||
#include "crypto_compat.h"
|
#include "crypto_compat.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -186,7 +186,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
uint8_t *MBEDTLS_PRIVATE(info);
|
uint8_t *MBEDTLS_PRIVATE(info);
|
||||||
size_t MBEDTLS_PRIVATE(info_length);
|
size_t MBEDTLS_PRIVATE(info_length);
|
||||||
psa_mac_operation_t MBEDTLS_PRIVATE(hmac);
|
struct psa_mac_operation_s MBEDTLS_PRIVATE(hmac);
|
||||||
uint8_t MBEDTLS_PRIVATE(prk)[PSA_HASH_MAX_SIZE];
|
uint8_t MBEDTLS_PRIVATE(prk)[PSA_HASH_MAX_SIZE];
|
||||||
uint8_t MBEDTLS_PRIVATE(output_block)[PSA_HASH_MAX_SIZE];
|
uint8_t MBEDTLS_PRIVATE(output_block)[PSA_HASH_MAX_SIZE];
|
||||||
#if PSA_HASH_MAX_SIZE > 0xff
|
#if PSA_HASH_MAX_SIZE > 0xff
|
||||||
|
|
Loading…
Reference in a new issue