From e3e8166cdd3e27684c63162fea7d0f3c0c18b67c Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Tue, 11 Jun 2019 14:07:27 +0100 Subject: [PATCH] Move PSA_PRE_1_0_KEY_DERIVATION to crypto_struct.h We want to make the PRF context structure depend on this flag, but crypto_extra.h is included after crypto_struct.h and having the option at its original place would not affect crypto_struct.h. --- include/psa/crypto_extra.h | 10 ---------- include/psa/crypto_struct.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h index 3675ac61b..3fc73b9d3 100644 --- a/include/psa/crypto_extra.h +++ b/include/psa/crypto_extra.h @@ -224,16 +224,6 @@ void mbedtls_psa_get_stats( mbedtls_psa_stats_t *stats ); psa_status_t mbedtls_psa_inject_entropy(const unsigned char *seed, size_t seed_size); -/* - * If this option is not turned on, then the function `psa_key_derivation()` - * is removed. - * - * The sole purpose of this option is to make the transition to the new API - * smoother. Once the transition is complete it can and should be removed - * along with the old API and its implementation. - */ -#define PSA_PRE_1_0_KEY_DERIVATION - #if defined(PSA_PRE_1_0_KEY_DERIVATION) /** Set up a key derivation operation. * diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 977b021b8..0e0ecb22d 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -191,6 +191,17 @@ typedef struct } psa_hkdf_key_derivation_t; #endif /* MBEDTLS_MD_C */ +/* + * If this option is not turned on, then the function `psa_key_derivation()` + * is removed. And the new psa_tls12_prf_key_derivation_t context is used along + * with the corresponding new API. + * + * The sole purpose of this option is to make the transition to the new API + * smoother. Once the transition is complete it can and should be removed + * along with the old API and its implementation. + */ +#define PSA_PRE_1_0_KEY_DERIVATION + #if defined(MBEDTLS_MD_C) typedef struct psa_tls12_prf_key_derivation_s {