summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Chong <victor.chong@linaro.org>2020-11-24 22:27:42 +0900
committervchong <7334750+vchong@users.noreply.github.com>2020-11-26 16:38:35 +0900
commit65a9a51158b67c342c6c750744817291e3316f77 (patch)
tree01614f580ffa7d7457ae464dbdc72b87b08d7a93
parent3cb32182746e505f76c7942b7f4789d9b948e5c4 (diff)
downloadapps-65a9a51158b67c342c6c750744817291e3316f77.tar.gz
km: ta: fix misc build warnings
Fix misc build warnings like unused or uninitialized variables. Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org>
-rw-r--r--keymaster/ta/crypto_ec.c3
-rw-r--r--keymaster/ta/mbedtls_proxy.c14
2 files changed, 8 insertions, 9 deletions
diff --git a/keymaster/ta/crypto_ec.c b/keymaster/ta/crypto_ec.c
index 87d6d1b..d13e771 100644
--- a/keymaster/ta/crypto_ec.c
+++ b/keymaster/ta/crypto_ec.c
@@ -23,7 +23,6 @@ static keymaster_error_t TA_check_ec_data_size(uint8_t **data, uint32_t *data_l,
{
keymaster_error_t res = KM_ERROR_OK;
uint32_t key_size_bytes = (key_size + 7) / 8;
- uint8_t *ptr = NULL;
/*
* If the data provided for signing
@@ -43,7 +42,7 @@ static keymaster_error_t TA_check_ec_data_size(uint8_t **data, uint32_t *data_l,
8 - (key_size & 0x7));
}
}
-out:
+
return res;
}
diff --git a/keymaster/ta/mbedtls_proxy.c b/keymaster/ta/mbedtls_proxy.c
index aabb244..149cd8a 100644
--- a/keymaster/ta/mbedtls_proxy.c
+++ b/keymaster/ta/mbedtls_proxy.c
@@ -2023,10 +2023,10 @@ static int write_authorization_lists(keymaster_key_characteristics_t *chr,
keymaster_key_param_set_t *attest_params,
uint8_t verified_boot, unsigned char**p,
unsigned char *start) {
- size_t i;
+ size_t i = 0;
asn1_sequence *sw_auth_seq = NULL, *hw_auth_seq = NULL;
- bool is_hw;
- int ret, len_ret = 0;
+ bool is_hw = true;
+ int ret = 0, len_ret = 0;
param_enforcement params [] = {
{ &chr->sw_enforced, false },
@@ -2036,12 +2036,12 @@ static int write_authorization_lists(keymaster_key_characteristics_t *chr,
for (i = 0; i < sizeof(auth_tag_list) / sizeof(auth_tag_list[0]); i++) {
/* Buffers to store possible tag values */
- bool bool_par;
- uint32_t uint_par;
- uint64_t long_par;
+ bool bool_par = true;
+ uint32_t uint_par = 0;
+ uint64_t long_par = 0;
uint32_t rep_par[REP_TAG_MAX_VALUES];
keymaster_blob_t blob_par = EMPTY_BLOB;
- void *par_ptr;
+ void *par_ptr = NULL;
size_t par_count = 0;