Add support for 64-bit operation status values
For compatibility with 64-bit EFI status codes, opstatus values
are now treated as 64-bit rather than 32-bit. A new rpc_opstatus_t
type has been introduced in this change. Note that the FFARPC
still maps the opstatus value to a 32-bit regsiter value but
this is sign extended up to 64-bits in RPC callers. The MM
Communicate RPC caller and endpoint handle 64-bit status values.
Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: I06a0883394f370ccb543ebab797973bb604ff489
diff --git a/components/rpc/common/caller/rpc_caller.c b/components/rpc/common/caller/rpc_caller.c
index 00b559c..2dceabe 100644
--- a/components/rpc/common/caller/rpc_caller.c
+++ b/components/rpc/common/caller/rpc_caller.c
@@ -28,7 +28,7 @@
}
rpc_status_t rpc_caller_invoke(struct rpc_caller *s, rpc_call_handle handle,
- uint32_t opcode, int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ uint32_t opcode, rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
return s->call_invoke(s->context, handle, opcode, opstatus, resp_buf, resp_len);
}
diff --git a/components/rpc/common/endpoint/rpc_interface.h b/components/rpc/common/endpoint/rpc_interface.h
index ba949de..eb98587 100644
--- a/components/rpc/common/endpoint/rpc_interface.h
+++ b/components/rpc/common/endpoint/rpc_interface.h
@@ -62,7 +62,7 @@
uint32_t interface_id;
uint32_t opcode;
uint32_t encoding;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct call_param_buf req_buf;
struct call_param_buf resp_buf;
};
@@ -87,12 +87,12 @@
return req->encoding;
}
-static inline int call_req_get_opstatus(const struct call_req *req)
+static inline rpc_opstatus_t call_req_get_opstatus(const struct call_req *req)
{
return req->opstatus;
}
-static inline void call_req_set_opstatus(struct call_req *req, int opstatus)
+static inline void call_req_set_opstatus(struct call_req *req, rpc_opstatus_t opstatus)
{
req->opstatus = opstatus;
}
diff --git a/components/rpc/common/interface/rpc_caller.h b/components/rpc/common/interface/rpc_caller.h
index 879d2cb..387489c 100644
--- a/components/rpc/common/interface/rpc_caller.h
+++ b/components/rpc/common/interface/rpc_caller.h
@@ -42,7 +42,7 @@
rpc_call_handle (*call_begin)(void *context, uint8_t **req_buf, size_t req_len);
rpc_status_t (*call_invoke)(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
void (*call_end)(void *context, rpc_call_handle handle);
};
@@ -79,7 +79,7 @@
* call_end() is called for the transaction.
*/
RPC_CALLER_EXPORTED rpc_status_t rpc_caller_invoke(struct rpc_caller *s, rpc_call_handle handle,
- uint32_t opcode, int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ uint32_t opcode, rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
/*
* Ends the call transaction, allowing any resource associated with the
diff --git a/components/rpc/common/interface/rpc_status.h b/components/rpc/common/interface/rpc_status.h
index 0405a64..cba9dac 100644
--- a/components/rpc/common/interface/rpc_status.h
+++ b/components/rpc/common/interface/rpc_status.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,6 +21,15 @@
*/
typedef int32_t rpc_status_t;
+/** \brief RPC operation status code type
+ *
+ * Used for returning the endpoint specific operation status.
+ * Different service layer protocols will use different status
+ * value schemes. Status values returned by an operation are
+ * carried by the RPC layer using this type.
+ */
+typedef int64_t rpc_opstatus_t;
+
#ifdef __cplusplus
}
#endif
diff --git a/components/rpc/common/logging/logging_caller.c b/components/rpc/common/logging/logging_caller.c
index efc1184..07c33de 100644
--- a/components/rpc/common/logging/logging_caller.c
+++ b/components/rpc/common/logging/logging_caller.c
@@ -10,7 +10,7 @@
static rpc_call_handle call_begin(void *context, uint8_t **req_buf, size_t req_len);
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
static void call_end(void *context, rpc_call_handle handle);
@@ -69,7 +69,7 @@
}
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
struct logging_caller *this_instance = (struct logging_caller*)context;
rpc_status_t status = TS_RPC_ERROR_INVALID_TRANSACTION;
diff --git a/components/rpc/direct/direct_caller.c b/components/rpc/direct/direct_caller.c
index 14f1a91..61f25d7 100644
--- a/components/rpc/direct/direct_caller.c
+++ b/components/rpc/direct/direct_caller.c
@@ -14,7 +14,7 @@
static rpc_call_handle call_begin(void *context, uint8_t **req_buf, size_t req_len);
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
static void call_end(void *context, rpc_call_handle handle);
@@ -85,7 +85,7 @@
}
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
struct direct_caller *this_context = (struct direct_caller*)context;
rpc_status_t status = TS_RPC_ERROR_INVALID_TRANSACTION;
diff --git a/components/rpc/dummy/dummy_caller.c b/components/rpc/dummy/dummy_caller.c
index f55b418..da0f491 100644
--- a/components/rpc/dummy/dummy_caller.c
+++ b/components/rpc/dummy/dummy_caller.c
@@ -9,12 +9,12 @@
static rpc_call_handle call_begin(void *context, uint8_t **req_buf, size_t req_len);
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
static void call_end(void *context, rpc_call_handle handle);
struct rpc_caller *dummy_caller_init(struct dummy_caller *s,
- rpc_status_t rpc_status, int opstatus)
+ rpc_status_t rpc_status, rpc_opstatus_t opstatus)
{
struct rpc_caller *base = &s->rpc_caller;
@@ -49,7 +49,7 @@
}
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
struct dummy_caller *this_context = (struct dummy_caller*)context;
diff --git a/components/rpc/dummy/dummy_caller.h b/components/rpc/dummy/dummy_caller.h
index 27fe68a..b93c02f 100644
--- a/components/rpc/dummy/dummy_caller.h
+++ b/components/rpc/dummy/dummy_caller.h
@@ -26,12 +26,12 @@
{
struct rpc_caller rpc_caller;
rpc_status_t rpc_status;
- int opstatus;
+ rpc_opstatus_t opstatus;
uint8_t *req_buf;
};
struct rpc_caller *dummy_caller_init(struct dummy_caller *s,
- rpc_status_t rpc_status, int opstatus);
+ rpc_status_t rpc_status, rpc_opstatus_t opstatus);
void dummy_caller_deinit(struct dummy_caller *s);
#ifdef __cplusplus
diff --git a/components/rpc/ffarpc/caller/linux/ffarpc_caller.c b/components/rpc/ffarpc/caller/linux/ffarpc_caller.c
index ee879a0..1464a8a 100644
--- a/components/rpc/ffarpc/caller/linux/ffarpc_caller.c
+++ b/components/rpc/ffarpc/caller/linux/ffarpc_caller.c
@@ -25,7 +25,7 @@
static rpc_call_handle call_begin(void *context, uint8_t **req_buf, size_t req_len);
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len);
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len);
static void call_end(void *context, rpc_call_handle handle);
static int kernel_write_req_buf(struct ffarpc_caller *s);
@@ -249,7 +249,7 @@
}
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
rpc_status_t rpc_status = TS_RPC_ERROR_INTERNAL;
struct ffarpc_caller *s = (struct ffarpc_caller*)context;
@@ -283,8 +283,8 @@
if (kernel_op_status == 0) {
/* Send completed normally - ffa return args in msg_args struct */
s->resp_len = (size_t)direct_msg.args[FFA_CALL_ARGS_RESP_DATA_LEN];
- rpc_status = (int)direct_msg.args[FFA_CALL_ARGS_RESP_RPC_STATUS];
- *opstatus = (int)direct_msg.args[FFA_CALL_ARGS_RESP_OP_STATUS];
+ rpc_status = (rpc_status_t)direct_msg.args[FFA_CALL_ARGS_RESP_RPC_STATUS];
+ *opstatus = (rpc_opstatus_t)((int32_t)direct_msg.args[FFA_CALL_ARGS_RESP_OP_STATUS]);
if (s->resp_len > 0) {
s->resp_buf = malloc(s->resp_len);
diff --git a/components/rpc/ffarpc/caller/sp/ffarpc_caller.c b/components/rpc/ffarpc/caller/sp/ffarpc_caller.c
index 9df7476..250b178 100644
--- a/components/rpc/ffarpc/caller/sp/ffarpc_caller.c
+++ b/components/rpc/ffarpc/caller/sp/ffarpc_caller.c
@@ -57,7 +57,7 @@
}
static rpc_status_t call_invoke(void *context, rpc_call_handle handle, uint32_t opcode,
- int *opstatus, uint8_t **resp_buf, size_t *resp_len)
+ rpc_opstatus_t *opstatus, uint8_t **resp_buf, size_t *resp_len)
{
struct ffarpc_caller *this_context = (struct ffarpc_caller *)context;
sp_result sp_res = SP_RESULT_OK;
@@ -101,7 +101,7 @@
this_context->resp_len = (size_t)resp.args[SP_CALL_ARGS_RESP_DATA_LEN];
status = resp.args[SP_CALL_ARGS_RESP_RPC_STATUS];
- *opstatus = resp.args[SP_CALL_ARGS_RESP_OP_STATUS];
+ *opstatus = (rpc_status_t)((int32_t)resp.args[SP_CALL_ARGS_RESP_OP_STATUS]);
if (this_context->resp_len > 0) {
this_context->resp_buf = shared_buffer;
diff --git a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
index 9db53eb..17f957c 100644
--- a/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
+++ b/components/rpc/ffarpc/endpoint/ffarpc_call_ep.c
@@ -17,12 +17,12 @@
extern uint16_t own_id;
static void set_resp_args(uint32_t *resp_args, uint32_t ifaceid_opcode, uint32_t data_len,
- rpc_status_t rpc_status, uint32_t opstatus)
+ rpc_status_t rpc_status, rpc_opstatus_t opstatus)
{
resp_args[SP_CALL_ARGS_IFACE_ID_OPCODE] = ifaceid_opcode;
resp_args[SP_CALL_ARGS_RESP_DATA_LEN] = data_len;
resp_args[SP_CALL_ARGS_RESP_RPC_STATUS] = rpc_status;
- resp_args[SP_CALL_ARGS_RESP_OP_STATUS] = opstatus;
+ resp_args[SP_CALL_ARGS_RESP_OP_STATUS] = (uint32_t)opstatus;
}
static void set_mgmt_resp_args(uint32_t *resp_args, uint32_t ifaceid_opcode,
diff --git a/components/service/attestation/client/provision/attest_provision_client.c b/components/service/attestation/client/provision/attest_provision_client.c
index 3301a84..5549db1 100644
--- a/components/service/attestation/client/provision/attest_provision_client.c
+++ b/components/service/attestation/client/provision/attest_provision_client.c
@@ -57,7 +57,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
instance.rpc_status = rpc_caller_invoke(instance.caller, call_handle,
TS_ATTESTATION_OPCODE_EXPORT_IAK_PUBLIC_KEY, &opstatus, &resp_buf, &resp_len);
@@ -119,7 +119,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
tlv_iterator_begin(&req_iter, req_buf, req_len);
@@ -152,7 +152,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
instance.rpc_status = rpc_caller_invoke(instance.caller, call_handle,
TS_ATTESTATION_OPCODE_IAK_EXISTS, &opstatus, &resp_buf, &resp_len);
diff --git a/components/service/attestation/client/psa/iat_client.c b/components/service/attestation/client/psa/iat_client.c
index 180c044..07b1cf5 100644
--- a/components/service/attestation/client/psa/iat_client.c
+++ b/components/service/attestation/client/psa/iat_client.c
@@ -63,7 +63,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
tlv_iterator_begin(&req_iter, req_buf, req_len);
@@ -128,7 +128,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/attestation/provider/attest_provider.c b/components/service/attestation/provider/attest_provider.c
index 990b875..c11f8ec 100644
--- a/components/service/attestation/provider/attest_provider.c
+++ b/components/service/attestation/provider/attest_provider.c
@@ -88,7 +88,7 @@
const uint8_t *token = NULL;
size_t token_size = 0;
- int opstatus = attest_report_create((int32_t)call_req_get_caller_id(req),
+ rpc_opstatus_t opstatus = attest_report_create((int32_t)call_req_get_caller_id(req),
challenge, challenge_len,
&token, &token_size);
@@ -126,7 +126,7 @@
const uint8_t *token = NULL;
size_t token_size = 0;
- int opstatus = attest_report_create((int32_t)call_req_get_caller_id(req),
+ rpc_opstatus_t opstatus = attest_report_create((int32_t)call_req_get_caller_id(req),
challenge, challenge_len,
&token, &token_size);
@@ -157,7 +157,7 @@
if (key_buffer) {
- int opstatus;
+ rpc_opstatus_t opstatus;
size_t export_size;
opstatus =
attest_key_mngr_export_iak_public_key(key_buffer, max_key_size, &export_size);
@@ -200,7 +200,7 @@
if (rpc_status == TS_RPC_CALL_ACCEPTED) {
- int opstatus;
+ rpc_opstatus_t opstatus;
opstatus = attest_key_mngr_import_iak(key_buffer, key_data_len);
call_req_set_opstatus(req, opstatus);
}
@@ -218,7 +218,7 @@
static rpc_status_t iak_exists_handler(void *context, struct call_req* req)
{
- int opstatus = PSA_ERROR_DOES_NOT_EXIST;
+ rpc_opstatus_t opstatus = PSA_ERROR_DOES_NOT_EXIST;
if (attest_key_mngr_iak_exists()) {
diff --git a/components/service/common/provider/test/service_framework_tests.cpp b/components/service/common/provider/test/service_framework_tests.cpp
index 66771ef..e4afb18 100644
--- a/components/service/common/provider/test/service_framework_tests.cpp
+++ b/components/service/common/provider/test/service_framework_tests.cpp
@@ -75,7 +75,7 @@
uint8_t *resp_buf;
size_t req_len = 100;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
handle = rpc_caller_begin(caller, &req_buf, req_len);
CHECK_TRUE(handle);
@@ -109,7 +109,7 @@
uint8_t *resp_buf;
size_t req_len = 100;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
std::string respString;
/* Expect this call transaction to succeed */
@@ -192,7 +192,7 @@
uint8_t *resp_buf;
size_t req_len = 100;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
std::string respString;
/* Expect calls that will be handled by all three chained service providers to succeed */
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h b/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
index b63efa0..3d9947d 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
@@ -74,7 +74,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -148,7 +148,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -220,7 +220,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -263,7 +263,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -307,7 +307,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -359,7 +359,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -434,7 +434,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -528,7 +528,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -595,7 +595,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
index bdf8069..3ff6b52 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
@@ -60,7 +60,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
index f92ac6e..8ad40a3 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
@@ -60,7 +60,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus = PSA_ERROR_GENERIC_ERROR;
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h b/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
index 2ac9daa..632ca35 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
@@ -42,7 +42,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -116,7 +116,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -188,7 +188,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -240,7 +240,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -311,7 +311,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -374,7 +374,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
index 43d39d8..8336bdf 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
@@ -43,7 +43,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
index f1ab95b..ed3c81c 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
@@ -36,7 +36,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
index b3d0132..fb25ad2 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
@@ -42,7 +42,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
index 6c90e07..465e86a 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
@@ -41,7 +41,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
index 853cc4d..ccc952f 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
@@ -43,7 +43,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
index 4a239bc..33a0779 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
@@ -37,7 +37,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h b/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
index 86d3026..9ea3eb4 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
@@ -38,7 +38,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
index 9a332ff..3dfa6de 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
@@ -39,7 +39,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -100,7 +100,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -143,7 +143,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -206,7 +206,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -250,7 +250,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -290,7 +290,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
index 25355b1..8c1949d 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
@@ -51,7 +51,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h b/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
index 068a786..496f07e 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
@@ -40,7 +40,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -92,7 +92,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -145,7 +145,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -191,7 +191,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -233,7 +233,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -271,7 +271,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -338,7 +338,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -391,7 +391,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -439,7 +439,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -492,7 +492,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h b/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
index 2e99580..739f312 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
@@ -42,7 +42,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
@@ -119,7 +119,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -162,7 +162,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -234,7 +234,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -273,7 +273,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
index 9b50387..84af48f 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
@@ -36,7 +36,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, &req_msg, req_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
index 975b7af..e807773 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
@@ -50,7 +50,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
index c5d1d35..4715294 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
@@ -54,7 +54,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
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 e53420f..1778035 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
@@ -75,7 +75,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_GenerateKeyIn_fields, &req_msg);
@@ -129,7 +129,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_DestroyKeyIn_fields, &req_msg);
@@ -170,7 +170,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ImportKeyIn_fields, &req_msg);
@@ -251,7 +251,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ExportKeyIn_fields, &req_msg);
@@ -327,7 +327,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ExportPublicKeyIn_fields, &req_msg);
@@ -410,7 +410,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_SignHashIn_fields, &req_msg);
@@ -491,7 +491,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_VerifyHashIn_fields, &req_msg);
@@ -542,7 +542,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus = PSA_ERROR_GENERIC_ERROR;
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_AsymmetricEncryptIn_fields, &req_msg);
@@ -626,7 +626,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_AsymmetricDecryptIn_fields, &req_msg);
@@ -698,7 +698,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_GenerateRandomIn_fields, &req_msg);
diff --git a/components/service/discovery/client/discovery_client.c b/components/service/discovery/client/discovery_client.c
index 2ab9731..5fc2ff3 100644
--- a/components/service/discovery/client/discovery_client.c
+++ b/components/service/discovery/client/discovery_client.c
@@ -24,7 +24,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
service_client->rpc_status = rpc_caller_invoke(service_client->caller, call_handle,
TS_DISCOVERY_OPCODE_GET_SERVICE_INFO, &opstatus, &resp_buf, &resp_len);
diff --git a/components/service/secure_storage/backend/secure_storage_client/secure_storage_client.c b/components/service/secure_storage/backend/secure_storage_client/secure_storage_client.c
index 9f200bc..cd7c147 100644
--- a/components/service/secure_storage/backend/secure_storage_client/secure_storage_client.c
+++ b/components/service/secure_storage/backend/secure_storage_client/secure_storage_client.c
@@ -44,6 +44,8 @@
handle = rpc_caller_begin(this_context->client.caller, &request, request_length);
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+
/* Populating request descriptor */
request_desc = (struct secure_storage_request_set *)request;
request_desc->uid = uid;
@@ -54,13 +56,16 @@
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_SET,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
}
+ else {
+ psa_status = opstatus;
+ }
rpc_caller_end(this_context->client.caller, handle);
}
@@ -98,6 +103,8 @@
handle = rpc_caller_begin(this_context->client.caller, &request, sizeof(*request_desc));
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+
/* Populating request descriptor */
request_desc = (struct secure_storage_request_get *)request;
request_desc->uid = uid;
@@ -107,13 +114,16 @@
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_GET,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED ) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
}
+ else {
+ psa_status = opstatus;
+ }
/* Filling output parameters */
if (psa_status == PSA_SUCCESS) {
@@ -153,20 +163,27 @@
handle = rpc_caller_begin(this_context->client.caller, &request, sizeof(*request_desc));
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+
/* Populating request descriptor */
request_desc = (struct secure_storage_request_get_info *)request;
request_desc->uid = uid;
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller, handle,
TS_SECURE_STORAGE_OPCODE_GET_INFO,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
- } else if (response_length && response_length != sizeof(*response_desc)) {
- psa_status = PSA_ERROR_GENERIC_ERROR;
+ } else {
+ if (response_length && response_length != sizeof(*response_desc)) {
+ psa_status = PSA_ERROR_GENERIC_ERROR;
+ }
+ else {
+ psa_status = opstatus;
+ }
}
if (psa_status == PSA_SUCCESS) {
@@ -208,6 +225,8 @@
handle = rpc_caller_begin(this_context->client.caller, &request, sizeof(*request_desc));
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+
/* Populating request descriptor */
request_desc = (struct secure_storage_request_remove *)request;
request_desc->uid = uid;
@@ -215,13 +234,16 @@
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_REMOVE,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
}
+ else {
+ psa_status = opstatus;
+ }
rpc_caller_end(this_context->client.caller, handle);
}
@@ -256,6 +278,7 @@
handle = rpc_caller_begin(this_context->client.caller, &request, request_length);
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
request_desc = (struct secure_storage_request_create*)request;
request_desc->uid = uid;
@@ -265,13 +288,16 @@
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_CREATE,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
}
+ else {
+ psa_status = opstatus;
+ }
rpc_caller_end(this_context->client.caller, handle);
}
@@ -315,6 +341,8 @@
handle = rpc_caller_begin(this_context->client.caller, &request, request_length);
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+
/* Populating request descriptor */
request_desc = (struct secure_storage_request_set_extended *)request;
request_desc->uid = uid;
@@ -325,13 +353,16 @@
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_SET_EXTENDED,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
}
+ else {
+ psa_status = opstatus;
+ }
rpc_caller_end(this_context->client.caller, handle);
}
@@ -358,18 +389,24 @@
handle = rpc_caller_begin(this_context->client.caller, &request, 0);
if (handle) {
+ rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
this_context->client.rpc_status = rpc_caller_invoke(this_context->client.caller,
handle,
TS_SECURE_STORAGE_OPCODE_GET_SUPPORT,
- (uint32_t *)&psa_status, &response,
+ &opstatus, &response,
&response_length);
if (this_context->client.rpc_status != TS_RPC_CALL_ACCEPTED) {
/* RPC failure */
psa_status = PSA_ERROR_GENERIC_ERROR;
- } else if (response_length < sizeof(*response_desc)) {
- psa_status = PSA_ERROR_GENERIC_ERROR;
+ } else {
+ if (response_length < sizeof(*response_desc)) {
+ psa_status = PSA_ERROR_GENERIC_ERROR;
+ }
+ else {
+ psa_status = opstatus;
+ }
}
if (psa_status == PSA_SUCCESS) {
diff --git a/components/service/smm_variable/backend/test/variable_index_tests.cpp b/components/service/smm_variable/backend/test/variable_index_tests.cpp
index 9671e6e..c8bacf9 100644
--- a/components/service/smm_variable/backend/test/variable_index_tests.cpp
+++ b/components/service/smm_variable/backend/test/variable_index_tests.cpp
@@ -17,7 +17,7 @@
void setup()
{
efi_status_t status = variable_index_init(&m_variable_index, MAX_VARIABLES);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
guid_1.Data1 = 0x12341234;
guid_1.Data2 = 0x1234;
@@ -266,7 +266,7 @@
/* Tear down and reinitialize to simulate a reboot */
variable_index_deinit(&m_variable_index);
efi_status_t status = variable_index_init(&m_variable_index, MAX_VARIABLES);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Load the dumped contents */
size_t load_len = variable_index_restore(&m_variable_index, dump_len, buffer);
@@ -282,7 +282,7 @@
null_name.size() * sizeof(int16_t),
null_name.data());
CHECK_TRUE(info);
- UNSIGNED_LONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+ UNSIGNED_LONGLONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
info->metadata.attributes);
info = variable_index_find_next(
@@ -291,7 +291,7 @@
info->metadata.name_size,
info->metadata.name);
CHECK_TRUE(info);
- UNSIGNED_LONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
+ UNSIGNED_LONGLONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
info->metadata.attributes);
info = variable_index_find_next(
@@ -520,7 +520,7 @@
null_name.size() * sizeof(int16_t),
null_name.data());
CHECK_TRUE(info);
- UNSIGNED_LONGS_EQUAL(EFI_VARIABLE_BOOTSERVICE_ACCESS, info->metadata.attributes);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_VARIABLE_BOOTSERVICE_ACCESS, info->metadata.attributes);
info = variable_index_find_next(
&m_variable_index,
@@ -528,7 +528,7 @@
info->metadata.name_size,
info->metadata.name);
CHECK_TRUE(info);
- UNSIGNED_LONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
+ UNSIGNED_LONGLONGS_EQUAL(EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS,
info->metadata.attributes);
info = variable_index_find_next(
diff --git a/components/service/smm_variable/backend/test/variable_store_tests.cpp b/components/service/smm_variable/backend/test/variable_store_tests.cpp
index f990698..f6aba13 100644
--- a/components/service/smm_variable/backend/test/variable_store_tests.cpp
+++ b/components/service/smm_variable/backend/test/variable_store_tests.cpp
@@ -25,7 +25,7 @@
m_persistent_backend,
m_volatile_backend);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
setup_common_guid();
}
@@ -219,7 +219,7 @@
m_persistent_backend,
m_volatile_backend);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
}
static const size_t MAX_VARIABLES = 10;
@@ -242,13 +242,13 @@
std::string output_data;
status = set_variable(var_name, input_data, 0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect got variable data to be the same as the set value */
- UNSIGNED_LONGS_EQUAL(input_data.size(), output_data.size());
+ UNSIGNED_LONGLONGS_EQUAL(input_data.size(), output_data.size());
LONGS_EQUAL(0, input_data.compare(output_data));
}
@@ -260,13 +260,13 @@
std::string output_data;
status = set_variable(var_name, input_data, EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect got variable data to be the same as the set value */
- UNSIGNED_LONGS_EQUAL(input_data.size(), output_data.size());
+ UNSIGNED_LONGLONGS_EQUAL(input_data.size(), output_data.size());
LONGS_EQUAL(0, input_data.compare(output_data));
/* Expect the variable to survive a power cycle */
@@ -274,10 +274,10 @@
output_data = std::string();
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Still expect got variable data to be the same as the set value */
- UNSIGNED_LONGS_EQUAL(input_data.size(), output_data.size());
+ UNSIGNED_LONGLONGS_EQUAL(input_data.size(), output_data.size());
LONGS_EQUAL(0, input_data.compare(output_data));
}
@@ -289,18 +289,18 @@
std::string output_data;
status = set_variable(var_name, input_data, 0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Remove by setting with zero data length */
status = set_variable(var_name, std::string(), 0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect variable to no loger exist */
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, status);
}
TEST(UefiVariableStoreTests, removePersistent)
@@ -311,18 +311,18 @@
std::string output_data;
status = set_variable(var_name, input_data, EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Remove by setting with zero data length */
status = set_variable(var_name, std::string(), 0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect variable to no loger exist */
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, status);
}
TEST(UefiVariableStoreTests, bootServiceAccess)
@@ -336,24 +336,24 @@
var_name,
input_data,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* 'Reboot' */
power_cycle();
/* Expect access to be permitted */
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
- UNSIGNED_LONGS_EQUAL(input_data.size(), output_data.size());
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(input_data.size(), output_data.size());
LONGS_EQUAL(0, input_data.compare(output_data));
/* End of boot phase */
status = uefi_variable_store_exit_boot_service(&m_uefi_variable_store);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect access to be blocked */
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_ACCESS_DENIED, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_ACCESS_DENIED, status);
}
TEST(UefiVariableStoreTests, runtimeAccess)
@@ -367,22 +367,22 @@
var_name,
input_data,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* 'Reboot' */
power_cycle();
status = get_variable(var_name, output_data);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_ACCESS_DENIED, status);
- UNSIGNED_LONGS_EQUAL(EFI_ACCESS_DENIED, status);
/* End of boot phase */
status = uefi_variable_store_exit_boot_service(&m_uefi_variable_store);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Expect access to be permitted */
status = get_variable(var_name, output_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
- UNSIGNED_LONGS_EQUAL(input_data.size(), output_data.size());
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(input_data.size(), output_data.size());
LONGS_EQUAL(0, input_data.compare(output_data));
}
@@ -399,19 +399,19 @@
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = set_variable(
var_name_2,
input_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = set_variable(
var_name_3,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Prepare to enumerate */
uint8_t msg_buffer[VARIABLE_BUFFER_SIZE];
@@ -430,7 +430,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
CHECK_TRUE(compare_variable_name(var_name_1, next_name->Name, next_name->NameSize));
status = uefi_variable_store_get_next_variable_name(
@@ -438,7 +438,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
CHECK_TRUE(compare_variable_name(var_name_2, next_name->Name, next_name->NameSize));
status = uefi_variable_store_get_next_variable_name(
@@ -446,7 +446,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
CHECK_TRUE(compare_variable_name(var_name_3, next_name->Name, next_name->NameSize));
status = uefi_variable_store_get_next_variable_name(
@@ -454,7 +454,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, status);
power_cycle();
@@ -469,7 +469,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
CHECK_TRUE(compare_variable_name(var_name_1, next_name->Name, next_name->NameSize));
status = uefi_variable_store_get_next_variable_name(
@@ -485,7 +485,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, status);
}
TEST(UefiVariableStoreTests, failedNvSet)
@@ -501,19 +501,19 @@
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = set_variable(
var_name_2,
input_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
status = set_variable(
var_name_3,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Simulate a power failure which resulted in the
* variable index being written but not the corresponding
@@ -542,7 +542,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
CHECK_TRUE(compare_variable_name(var_name_1, next_name->Name, next_name->NameSize));
status = uefi_variable_store_get_next_variable_name(
@@ -550,7 +550,7 @@
next_name,
max_name_len,
&total_len);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, status);
}
TEST(UefiVariableStoreTests, unsupportedAttribute)
@@ -564,7 +564,7 @@
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS);
- UNSIGNED_LONGS_EQUAL(EFI_UNSUPPORTED, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_UNSUPPORTED, status);
}
TEST(UefiVariableStoreTests, readOnlycheck)
@@ -578,7 +578,7 @@
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Apply a check to constrain to Read Only */
VAR_CHECK_VARIABLE_PROPERTY check_property;
@@ -589,14 +589,14 @@
check_property.MaxSize = 100;
status = set_check_var_property(var_name_1, check_property);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Subsequent set operations should fail */
status = set_variable(
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_WRITE_PROTECTED, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_WRITE_PROTECTED, status);
}
TEST(UefiVariableStoreTests, noRemoveCheck)
@@ -610,7 +610,7 @@
var_name_1,
input_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Apply a check to constrain size to > 0. This should prevent removal */
VAR_CHECK_VARIABLE_PROPERTY check_property;
@@ -621,26 +621,26 @@
check_property.MaxSize = 10;
status = set_check_var_property(var_name_1, check_property);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* Try and remove by setting with zero length data */
status = set_variable(
var_name_1,
std::string(),
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, status);
/* Setting with non zero data should work */
status = set_variable(
var_name_1,
std::string("Good"),
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, status);
/* But with data that exceeds the MaxSize */
status = set_variable(
var_name_1,
std::string("A data value that exceeds the MaxSize"),
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, status);
}
diff --git a/components/service/smm_variable/client/cpp/smm_variable_client.cpp b/components/service/smm_variable/client/cpp/smm_variable_client.cpp
index 9fb3070..2972e1a 100644
--- a/components/service/smm_variable/client/cpp/smm_variable_client.cpp
+++ b/components/service/smm_variable/client/cpp/smm_variable_client.cpp
@@ -77,7 +77,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE *access_var =
(SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE*)req_buf;
@@ -147,7 +147,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE *access_var =
(SMM_VARIABLE_COMMUNICATE_ACCESS_VARIABLE*)req_buf;
@@ -239,7 +239,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME *next_var =
(SMM_VARIABLE_COMMUNICATE_GET_NEXT_VARIABLE_NAME*)req_buf;
@@ -303,7 +303,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
m_err_rpc_status = rpc_caller_invoke(m_caller, call_handle,
SMM_VARIABLE_FUNCTION_EXIT_BOOT_SERVICE, &opstatus, &resp_buf, &resp_len);
@@ -356,7 +356,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY *req_msg =
(SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY*)req_buf;
@@ -422,7 +422,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY *req_msg =
(SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY*)req_buf;
@@ -487,7 +487,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
m_err_rpc_status = rpc_caller_invoke(m_caller, call_handle,
SMM_VARIABLE_FUNCTION_GET_PAYLOAD_SIZE, &opstatus, &resp_buf, &resp_len);
diff --git a/components/service/smm_variable/frontend/mm_communicate/smm_variable_mm_service.c b/components/service/smm_variable/frontend/mm_communicate/smm_variable_mm_service.c
index 04970a8..585fbde 100644
--- a/components/service/smm_variable/frontend/mm_communicate/smm_variable_mm_service.c
+++ b/components/service/smm_variable/frontend/mm_communicate/smm_variable_mm_service.c
@@ -12,7 +12,7 @@
struct rpc_interface *smm_variable_rpc_interface;
};
-static int32_t convert_rpc_status(rpc_status_t rpc_status)
+static rpc_opstatus_t convert_rpc_status(rpc_status_t rpc_status)
{
switch (rpc_status) {
case TS_RPC_CALL_ACCEPTED:
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 9b883ea..ce9aa3c 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
@@ -87,7 +87,7 @@
0,
std::numeric_limits<uint16_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, setWithSizeMaxDataSize)
@@ -105,7 +105,7 @@
0,
std::numeric_limits<size_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, setWithOversizeName)
@@ -123,7 +123,7 @@
(var_name.size() + 1) * sizeof(int16_t) + 1,
0);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, setWithSizeMaxNameSize)
@@ -141,7 +141,7 @@
std::numeric_limits<size_t>::max(),
0);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, setAndGetWithOversizeName)
@@ -157,7 +157,7 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->get_variable(
m_common_guid,
@@ -165,11 +165,11 @@
get_data,
(var_name.size() + 1) * sizeof(int16_t) + 1);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
/* Expect remove to be permitted */
efi_status = m_client->remove_variable(m_common_guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableAttackTests, setAndGetWithSizeMaxNameSize)
@@ -185,7 +185,7 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->get_variable(
m_common_guid,
@@ -193,11 +193,11 @@
get_data,
std::numeric_limits<size_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
/* Expect remove to be permitted */
efi_status = m_client->remove_variable(m_common_guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableAttackTests, enumerateWithOversizeName)
@@ -211,7 +211,7 @@
var_name,
(var_name.size() + 1) * sizeof(int16_t) + 1);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, enumerateWithSizeMaxNameSize)
@@ -233,7 +233,7 @@
guid,
var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Next iteration uses invalid name length */
efi_status = m_client->get_next_variable_name(
@@ -241,11 +241,11 @@
var_name,
std::numeric_limits<size_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
/* Expect to be able to remove the variable */
efi_status = m_client->remove_variable(m_common_guid, var_name_1);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableAttackTests, setCheckPropertyWithOversizeName)
@@ -265,7 +265,7 @@
var_name,
check_property,
(var_name.size() + 1) * sizeof(int16_t) + 1);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, setCheckPropertyWithMaxSizeName)
@@ -285,7 +285,7 @@
var_name,
check_property,
std::numeric_limits<size_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, getCheckPropertyWithOversizeName)
@@ -300,7 +300,7 @@
var_name,
check_property,
(var_name.size() + 1) * sizeof(int16_t) + 1);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableAttackTests, getCheckPropertyWithMaxSizeName)
@@ -315,5 +315,5 @@
var_name,
check_property,
std::numeric_limits<size_t>::max());
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
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 12240fb..c8c64ff 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
@@ -83,21 +83,21 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->get_variable(
m_common_guid,
var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(set_data.size(), get_data.size());
LONGS_EQUAL(0, get_data.compare(set_data));
/* Expect remove to be permitted */
efi_status = m_client->remove_variable(m_common_guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableServiceTests, setAndGetNv)
@@ -113,21 +113,21 @@
set_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->get_variable(
m_common_guid,
var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(set_data.size(), get_data.size());
LONGS_EQUAL(0, get_data.compare(set_data));
/* Expect remove to be permitted */
efi_status = m_client->remove_variable(m_common_guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableServiceTests, runtimeStateAccessControl)
@@ -156,21 +156,21 @@
boot_var_name,
boot_set_data,
EFI_VARIABLE_BOOTSERVICE_ACCESS);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->set_variable(
m_common_guid,
runtime_var_name,
runtime_set_data,
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Expect access to boot variable to be permitted */
efi_status = m_client->get_variable(
m_common_guid,
boot_var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(boot_set_data.size(), get_data.size());
LONGS_EQUAL(0, get_data.compare(boot_set_data));
@@ -179,35 +179,35 @@
m_common_guid,
runtime_var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
/* Exit boot service - access should no longer be permitted */
efi_status = m_client->exit_boot_service();
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Access to the boot variablel should now be forbidden */
efi_status = m_client->get_variable(
m_common_guid,
boot_var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
/* Expect access to the runtime variable to now be permitted */
efi_status = m_client->get_variable(
m_common_guid,
runtime_var_name,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(runtime_set_data.size(), get_data.size());
LONGS_EQUAL(0, get_data.compare(runtime_set_data));
/* Expect removing boot variable to be forbidden */
efi_status = m_client->remove_variable(m_common_guid, boot_var_name);
- UNSIGNED_LONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_ACCESS_DENIED, efi_status);
/* Expect removing runtime variable to be permitted */
efi_status = m_client->remove_variable(m_common_guid, runtime_var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableServiceTests, enumerateStoreContents)
@@ -225,7 +225,7 @@
set_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->set_variable(
m_common_guid,
@@ -233,7 +233,7 @@
set_data,
EFI_VARIABLE_NON_VOLATILE);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->set_variable(
m_common_guid,
@@ -241,39 +241,39 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Enumerate store contents - expect the values we added */
std::wstring var_name;
EFI_GUID guid = {0};
efi_status = m_client->get_next_variable_name(guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(var_name_1.size(), var_name.size());
LONGS_EQUAL(0, var_name.compare(var_name_1));
efi_status = m_client->get_next_variable_name(guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(var_name_2.size(), var_name.size());
LONGS_EQUAL(0, var_name.compare(var_name_2));
efi_status = m_client->get_next_variable_name(guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(var_name_3.size(), var_name.size());
LONGS_EQUAL(0, var_name.compare(var_name_3));
efi_status = m_client->get_next_variable_name(guid, var_name);
- UNSIGNED_LONGS_EQUAL(EFI_NOT_FOUND, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_NOT_FOUND, efi_status);
/* Expect to be able to remove all variables */
efi_status = m_client->remove_variable(m_common_guid, var_name_1);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->remove_variable(m_common_guid, var_name_2);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
efi_status = m_client->remove_variable(m_common_guid, var_name_3);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
}
TEST(SmmVariableServiceTests, setReadOnlyConstraint)
@@ -289,7 +289,7 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Apply a check to constrain to Read Only */
VAR_CHECK_VARIABLE_PROPERTY check_property;
@@ -303,7 +303,7 @@
m_common_guid,
var_name_1,
check_property);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Read back the check property constraint and expect it to match the set value */
VAR_CHECK_VARIABLE_PROPERTY got_check_property;
@@ -312,7 +312,7 @@
m_common_guid,
var_name_1,
got_check_property);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
UNSIGNED_LONGS_EQUAL(check_property.Revision, got_check_property.Revision);
UNSIGNED_LONGS_EQUAL(check_property.Attributes, got_check_property.Attributes);
@@ -327,7 +327,7 @@
std::string("Different variable data"),
0);
- UNSIGNED_LONGS_EQUAL(EFI_WRITE_PROTECTED, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_WRITE_PROTECTED, efi_status);
/* Expect to still be able to read variable */
std::string get_data;
@@ -337,7 +337,7 @@
var_name_1,
get_data);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Variable value should be unmodified */
UNSIGNED_LONGS_EQUAL(set_data.size(), get_data.size());
@@ -357,7 +357,7 @@
set_data,
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Apply a check to constrain the variable size */
VAR_CHECK_VARIABLE_PROPERTY check_property;
@@ -371,7 +371,7 @@
m_common_guid,
var_name_1,
check_property);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Attempt to set value to a size that exceeds the MaxSize constraint */
efi_status = m_client->set_variable(
@@ -379,7 +379,7 @@
var_name_1,
std::string("A data value that exceeds the MaxSize constraint"),
0);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
/* But setting a value that's within the constraints should work */
efi_status = m_client->set_variable(
@@ -387,11 +387,11 @@
var_name_1,
std::string("Small value"),
0);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Removing should be allowed though */
efi_status = m_client->remove_variable(m_common_guid, var_name_1);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
/* Although the variable has been removed, the constraint should
* still be set.
@@ -401,7 +401,7 @@
var_name_1,
std::string("Another try to set a value that exceeds the MaxSize constraint"),
0);
- UNSIGNED_LONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_INVALID_PARAMETER, efi_status);
}
TEST(SmmVariableServiceTests, checkMaxVariablePayload)
@@ -412,7 +412,7 @@
/* Expect to read a reasonable size for the variable payload */
efi_status = m_client->get_payload_zize(max_payload_size);
- UNSIGNED_LONGS_EQUAL(EFI_SUCCESS, efi_status);
+ UNSIGNED_LONGLONGS_EQUAL(EFI_SUCCESS, efi_status);
CHECK_TRUE(max_payload_size >= 1024);
CHECK_TRUE(max_payload_size <= 64 * 1024);
}
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 dbcc42d..9d9a20d 100644
--- a/components/service/test_runner/client/cpp/test_runner_client.cpp
+++ b/components/service/test_runner/client/cpp/test_runner_client.cpp
@@ -79,7 +79,7 @@
uint8_t *resp_buf;
size_t resp_len;
- int opstatus;
+ rpc_opstatus_t opstatus;
memcpy(req_buf, req_param.data(), req_len);