1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Add some missing compilation guards

Add missing checks for defined(MBEDTLS_MD_C) around types and
functions that require it (HMAC, HKDF, TLS12_PRF).

Add missing checks for defined(MBEDTLS_ECDSA_DETERMINISTIC) around
code that calls mbedtls_ecdsa_sign_det().

Add missing checks for defined(MBEDTLS_ECDH_C) around ECDH-specific
functions.
This commit is contained in:
Gilles Peskine
2018-11-16 16:02:56 +01:00
parent 353e45361d
commit a05219c70b
2 changed files with 26 additions and 3 deletions

View File

@ -85,7 +85,7 @@ struct psa_hash_operation_s
} ctx;
};
#if defined(MBEDTLS_MD_C)
typedef struct
{
/** The hash context. */
@ -93,7 +93,7 @@ typedef struct
/** The HMAC part of the context. */
uint8_t opad[PSA_HMAC_MAX_HASH_BLOCK_SIZE];
} psa_hmac_internal_data;
#endif /* MBEDTLS_MD_C */
struct psa_mac_operation_s
{
@ -130,6 +130,7 @@ struct psa_cipher_operation_s
} ctx;
};
#if defined(MBEDTLS_MD_C)
typedef struct
{
uint8_t *info;
@ -143,7 +144,9 @@ typedef struct
uint8_t offset_in_block;
uint8_t block_number;
} psa_hkdf_generator_t;
#endif /* MBEDTLS_MD_C */
#if defined(MBEDTLS_MD_C)
typedef struct psa_tls12_prf_generator_s
{
/* The TLS 1.2 PRF uses the key for each HMAC iteration,
@ -172,6 +175,7 @@ typedef struct psa_tls12_prf_generator_s
uint8_t block_number;
} psa_tls12_prf_generator_t;
#endif /* MBEDTLS_MD_C */
struct psa_crypto_generator_s
{