mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
Don't access psa_key_attributes_t.core
Access the fields of `psa_key_attributes_t` directly rather than through the `core` field. This makes the `core` field obsolete. This commit is fully automated: ``` git ls-files '*.h' '*.c' '*.function' '*.jinja' | xargs perl -l -i -pe '$core = qr/\b(core\b|MBEDTLS_PRIVATE\(core\))/; s/->$core\./->/g; s/&(\w+)\.$core\./&$1./g; s/(\w+)\.$core/$1/g' ``` Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
@@ -59,7 +59,7 @@ static inline void psa_set_key_enrollment_algorithm(
|
||||
psa_key_attributes_t *attributes,
|
||||
psa_algorithm_t alg2)
|
||||
{
|
||||
attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2) = alg2;
|
||||
attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2) = alg2;
|
||||
}
|
||||
|
||||
/** Retrieve the enrollment algorithm policy from key attributes.
|
||||
@@ -71,7 +71,7 @@ static inline void psa_set_key_enrollment_algorithm(
|
||||
static inline psa_algorithm_t psa_get_key_enrollment_algorithm(
|
||||
const psa_key_attributes_t *attributes)
|
||||
{
|
||||
return attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2);
|
||||
return attributes->MBEDTLS_PRIVATE(policy).MBEDTLS_PRIVATE(alg2);
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
|
||||
@@ -129,8 +129,8 @@ static inline void psa_set_key_slot_number(
|
||||
psa_key_attributes_t *attributes,
|
||||
psa_key_slot_number_t slot_number)
|
||||
{
|
||||
attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(flags) |= MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER;
|
||||
attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(slot_number) = slot_number;
|
||||
attributes->MBEDTLS_PRIVATE(flags) |= MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER;
|
||||
attributes->MBEDTLS_PRIVATE(slot_number) = slot_number;
|
||||
}
|
||||
|
||||
/** Remove the slot number attribute from a key attribute structure.
|
||||
@@ -142,7 +142,7 @@ static inline void psa_set_key_slot_number(
|
||||
static inline void psa_clear_key_slot_number(
|
||||
psa_key_attributes_t *attributes)
|
||||
{
|
||||
attributes->MBEDTLS_PRIVATE(core).MBEDTLS_PRIVATE(flags) &=
|
||||
attributes->MBEDTLS_PRIVATE(flags) &=
|
||||
~MBEDTLS_PSA_KA_FLAG_HAS_SLOT_NUMBER;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user