Use -Wall compiler warning level
Sets the C and C++ compiler warning level to -Wall. Fixes for
warnings judged to be non-functional are included in this commit.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I783ff274b7fbd802bc25074953e2c2f287114605
diff --git a/components/common/cbor_dump/cbor_dump.c b/components/common/cbor_dump/cbor_dump.c
index e711d21..ad01344 100644
--- a/components/common/cbor_dump/cbor_dump.c
+++ b/components/common/cbor_dump/cbor_dump.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -24,7 +24,7 @@
static void dump_label(struct dump_context *dump_ctx, const QCBORItem *item);
static void dump_value_separator(struct dump_context *dump_ctx, const QCBORItem *item);
static void dump_value(struct dump_context *dump_ctx, const QCBORItem *item);
-static void dump_text_string(struct dump_context *dump_ctx, const uint8_t *data, size_t len);
+static void dump_text_string(struct dump_context *dump_ctx, const char *data, size_t len);
static void dump_byte_string(struct dump_context *dump_ctx, const uint8_t *data, size_t len);
static const char *dictionary_lookup(struct dump_context *dump_ctx, int64_t id);
@@ -147,7 +147,7 @@
}
else if (item->uDataType == QCBOR_TYPE_BYTE_STRING) {
- dump_byte_string(dump_ctx, (const char*)item->val.string.ptr, item->val.string.len);
+ dump_byte_string(dump_ctx, (const uint8_t*)item->val.string.ptr, item->val.string.len);
fprintf(dump_ctx->outfile, "\n");
}
else if (item->uDataType == QCBOR_TYPE_INT64) {
@@ -167,7 +167,7 @@
}
}
-static void dump_text_string(struct dump_context *dump_ctx, const uint8_t *data, size_t len)
+static void dump_text_string(struct dump_context *dump_ctx, const char *data, size_t len)
{
char text_buf[len + 1];
diff --git a/components/config/ramstore/test/ramstore_tests.cpp b/components/config/ramstore/test/ramstore_tests.cpp
index a9cde4f..a357e01 100644
--- a/components/config/ramstore/test/ramstore_tests.cpp
+++ b/components/config/ramstore/test/ramstore_tests.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -70,8 +70,6 @@
TEST(ConfigRamstoreTests, checkMultipleConfig)
{
- int status;
-
/* Add first config object */
struct device_region config1;
diff --git a/components/messaging/ffa/libsp/sp_discovery.c b/components/messaging/ffa/libsp/sp_discovery.c
index e78c93d..15cb0be 100644
--- a/components/messaging/ffa/libsp/sp_discovery.c
+++ b/components/messaging/ffa/libsp/sp_discovery.c
@@ -124,7 +124,6 @@
uint16_t *id)
{
const struct ffa_partition_information *ffa_info = NULL;
- uint32_t count = 0;
sp_result sp_res = SP_RESULT_OK;
if (id == NULL)
@@ -145,7 +144,6 @@
struct sp_partition_info *info)
{
const struct ffa_partition_information *ffa_info = NULL;
- uint32_t count = 0;
sp_result sp_res = SP_RESULT_OK;
if (info == NULL)
diff --git a/components/messaging/ffa/libsp/sp_messaging.c b/components/messaging/ffa/libsp/sp_messaging.c
index ba07ce1..f7223aa 100644
--- a/components/messaging/ffa/libsp/sp_messaging.c
+++ b/components/messaging/ffa/libsp/sp_messaging.c
@@ -17,8 +17,6 @@
static void pack_ffa_direct_msg(const struct sp_msg *msg,
struct ffa_direct_msg *ffa_msg)
{
- uint32_t i = 0;
-
ffa_msg->source_id = msg->source_id;
ffa_msg->destination_id = msg->destination_id;
@@ -29,8 +27,6 @@
static void unpack_ffa_direct_msg(const struct ffa_direct_msg *ffa_msg,
struct sp_msg *msg)
{
- uint32_t i = 0;
-
if (ffa_msg->function_id != FFA_SUCCESS_32) {
/*
* Handling request or response (error is handled before call)
diff --git a/components/rpc/dummy/dummy_caller.c b/components/rpc/dummy/dummy_caller.c
index da0f491..881f75f 100644
--- a/components/rpc/dummy/dummy_caller.c
+++ b/components/rpc/dummy/dummy_caller.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -51,6 +51,9 @@
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
+ (void)handle;
+ (void)opcode;
+
struct dummy_caller *this_context = (struct dummy_caller*)context;
free(this_context->req_buf);
diff --git a/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c b/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c
index dda796a..0c505b4 100644
--- a/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c
+++ b/components/rpc/mm_communicate/caller/linux/mm_communicate_caller.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -310,7 +310,7 @@
if (mm_return_code == MM_RETURN_CODE_SUCCESS) {
mm_communicate_serializer_header_decode(s->serializer,
- s->comm_buffer, opstatus, resp_buf, resp_len);
+ s->comm_buffer, (efi_status_t*)opstatus, resp_buf, resp_len);
if (*resp_len > s->req_len) {
diff --git a/components/service/attestation/claims/sources/event_log/event_log_claim_source.c b/components/service/attestation/claims/sources/event_log/event_log_claim_source.c
index 94b7bb9..8ad0362 100644
--- a/components/service/attestation/claims/sources/event_log/event_log_claim_source.c
+++ b/components/service/attestation/claims/sources/event_log/event_log_claim_source.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -263,6 +263,8 @@
static size_t tcg_event1_record_size(const void *header, const void *limit)
{
+ (void)limit;
+
size_t record_len = load_u32_le(header, offsetof(tcg_pcr_event_t, event_size));
record_len += sizeof(tcg_pcr_event_t);
return record_len;
@@ -280,7 +282,7 @@
if (id_size) {
- measurement->id.string = (const uint8_t*)event_data + offsetof(event2_data_t, event);
+ measurement->id.string = (const char*)event_data + offsetof(event2_data_t, event);
}
}
}
diff --git a/components/service/attestation/claims/sources/implementation_id/implementation_id_claim_source.c b/components/service/attestation/claims/sources/implementation_id/implementation_id_claim_source.c
index 3610c07..a76dca3 100644
--- a/components/service/attestation/claims/sources/implementation_id/implementation_id_claim_source.c
+++ b/components/service/attestation/claims/sources/implementation_id/implementation_id_claim_source.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -33,7 +33,7 @@
claim->variant_id = CLAIM_VARIANT_ID_BYTE_STRING;
claim->raw_data = NULL;
- claim->variant.byte_string.bytes = instance->id_string;
+ claim->variant.byte_string.bytes = (const uint8_t*)instance->id_string;
claim->variant.byte_string.len = strlen(instance->id_string);
}
diff --git a/components/service/attestation/client/psa/iat_client.c b/components/service/attestation/client/psa/iat_client.c
index 07b1cf5..649e950 100644
--- a/components/service/attestation/client/psa/iat_client.c
+++ b/components/service/attestation/client/psa/iat_client.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -129,7 +129,6 @@
uint8_t *resp_buf;
size_t resp_len;
rpc_opstatus_t opstatus;
- struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/attestation/key_mngr/stub/stub_attest_key_mngr.c b/components/service/attestation/key_mngr/stub/stub_attest_key_mngr.c
index 7f86861..2100ee5 100644
--- a/components/service/attestation/key_mngr/stub/stub_attest_key_mngr.c
+++ b/components/service/attestation/key_mngr/stub/stub_attest_key_mngr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,12 +10,18 @@
psa_status_t attest_key_mngr_get_iak_id(
psa_key_id_t *iak_id)
{
+ (void)iak_id;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t attest_key_mngr_export_iak_public_key(
uint8_t *data, size_t data_size, size_t *data_length)
{
+ (void)data;
+ (void)data_size;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -32,6 +38,9 @@
psa_status_t attest_key_mngr_import_iak(
const uint8_t *data, size_t data_length)
{
+ (void)data;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/attestation/provider/attest_provider.c b/components/service/attestation/provider/attest_provider.c
index 59406f2..a658ac2 100644
--- a/components/service/attestation/provider/attest_provider.c
+++ b/components/service/attestation/provider/attest_provider.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -145,9 +145,8 @@
static rpc_status_t export_iak_public_key_handler(void *context, struct call_req* req)
{
- rpc_status_t rpc_status = TS_RPC_ERROR_SERIALIZATION_NOT_SUPPORTED;
- struct call_param_buf *req_buf = call_req_get_req_buf(req);
- const struct attest_provider_serializer *serializer = get_attest_serializer(context, req);
+ rpc_status_t rpc_status = TS_RPC_ERROR_SERIALIZATION_NOT_SUPPORTED;
+ const struct attest_provider_serializer *serializer = get_attest_serializer(context, req);
if (serializer) {
@@ -218,7 +217,9 @@
static rpc_status_t iak_exists_handler(void *context, struct call_req* req)
{
- rpc_opstatus_t opstatus = PSA_ERROR_DOES_NOT_EXIST;
+ (void)context;
+
+ rpc_opstatus_t opstatus = PSA_ERROR_DOES_NOT_EXIST;
if (attest_key_mngr_iak_exists()) {
diff --git a/components/service/attestation/reporter/eat/eat_serializer.c b/components/service/attestation/reporter/eat/eat_serializer.c
index 240c674..e948218 100644
--- a/components/service/attestation/reporter/eat/eat_serializer.c
+++ b/components/service/attestation/reporter/eat/eat_serializer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -78,6 +78,8 @@
const struct claim_vector *sw_claims, UsefulBuf *encode_buffer)
{
// todo estimate required space
+ (void)device_claims;
+ (void)sw_claims;
encode_buffer->len = 4096;
encode_buffer->ptr = malloc(encode_buffer->len);
diff --git a/components/service/attestation/reporter/stub/stub_attest_report.c b/components/service/attestation/reporter/stub/stub_attest_report.c
index d24dd5e..b6589ff 100644
--- a/components/service/attestation/reporter/stub/stub_attest_report.c
+++ b/components/service/attestation/reporter/stub/stub_attest_report.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -19,6 +19,10 @@
const uint8_t *auth_challenge_data, size_t auth_challenge_len,
const uint8_t **report, size_t *report_len)
{
+ (void)client_id;
+ (void)auth_challenge_data;
+ (void)auth_challenge_len;
+
*report = NULL;
*report_len = 0;
diff --git a/components/service/attestation/test/component/attestation_reporter_tests.cpp b/components/service/attestation/test/component/attestation_reporter_tests.cpp
index ed5ac14..59386ea 100644
--- a/components/service/attestation/test/component/attestation_reporter_tests.cpp
+++ b/components/service/attestation/test/component/attestation_reporter_tests.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -30,7 +30,7 @@
struct claim_source *claim_source;
report = NULL;
- report_len;
+ report_len = 0;
psa_crypto_init();
local_attest_key_mngr_init(LOCAL_ATTEST_KEY_MNGR_VOLATILE_IAK);
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_aead.h b/components/service/crypto/client/caller/stub/crypto_caller_aead.h
index 455e7ac..f3b35ea 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_aead.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_aead.h
@@ -27,6 +27,19 @@
size_t aeadtext_size,
size_t *aeadtext_length)
{
+ (void)context;
+ (void)key;
+ (void)alg;
+ (void)nonce;
+ (void)nonce_length;
+ (void)additional_data;
+ (void)additional_data_length;
+ (void)plaintext;
+ (void)plaintext_length;
+ (void)aeadtext;
+ (void)aeadtext_size;
+ (void)aeadtext_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -43,6 +56,19 @@
size_t plaintext_size,
size_t *plaintext_length)
{
+ (void)context;
+ (void)key;
+ (void)alg;
+ (void)nonce;
+ (void)nonce_length;
+ (void)additional_data;
+ (void)additional_data_length;
+ (void)aeadtext;
+ (void)aeadtext_length;
+ (void)plaintext;
+ (void)plaintext_size;
+ (void)plaintext_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -51,6 +77,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -59,6 +90,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -68,6 +104,12 @@
size_t nonce_size,
size_t *nonce_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)nonce;
+ (void)nonce_size;
+ (void)nonce_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -76,6 +118,11 @@
const uint8_t *nonce,
size_t nonce_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)nonce;
+ (void)nonce_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -84,6 +131,11 @@
size_t ad_length,
size_t plaintext_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)ad_length;
+ (void)plaintext_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -92,6 +144,11 @@
const uint8_t *input,
size_t input_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -103,6 +160,14 @@
size_t output_size,
size_t *output_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -115,6 +180,15 @@
size_t tag_size,
size_t *tag_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)aeadtext;
+ (void)aeadtext_size;
+ (void)aeadtext_length;
+ (void)tag;
+ (void)tag_size;
+ (void)tag_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -126,12 +200,23 @@
const uint8_t *tag,
size_t tag_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)plaintext;
+ (void)plaintext_size;
+ (void)plaintext_length;
+ (void)tag;
+ (void)tag_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline psa_status_t crypto_caller_aead_abort(struct service_client *context,
uint32_t op_handle)
{
+ (void)context;
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_decrypt.h b/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_decrypt.h
index 8f64b48..795540b 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_decrypt.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_decrypt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,6 +21,17 @@
const uint8_t *salt, size_t salt_length,
uint8_t *output, size_t output_size, size_t *output_length)
{
+ (void)context;
+ (void)id;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)salt;
+ (void)salt_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_encrypt.h b/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_encrypt.h
index f75df39..23a2709 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_encrypt.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_asymmetric_encrypt.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,6 +21,17 @@
const uint8_t *salt, size_t salt_length,
uint8_t *output, size_t output_size, size_t *output_length)
{
+ (void)context;
+ (void)id;
+ (void)alg;
+ (void)input;
+ (void)input_length;
+ (void)salt;
+ (void)salt_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_cipher.h b/components/service/crypto/client/caller/stub/crypto_caller_cipher.h
index b216b4b..3fc4e95 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_cipher.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_cipher.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -19,6 +19,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -27,6 +32,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -36,6 +46,12 @@
size_t iv_size,
size_t *iv_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)iv;
+ (void)iv_size;
+ (void)iv_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -44,6 +60,11 @@
const uint8_t *iv,
size_t iv_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)iv;
+ (void)iv_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -55,6 +76,14 @@
size_t output_size,
size_t *output_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -64,17 +93,28 @@
size_t output_size,
size_t *output_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline psa_status_t crypto_caller_cipher_abort(struct service_client *context,
uint32_t op_handle)
{
+ (void)context;
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline size_t crypto_caller_cipher_max_update_size(struct service_client *context)
{
+ (void)context;
+
return 0;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_copy_key.h b/components/service/crypto/client/caller/stub/crypto_caller_copy_key.h
index 0fd70dc..8af688d 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_copy_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_copy_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -19,6 +19,11 @@
const psa_key_attributes_t *attributes,
psa_key_id_t *target_key)
{
+ (void)context;
+ (void)source_key;
+ (void)attributes;
+ (void)target_key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_destroy_key.h b/components/service/crypto/client/caller/stub/crypto_caller_destroy_key.h
index 9233b6c..9e192b1 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_destroy_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_destroy_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -17,6 +17,9 @@
static inline psa_status_t crypto_caller_destroy_key(struct service_client *context,
psa_key_id_t id)
{
+ (void)context;
+ (void)id;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_export_key.h b/components/service/crypto/client/caller/stub/crypto_caller_export_key.h
index 05d7a32..27b2644 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_export_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_export_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,12 @@
psa_key_id_t id,
uint8_t *data, size_t data_size, size_t *data_length)
{
+ (void)context;
+ (void)id;
+ (void)data;
+ (void)data_size;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_export_public_key.h b/components/service/crypto/client/caller/stub/crypto_caller_export_public_key.h
index fff982b..4d8e9a4 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_export_public_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_export_public_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,12 @@
psa_key_id_t id,
uint8_t *data, size_t data_size, size_t *data_length)
{
+ (void)context;
+ (void)id;
+ (void)data;
+ (void)data_size;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_generate_key.h b/components/service/crypto/client/caller/stub/crypto_caller_generate_key.h
index ceb587b..4eb4133 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_generate_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_generate_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,10 @@
const psa_key_attributes_t *attributes,
psa_key_id_t *id)
{
+ (void)context;
+ (void)attributes;
+ (void)id;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_generate_random.h b/components/service/crypto/client/caller/stub/crypto_caller_generate_random.h
index c7c339c..a388c29 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_generate_random.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_generate_random.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -17,6 +17,10 @@
static inline psa_status_t crypto_caller_generate_random(struct service_client *context,
uint8_t *output, size_t output_size)
{
+ (void)context;
+ (void)output;
+ (void)output_size;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_get_key_attributes.h b/components/service/crypto/client/caller/stub/crypto_caller_get_key_attributes.h
index 4de442d..43dbde3 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_get_key_attributes.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_get_key_attributes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,10 @@
psa_key_id_t key,
psa_key_attributes_t *attributes)
{
+ (void)context;
+ (void)key;
+ (void)attributes;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_import_key.h b/components/service/crypto/client/caller/stub/crypto_caller_import_key.h
index ed41a10..95b5d76 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_import_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_import_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -19,6 +19,12 @@
const uint8_t *data, size_t data_length,
psa_key_id_t *id)
{
+ (void)context;
+ (void)attributes;
+ (void)data;
+ (void)data_length;
+ (void)id;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_key_derivation.h b/components/service/crypto/client/caller/stub/crypto_caller_key_derivation.h
index cb568c6..eddac79 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_key_derivation.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_key_derivation.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -18,6 +18,10 @@
uint32_t *op_handle,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -25,6 +29,10 @@
const uint32_t op_handle,
size_t *capacity)
{
+ (void)context;
+ (void)op_handle;
+ (void)capacity;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -32,6 +40,10 @@
uint32_t op_handle,
size_t capacity)
{
+ (void)context;
+ (void)op_handle;
+ (void)capacity;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -41,6 +53,12 @@
const uint8_t *data,
size_t data_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)step;
+ (void)data;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -49,6 +67,11 @@
psa_key_derivation_step_t step,
psa_key_id_t key)
{
+ (void)context;
+ (void)op_handle;
+ (void)step;
+ (void)key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -57,6 +80,11 @@
uint8_t *output,
size_t output_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)output;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -65,12 +93,20 @@
uint32_t op_handle,
psa_key_id_t *key)
{
+ (void)context;
+ (void)attributes;
+ (void)op_handle;
+ (void)key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline psa_status_t crypto_caller_key_derivation_abort(struct service_client *context,
uint32_t op_handle)
{
+ (void)context;
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -81,6 +117,13 @@
const uint8_t *peer_key,
size_t peer_key_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)step;
+ (void)private_key;
+ (void)peer_key;
+ (void)peer_key_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -93,6 +136,15 @@
size_t output_size,
size_t *output_length)
{
+ (void)context;
+ (void)alg;
+ (void)private_key;
+ (void)peer_key;
+ (void)peer_key_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_mac.h b/components/service/crypto/client/caller/stub/crypto_caller_mac.h
index 6c5b870..ddca27d 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_mac.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_mac.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -20,6 +20,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -28,6 +33,11 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)context;
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -36,6 +46,11 @@
const uint8_t *input,
size_t input_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -45,6 +60,12 @@
size_t mac_size,
size_t *mac_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)mac;
+ (void)mac_size;
+ (void)mac_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -53,17 +74,27 @@
const uint8_t *mac,
size_t mac_length)
{
+ (void)context;
+ (void)op_handle;
+ (void)mac;
+ (void)mac_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline psa_status_t crypto_caller_mac_abort(struct service_client *context,
uint32_t op_handle)
{
+ (void)context;
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
static inline size_t crypto_caller_mac_max_update_size(struct service_client *context)
{
+ (void)context;
+
return 0;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_purge_key.h b/components/service/crypto/client/caller/stub/crypto_caller_purge_key.h
index af04af9..6644322 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_purge_key.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_purge_key.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -17,6 +17,9 @@
static inline psa_status_t crypto_caller_purge_key(struct service_client *context,
psa_key_id_t key)
{
+ (void)context;
+ (void)key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_sign_hash.h b/components/service/crypto/client/caller/stub/crypto_caller_sign_hash.h
index 09049f5..4b99935 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_sign_hash.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_sign_hash.h
@@ -20,6 +20,15 @@
const uint8_t *hash, size_t hash_length,
uint8_t *signature, size_t signature_size, size_t *signature_length)
{
+ (void)context;
+ (void)id;
+ (void)alg;
+ (void)hash;
+ (void)hash_length;
+ (void)signature;
+ (void)signature_size;
+ (void)signature_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/caller/stub/crypto_caller_verify_hash.h b/components/service/crypto/client/caller/stub/crypto_caller_verify_hash.h
index 3f3eb87..15ceb4a 100644
--- a/components/service/crypto/client/caller/stub/crypto_caller_verify_hash.h
+++ b/components/service/crypto/client/caller/stub/crypto_caller_verify_hash.h
@@ -20,6 +20,14 @@
const uint8_t *hash, size_t hash_length,
const uint8_t *signature, size_t signature_length)
{
+ (void)context;
+ (void)id;
+ (void)alg;
+ (void)hash;
+ (void)hash_length;
+ (void)signature;
+ (void)signature_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
index 845c9fa..337485f 100644
--- a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
+++ b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
@@ -212,12 +212,18 @@
const psa_key_attributes_t *attributes,
psa_key_id_t *target_key)
{
+ (void)source_key;
+ (void)attributes;
+ (void)target_key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::purge_key(
psa_key_id_t id)
{
+ (void)id;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -225,6 +231,9 @@
psa_key_id_t id,
psa_key_attributes_t *attributes)
{
+ (void)id;
+ (void)attributes;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -798,24 +807,38 @@
psa_status_t protobuf_crypto_client::hash_setup(uint32_t *op_handle,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::hash_update(uint32_t op_handle,
const uint8_t *input, size_t input_length)
{
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::hash_finish(uint32_t op_handle,
uint8_t *hash, size_t hash_size, size_t *hash_length)
{
+ (void)op_handle;
+ (void)hash;
+ (void)hash_size;
+ (void)hash_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::hash_abort(
uint32_t op_handle)
{
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -823,6 +846,10 @@
uint32_t op_handle,
const uint8_t *hash, size_t hash_length)
{
+ (void)op_handle;
+ (void)hash;
+ (void)hash_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -830,6 +857,9 @@
uint32_t source_op_handle,
uint32_t *target_op_handle)
{
+ (void)source_op_handle;
+ (void)target_op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -844,6 +874,10 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -852,6 +886,10 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -859,6 +897,11 @@
uint32_t op_handle,
uint8_t *iv, size_t iv_size, size_t *iv_length)
{
+ (void)op_handle;
+ (void)iv;
+ (void)iv_size;
+ (void)iv_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -866,6 +909,10 @@
uint32_t op_handle,
const uint8_t *iv, size_t iv_length)
{
+ (void)op_handle;
+ (void)iv;
+ (void)iv_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -874,6 +921,13 @@
const uint8_t *input, size_t input_length,
uint8_t *output, size_t output_size, size_t *output_length)
{
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -881,12 +935,19 @@
uint32_t op_handle,
uint8_t *output, size_t output_size, size_t *output_length)
{
+ (void)op_handle;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::cipher_abort(
uint32_t op_handle)
{
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -901,6 +962,10 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -909,6 +974,10 @@
psa_key_id_t key,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)key;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -916,6 +985,10 @@
uint32_t op_handle,
const uint8_t *input, size_t input_length)
{
+ (void)op_handle;
+ (void)input;
+ (void)input_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -923,6 +996,11 @@
uint32_t op_handle,
uint8_t *mac, size_t mac_size, size_t *mac_length)
{
+ (void)op_handle;
+ (void)mac;
+ (void)mac_size;
+ (void)mac_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -930,12 +1008,18 @@
uint32_t op_handle,
const uint8_t *mac, size_t mac_length)
{
+ (void)op_handle;
+ (void)mac;
+ (void)mac_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::mac_abort(
uint32_t op_handle)
{
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -944,6 +1028,9 @@
uint32_t *op_handle,
psa_algorithm_t alg)
{
+ (void)op_handle;
+ (void)alg;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -951,6 +1038,9 @@
const uint32_t op_handle,
size_t *capacity)
{
+ (void)op_handle;
+ (void)capacity;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -958,6 +1048,9 @@
uint32_t op_handle,
size_t capacity)
{
+ (void)op_handle;
+ (void)capacity;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -966,6 +1059,11 @@
psa_key_derivation_step_t step,
const uint8_t *data, size_t data_length)
{
+ (void)op_handle;
+ (void)step;
+ (void)data;
+ (void)data_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -974,6 +1072,10 @@
psa_key_derivation_step_t step,
psa_key_id_t key)
{
+ (void)op_handle;
+ (void)step;
+ (void)key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -981,6 +1083,10 @@
uint32_t op_handle,
uint8_t *output, size_t output_length)
{
+ (void)op_handle;
+ (void)output;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -989,12 +1095,18 @@
uint32_t op_handle,
psa_key_id_t *key)
{
+ (void)attributes;
+ (void)op_handle;
+ (void)key;
+
return PSA_ERROR_NOT_SUPPORTED;
}
psa_status_t protobuf_crypto_client::key_derivation_abort(
uint32_t op_handle)
{
+ (void)op_handle;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -1004,6 +1116,12 @@
psa_key_id_t private_key,
const uint8_t *peer_key, size_t peer_key_length)
{
+ (void)op_handle;
+ (void)step;
+ (void)private_key;
+ (void)peer_key;
+ (void)peer_key_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
@@ -1012,5 +1130,13 @@
const uint8_t *peer_key, size_t peer_key_length,
uint8_t *output, size_t output_size, size_t *output_length)
{
+ (void)alg;
+ (void)private_key;
+ (void)peer_key;
+ (void)peer_key_length;
+ (void)output;
+ (void)output_size;
+ (void)output_length;
+
return PSA_ERROR_NOT_SUPPORTED;
}
diff --git a/components/service/crypto/provider/extension/key_derivation/key_derivation_provider.c b/components/service/crypto/provider/extension/key_derivation/key_derivation_provider.c
index dfb5b07..aebcf92 100644
--- a/components/service/crypto/provider/extension/key_derivation/key_derivation_provider.c
+++ b/components/service/crypto/provider/extension/key_derivation/key_derivation_provider.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -455,7 +455,6 @@
rpc_status_t rpc_status = TS_RPC_ERROR_SERIALIZATION_NOT_SUPPORTED;
struct call_param_buf *req_buf = call_req_get_req_buf(req);
const struct key_derivation_provider_serializer *serializer = get_serializer(context, req);
- struct key_derivation_provider *this_instance = (struct key_derivation_provider*)context;
psa_algorithm_t alg;
psa_key_id_t private_key_id;
diff --git a/components/service/crypto/provider/serializer/protobuf/pb_crypto_provider_serializer.c b/components/service/crypto/provider/serializer/protobuf/pb_crypto_provider_serializer.c
index 8a4e2b1..6df375d 100644
--- a/components/service/crypto/provider/serializer/protobuf/pb_crypto_provider_serializer.c
+++ b/components/service/crypto/provider/serializer/protobuf/pb_crypto_provider_serializer.c
@@ -238,12 +238,19 @@
psa_key_attributes_t *attributes,
psa_key_id_t *source_id)
{
+ (void)req_buf;
+ (void)attributes;
+ (void)source_id;
+
return TS_RPC_ERROR_INVALID_REQ_BODY;
}
static rpc_status_t serialize_copy_key_resp(struct call_param_buf *resp_buf,
psa_key_id_t target_id)
{
+ (void)resp_buf;
+ (void)target_id;
+
return TS_RPC_ERROR_INTERNAL;
}
@@ -251,6 +258,9 @@
static rpc_status_t deserialize_purge_key_req(const struct call_param_buf *req_buf,
psa_key_id_t *id)
{
+ (void)req_buf;
+ (void)id;
+
return TS_RPC_ERROR_INVALID_REQ_BODY;
}
@@ -258,12 +268,18 @@
static rpc_status_t deserialize_get_key_attributes_req(const struct call_param_buf *req_buf,
psa_key_id_t *id)
{
+ (void)req_buf;
+ (void)id;
+
return TS_RPC_ERROR_INVALID_REQ_BODY;
}
static rpc_status_t serialize_get_key_attributes_resp(struct call_param_buf *resp_buf,
const psa_key_attributes_t *attributes)
{
+ (void)resp_buf;
+ (void)attributes;
+
return TS_RPC_ERROR_INTERNAL;
}
diff --git a/components/service/crypto/test/service/extension/hash/hash_service_scenarios.cpp b/components/service/crypto/test/service/extension/hash/hash_service_scenarios.cpp
index b02cfd1..95f8955 100644
--- a/components/service/crypto/test/service/extension/hash/hash_service_scenarios.cpp
+++ b/components/service/crypto/test/service/extension/hash/hash_service_scenarios.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -112,9 +112,6 @@
create_ref_input(input_size);
- uint8_t hash[PSA_HASH_MAX_SIZE];
- size_t hash_len;
-
uint32_t op_handle = 0;
psa_status_t status;
diff --git a/components/service/secure_storage/backend/mock_store/mock_store.c b/components/service/secure_storage/backend/mock_store/mock_store.c
index f701e01..5e43d5f 100644
--- a/components/service/secure_storage/backend/mock_store/mock_store.c
+++ b/components/service/secure_storage/backend/mock_store/mock_store.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,6 +21,8 @@
const void *p_data,
uint32_t create_flags)
{
+ (void)client_id;
+
psa_status_t psa_status = PSA_ERROR_INSUFFICIENT_STORAGE;
struct mock_store *this_context = (struct mock_store*)context;
@@ -58,6 +60,9 @@
void *p_data,
size_t *p_data_length)
{
+ (void)client_id;
+ (void)data_offset;
+
psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store *this_context = (struct mock_store*)context;
@@ -78,6 +83,8 @@
uint64_t uid,
struct psa_storage_info_t *p_info)
{
+ (void)client_id;
+
psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store *this_context = (struct mock_store*)context;
@@ -103,6 +110,8 @@
uint32_t client_id,
uint64_t uid)
{
+ (void)client_id;
+
psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store *this_context = (struct mock_store*)context;
@@ -123,6 +132,8 @@
size_t capacity,
uint32_t create_flags)
{
+ (void)client_id;
+
psa_status_t psa_status = PSA_ERROR_ALREADY_EXISTS;
struct mock_store *this_context = (struct mock_store*)context;
struct mock_store_slot *slot;
@@ -144,7 +155,7 @@
slot->capacity = capacity;
slot->len = 0;
- memset(slot->item, slot->capacity, 0);
+ memset(slot->item, 0, slot->capacity);
psa_status = PSA_SUCCESS;
}
else {
@@ -164,6 +175,8 @@
size_t data_length,
const void *p_data)
{
+ (void)client_id;
+
psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store *this_context = (struct mock_store*)context;
struct mock_store_slot *slot;
@@ -298,4 +311,4 @@
slot->uid = (uint64_t)(-1);
slot->item = NULL;
}
-}
\ No newline at end of file
+}
diff --git a/components/service/secure_storage/backend/secure_flash_store/secure_flash_store.c b/components/service/secure_storage/backend/secure_flash_store/secure_flash_store.c
index 5e7dea5..81fc0d1 100644
--- a/components/service/secure_storage/backend/secure_flash_store/secure_flash_store.c
+++ b/components/service/secure_storage/backend/secure_flash_store/secure_flash_store.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -58,6 +58,8 @@
const void *p_data,
uint32_t create_flags)
{
+ (void)context;
+
psa_status_t status;
size_t write_size;
size_t offset;
@@ -151,11 +153,11 @@
void *p_data,
size_t *p_data_length)
{
+ (void)context;
+
psa_status_t status;
size_t read_size;
- uint8_t *data = p_data;
-
- data = (uint8_t *)p_data;
+ uint8_t *data = (uint8_t *)p_data;
/* Check that the UID is valid */
if (uid == SFS_INVALID_UID) {
@@ -212,6 +214,8 @@
static psa_status_t sfs_get_info(void *context, uint32_t client_id, uint64_t uid,
struct psa_storage_info_t *p_info)
{
+ (void)context;
+
psa_status_t status;
/* Check that the UID is valid */
@@ -238,6 +242,8 @@
static psa_status_t sfs_remove(void *context, uint32_t client_id, uint64_t uid)
{
+ (void)context;
+
psa_status_t status;
/* Check that the UID is valid */
@@ -270,6 +276,8 @@
size_t capacity,
uint32_t create_flags)
{
+ (void)context;
+
psa_status_t status;
/* Check that the UID is valid */
diff --git a/components/service/secure_storage/frontend/psa/its/test/its_api_tests.cpp b/components/service/secure_storage/frontend/psa/its/test/its_api_tests.cpp
index 53a6442..118a8de 100644
--- a/components/service/secure_storage/frontend/psa/its/test/its_api_tests.cpp
+++ b/components/service/secure_storage/frontend/psa/its/test/its_api_tests.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -55,7 +55,6 @@
struct psa_storage_info_t storage_info;
static const size_t MAX_ITEM_SIZE = 10000;
uint8_t item[MAX_ITEM_SIZE];
- uint8_t read_item[MAX_ITEM_SIZE];
memset(item, 0x55, sizeof(item));
@@ -78,4 +77,4 @@
/* Remove the item */
status = psa_its_remove(uid);
CHECK_EQUAL(PSA_SUCCESS, status);
-}
\ No newline at end of file
+}
diff --git a/components/service/smm_variable/backend/variable_checker.c b/components/service/smm_variable/backend/variable_checker.c
index 81a41d0..81a6cc6 100644
--- a/components/service/smm_variable/backend/variable_checker.c
+++ b/components/service/smm_variable/backend/variable_checker.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -53,6 +53,8 @@
uint32_t attributes,
size_t data_size)
{
+ (void)attributes;
+
if (constraints->property & VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY)
return EFI_WRITE_PROTECTED;
diff --git a/components/service/smm_variable/backend/variable_index.c b/components/service/smm_variable/backend/variable_index.c
index 4abb718..68e4c89 100644
--- a/components/service/smm_variable/backend/variable_index.c
+++ b/components/service/smm_variable/backend/variable_index.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -29,7 +29,7 @@
}
/* Extend to cover name up to but not including null terminator */
- for (int i = 0; i < name_size / sizeof(int16_t); ++i) {
+ for (size_t i = 0; i < name_size / sizeof(int16_t); ++i) {
if (!name[i]) break;
hash = ((hash << 5) + hash) + name[i];
@@ -61,7 +61,7 @@
int found_pos = -1;
uint64_t uid = name_hash(guid, name_size, name);
- for (int pos = 0; pos < context->max_variables; pos++) {
+ for (size_t pos = 0; pos < context->max_variables; pos++) {
if ((context->entries[pos].in_use) &&
(uid == context->entries[pos].info.metadata.uid)) {
@@ -79,7 +79,7 @@
{
int free_pos = -1;
- for (int pos = 0; pos < context->max_variables; pos++) {
+ for (size_t pos = 0; pos < context->max_variables; pos++) {
if (!context->entries[pos].in_use) {
@@ -174,7 +174,7 @@
/* Iterate to next used entry */
++pos;
- while (pos < context->max_variables) {
+ while (pos < (int)context->max_variables) {
if (context->entries[pos].in_use &&
context->entries[pos].info.is_variable_set) {
@@ -198,7 +198,7 @@
/* Find first */
int pos = 0;
- while (pos < context->max_variables) {
+ while (pos < (int)context->max_variables) {
if (context->entries[pos].in_use &&
context->entries[pos].info.is_variable_set) {
@@ -293,6 +293,8 @@
struct variable_index *context,
struct variable_info *info)
{
+ (void)context;
+
if (info &&
!info->is_constraints_set &&
!info->is_variable_set) {
@@ -320,6 +322,8 @@
struct variable_index *context,
struct variable_info *info)
{
+ (void)context;
+
if (info) {
struct variable_entry *entry = containing_entry(info);
@@ -351,7 +355,7 @@
uint8_t *dump_pos = buffer;
size_t bytes_dumped = 0;
- for (int pos = 0; pos < context->max_variables; pos++) {
+ for (size_t pos = 0; pos < context->max_variables; pos++) {
struct variable_entry *entry = &context->entries[pos];
struct variable_metadata *metadata = &entry->info.metadata;
diff --git a/components/service/smm_variable/provider/smm_variable_provider.c b/components/service/smm_variable/provider/smm_variable_provider.c
index 52e68d0..5fda0db 100644
--- a/components/service/smm_variable/provider/smm_variable_provider.c
+++ b/components/service/smm_variable/provider/smm_variable_provider.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -357,7 +357,7 @@
static rpc_status_t get_payload_size_handler(void *context, struct call_req *req)
{
- struct smm_variable_provider *this_instance = (struct smm_variable_provider*)context;
+ (void)context;
/* Payload size is constrained by the size of the RPC call buffer. Because the variable length
* name is also carried in the buffer, the maximum payload size depends on the name size. This
diff --git a/components/service/smm_variable/test/service/smm_variable_attack_tests.cpp b/components/service/smm_variable/test/service/smm_variable_attack_tests.cpp
index 0a98a22..d9f07b2 100644
--- a/components/service/smm_variable/test/service/smm_variable_attack_tests.cpp
+++ b/components/service/smm_variable/test/service/smm_variable_attack_tests.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <cstring>
#include <limits>
#include <service/smm_variable/client/cpp/smm_variable_client.h>
#include <protocols/rpc/common/packed-c/encoding.h>
@@ -208,7 +209,8 @@
{
efi_status_t efi_status = EFI_SUCCESS;
std::wstring var_name;
- EFI_GUID guid = {0};
+ EFI_GUID guid;
+ memset(&guid, 0, sizeof(guid));
efi_status = m_client->get_next_variable_name(
guid,
@@ -223,7 +225,8 @@
efi_status_t efi_status = EFI_SUCCESS;
std::wstring var_name_1 = L"varibale_1";
std::wstring var_name;
- EFI_GUID guid = {0};
+ EFI_GUID guid;
+ memset(&guid, 0, sizeof(guid));
/* Add a variable */
efi_status = m_client->set_variable(
@@ -232,6 +235,8 @@
std::string("Some data"),
EFI_VARIABLE_NON_VOLATILE);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
+
/* Initial iteration uses good name length */
efi_status = m_client->get_next_variable_name(
guid,
diff --git a/components/service/smm_variable/test/service/smm_variable_service_tests.cpp b/components/service/smm_variable/test/service/smm_variable_service_tests.cpp
index 4108d51..8314a08 100644
--- a/components/service/smm_variable/test/service/smm_variable_service_tests.cpp
+++ b/components/service/smm_variable/test/service/smm_variable_service_tests.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
+#include <cstring>
#include <service/smm_variable/client/cpp/smm_variable_client.h>
#include <protocols/rpc/common/packed-c/encoding.h>
#include <service_locator.h>
@@ -425,7 +426,8 @@
/* Enumerate store contents - expect the values we added */
std::wstring var_name;
- EFI_GUID guid = {0};
+ EFI_GUID guid;
+ memset(&guid, 0, sizeof(guid));
efi_status = m_client->get_next_variable_name(guid, var_name);
UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
diff --git a/components/service/test_runner/client/cpp/test_runner_client.cpp b/components/service/test_runner/client/cpp/test_runner_client.cpp
index 9d9a20d..0353329 100644
--- a/components/service/test_runner/client/cpp/test_runner_client.cpp
+++ b/components/service/test_runner/client/cpp/test_runner_client.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -208,10 +208,8 @@
struct ts_test_runner_test_result packed_result;
memcpy(&packed_result, value_buf, fixed_size);
+ memset(&result, 0, sizeof(result));
result.run_state = (enum test_run_state)packed_result.run_state;
- result.name[0] = 0;
- result.group[0] = 0;
- result.failure = {0};
/* Deserialize name and group if present */
struct tlv_const_iterator req_iter;
diff --git a/components/service/test_runner/provider/backend/simple_c/simple_c_test_runner.c b/components/service/test_runner/provider/backend/simple_c/simple_c_test_runner.c
index fb66d75..27a22cb 100644
--- a/components/service/test_runner/provider/backend/simple_c/simple_c_test_runner.c
+++ b/components/service/test_runner/provider/backend/simple_c/simple_c_test_runner.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -123,7 +123,7 @@
{
size_t count = 0;
- for (int group_index = 0; group_index < the_test_runner.num_groups; ++group_index) {
+ for (size_t group_index = 0; group_index < the_test_runner.num_groups; ++group_index) {
count += the_test_runner.groups[group_index]->num_test_cases;
}
@@ -141,4 +141,4 @@
struct test_summary *summary, struct test_result *results, size_t result_limit)
{
test_iterate(spec, true, summary, results, result_limit);
-}
\ No newline at end of file
+}
diff --git a/components/service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.c b/components/service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.c
index 5892502..2c53b93 100644
--- a/components/service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.c
+++ b/components/service/test_runner/provider/serializer/packed-c/packedc_test_runner_provider_serializer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -77,7 +77,7 @@
struct tlv_record record;
record.tag = TS_TEST_RUNNER_TEST_RESULT_TAG_NAME;
record.length = name_len;
- record.value = result->name;
+ record.value = (const uint8_t*)result->name;
tlv_encode(&tlv_iter, &record);
}
@@ -86,7 +86,7 @@
struct tlv_record record;
record.tag = TS_TEST_RUNNER_TEST_RESULT_TAG_GROUP;
record.length = group_len;
- record.value = result->group;
+ record.value = (const uint8_t*)result->group;
tlv_encode(&tlv_iter, &record);
}
@@ -131,7 +131,7 @@
struct tlv_iterator resp_iter;
tlv_iterator_begin(&resp_iter, (uint8_t*)resp_buf->data + space_used, resp_buf->size - space_used);
- for (int i = 0; (i < summary->num_results) && (rpc_status == TS_RPC_CALL_ACCEPTED); ++i) {
+ for (size_t i = 0; (i < summary->num_results) && (rpc_status == TS_RPC_CALL_ACCEPTED); ++i) {
size_t serialised_len;
uint8_t *serialize_buf = serialize_test_result(&results[i], &serialised_len);
diff --git a/components/service/test_runner/provider/test_runner_provider.c b/components/service/test_runner/provider/test_runner_provider.c
index 4b61bc1..a0a2da7 100644
--- a/components/service/test_runner/provider/test_runner_provider.c
+++ b/components/service/test_runner/provider/test_runner_provider.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -98,7 +98,6 @@
struct test_summary *summary, struct test_result *results, size_t result_limit)
{
int test_status = TS_TEST_RUNNER_STATUS_SUCCESS;
- size_t results_used = 0;
struct test_runner_backend *backend = context->backend_list;
summary->num_tests = 0;
@@ -202,4 +201,4 @@
}
return rpc_status;
-}
\ No newline at end of file
+}
diff --git a/environments/arm-linux/default_toolchain_file.cmake b/environments/arm-linux/default_toolchain_file.cmake
index 7a5f33f..85de9df 100644
--- a/environments/arm-linux/default_toolchain_file.cmake
+++ b/environments/arm-linux/default_toolchain_file.cmake
@@ -15,5 +15,12 @@
string(APPEND CMAKE_C_FLAGS_INIT " -fdiagnostics-show-option -gdwarf-2 -mstrict-align -O0 -DARM64=1")
string(APPEND CMAKE_CXX_FLAGS_INIT " -fdiagnostics-show-option -gdwarf-2 -mstrict-align -O0 -DARM64=1")
+# Set compiler warning level for the root build context. External components
+# are responsible for setting their own warning level.
+if(DEFINED TS_ROOT)
+ string(APPEND CMAKE_C_FLAGS_INIT " -Wall")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -Wall")
+endif()
+
include($ENV{TS_ROOT}/tools/cmake/compiler/GCC.cmake REQUIRED)
include($ENV{TS_ROOT}/tools/cmake/compiler/config_iface.cmake REQUIRED)
diff --git a/environments/linux-pc/default_toolchain_file.cmake b/environments/linux-pc/default_toolchain_file.cmake
index 6978dbf..1fa32cc 100644
--- a/environments/linux-pc/default_toolchain_file.cmake
+++ b/environments/linux-pc/default_toolchain_file.cmake
@@ -1,8 +1,15 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
include($ENV{TS_ROOT}/tools/cmake/compiler/config_iface.cmake REQUIRED)
+
+# Set compiler warning level for the root build context. External components
+# are responsible for setting their own warning level.
+if(DEFINED TS_ROOT)
+ string(APPEND CMAKE_C_FLAGS_INIT " -Wall")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " -Wall")
+endif()
diff --git a/environments/opteesp/default_toolchain_file.cmake b/environments/opteesp/default_toolchain_file.cmake
index 541cd89..3c4b9a6 100644
--- a/environments/opteesp/default_toolchain_file.cmake
+++ b/environments/opteesp/default_toolchain_file.cmake
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
-# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
@@ -17,9 +17,16 @@
include($ENV{TS_ROOT}/tools/cmake/compiler/GCC.cmake REQUIRED)
include($ENV{TS_ROOT}/tools/cmake/compiler/config_iface.cmake REQUIRED)
+
# Set mandatory compiler and linker flags for this environment:
# - Compile position independent code
string(APPEND CMAKE_C_FLAGS_INIT " -fpic")
-# - Disable startup files and default libraries.
+
+# Set compiler warning level for the root build context. External components
+# are responsible for setting their own warning level.
+if(DEFINED TS_ROOT)
+ string(APPEND CMAKE_C_FLAGS_INIT " -Wall")
+endif()
+
# - Link position independent executable
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -pie")