diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2017-12-27 14:21:21 +0100 |
---|---|---|
committer | Jérôme Forissier <jerome.forissier@linaro.org> | 2017-12-28 10:13:09 +0100 |
commit | d5d50c3c17d8ff5dab9eae767e54054abeba20d2 (patch) | |
tree | 0b340d57eceb4a9c9220b615146adfa1c93875af /core/tee/tee_svc.c | |
parent | 1f3274b01f3df4986374cf12c236269a4eac7cef (diff) |
Fix USER_TA_PROP_TYPE_BOOL handling
In 'ta_props' in ta/arch/arm/user_ta_header.c properties tagged as
USER_TA_PROP_TYPE_BOOL are assigned a pointer to a bool, but is in the
rest of the code handled as if it was a pointer to a uint32_t. This
works as long as a bool is four bytes, with certain compilers the size
of a `bool` is 1 instead leading to errors.
TA properties can be supplied via the define
TA_CURRENT_TA_EXT_PROPERTIES. The pattern used in
ta/arch/arm/user_ta_header.c is likely copied when assigning properties
via TA_CURRENT_TA_EXT_PROPERTIES.
This patch is fixing the assumption that the size of a `bool` is the
same as the size of a `uint32_t` by changing all handling of
USER_TA_PROP_TYPE_BOOL to base it on the type `bool` instead of
`uint32_t`.
Reviewed-by: Jianhui Li <airbak.li@hisilicon.com>
Tested by: Jianhui Li <airbak.li@hisilicon.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/tee/tee_svc.c')
-rw-r--r-- | core/tee/tee_svc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/tee/tee_svc.c b/core/tee/tee_svc.c index d064241b..b6f85da9 100644 --- a/core/tee/tee_svc.c +++ b/core/tee/tee_svc.c @@ -92,9 +92,9 @@ static const uint32_t ta_time_prot_lvl = 100; /* Elliptic Curve Cryptographic support */ #ifdef CFG_CRYPTO_ECC -static const uint32_t crypto_ecc_en = 1; +static const bool crypto_ecc_en = 1; #else -static const uint32_t crypto_ecc_en; +static const bool crypto_ecc_en; #endif /* |