aboutsummaryrefslogtreecommitdiff
path: root/components/service/secure_storage
diff options
context:
space:
mode:
Diffstat (limited to 'components/service/secure_storage')
-rw-r--r--components/service/secure_storage/provider/mock_store/mock_store_provider.c98
-rw-r--r--components/service/secure_storage/provider/mock_store/mock_store_provider.h4
-rw-r--r--components/service/secure_storage/provider/secure_flash_store/sfs_provider.c12
-rw-r--r--components/service/secure_storage/provider/secure_flash_store/sfs_provider.h4
-rw-r--r--components/service/secure_storage/test/its_tests.cpp4
5 files changed, 61 insertions, 61 deletions
diff --git a/components/service/secure_storage/provider/mock_store/mock_store_provider.c b/components/service/secure_storage/provider/mock_store/mock_store_provider.c
index 9f1ce2edd..b5eda2cd9 100644
--- a/components/service/secure_storage/provider/mock_store/mock_store_provider.c
+++ b/components/service/secure_storage/provider/mock_store/mock_store_provider.c
@@ -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,13 +21,13 @@ static rpc_status_t remove_handler(void *context, struct call_req* req);
/* Handler mapping table for service */
static const struct service_handler handler_table[] = {
- {TS_SECURE_STORAGE_OPCODE_SET, set_handler},
- {TS_SECURE_STORAGE_OPCODE_GET, get_handler},
- {TS_SECURE_STORAGE_OPCODE_GET_INFO, get_info_handler},
- {TS_SECURE_STORAGE_OPCODE_REMOVE, remove_handler}
+ {TS_SECURE_STORAGE_OPCODE_SET, set_handler},
+ {TS_SECURE_STORAGE_OPCODE_GET, get_handler},
+ {TS_SECURE_STORAGE_OPCODE_GET_INFO, get_info_handler},
+ {TS_SECURE_STORAGE_OPCODE_REMOVE, remove_handler}
};
-struct call_ep *mock_store_provider_init(struct mock_store_provider *context)
+struct rpc_interface *mock_store_provider_init(struct mock_store_provider *context)
{
for (int i = 0; i < MOCK_STORE_NUM_SLOTS; ++i) {
@@ -40,7 +40,7 @@ struct call_ep *mock_store_provider_init(struct mock_store_provider *context)
service_provider_init(&context->base_provider, context,
handler_table, sizeof(handler_table)/sizeof(struct service_handler));
- return service_provider_get_call_ep(&context->base_provider);
+ return service_provider_get_rpc_interface(&context->base_provider);
}
void mock_store_provider_deinit(struct mock_store_provider *context)
@@ -120,21 +120,21 @@ static rpc_status_t set_handler(void *context, struct call_req *req)
psa_status_t psa_status = PSA_ERROR_INSUFFICIENT_MEMORY;
struct mock_store_provider *this_context = (struct mock_store_provider*)context;
struct mock_store_slot *slot;
- struct secure_storage_request_set *request_desc;
+ struct secure_storage_request_set *request_desc;
- /* Checking if the descriptor fits into the request buffer */
- if (req->req_buf.data_len < sizeof(struct secure_storage_request_set))
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking if the descriptor fits into the request buffer */
+ if (req->req_buf.data_len < sizeof(struct secure_storage_request_set))
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
- request_desc = (struct secure_storage_request_set *)(req->req_buf.data);
+ request_desc = (struct secure_storage_request_set *)(req->req_buf.data);
- /* Checking for overflow */
- if (sizeof(struct secure_storage_request_set) + request_desc->data_length < request_desc->data_length)
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking for overflow */
+ if (sizeof(struct secure_storage_request_set) + request_desc->data_length < request_desc->data_length)
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
- /* Checking if descriptor and data fits into the request buffer */
- if (req->req_buf.data_len < sizeof(struct secure_storage_request_set) + request_desc->data_length)
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking if descriptor and data fits into the request buffer */
+ if (req->req_buf.data_len < sizeof(struct secure_storage_request_set) + request_desc->data_length)
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
/* Replace existing or add new item */
slot = find_slot(this_context, request_desc->uid);
@@ -152,27 +152,27 @@ static rpc_status_t set_handler(void *context, struct call_req *req)
}
}
- call_req_set_opstatus(req, psa_status);
+ call_req_set_opstatus(req, psa_status);
- return TS_RPC_CALL_ACCEPTED;
+ return TS_RPC_CALL_ACCEPTED;
}
static rpc_status_t get_handler(void *context, struct call_req *req)
{
- struct mock_store_provider *this_context = (struct mock_store_provider*)context;
+ struct mock_store_provider *this_context = (struct mock_store_provider*)context;
struct secure_storage_request_get *request_desc;
- psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
+ psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store_slot *slot;
- /* Checking if the descriptor fits into the request buffer */
- if (req->req_buf.data_len < sizeof(struct secure_storage_request_get))
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking if the descriptor fits into the request buffer */
+ if (req->req_buf.data_len < sizeof(struct secure_storage_request_get))
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
- request_desc = (struct secure_storage_request_get *)(req->req_buf.data);
+ request_desc = (struct secure_storage_request_get *)(req->req_buf.data);
- /* Check if the requested data would fit into the response buffer. */
- if (req->resp_buf.size < request_desc->data_size)
- return TS_RPC_ERROR_INVALID_RESP_BODY;
+ /* Check if the requested data would fit into the response buffer. */
+ if (req->resp_buf.size < request_desc->data_size)
+ return TS_RPC_ERROR_INVALID_RESP_BODY;
/* Find the item */
slot = find_slot(this_context, request_desc->uid);
@@ -183,28 +183,28 @@ static rpc_status_t get_handler(void *context, struct call_req *req)
psa_status = PSA_SUCCESS;
}
- call_req_set_opstatus(req, psa_status);
+ call_req_set_opstatus(req, psa_status);
- return TS_RPC_CALL_ACCEPTED;
+ return TS_RPC_CALL_ACCEPTED;
}
static rpc_status_t get_info_handler(void *context, struct call_req *req)
{
- struct mock_store_provider *this_context = (struct mock_store_provider*)context;
+ struct mock_store_provider *this_context = (struct mock_store_provider*)context;
struct secure_storage_request_get_info *request_desc;
- struct secure_storage_response_get_info *response_desc;
- psa_status_t psa_status;
+ struct secure_storage_response_get_info *response_desc;
+ psa_status_t psa_status;
struct mock_store_slot *slot;
- /* Checking if the descriptor fits into the request buffer */
- if (req->req_buf.data_len < sizeof(struct secure_storage_request_get_info))
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking if the descriptor fits into the request buffer */
+ if (req->req_buf.data_len < sizeof(struct secure_storage_request_get_info))
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
- request_desc = (struct secure_storage_request_get_info *)(req->req_buf.data);
+ request_desc = (struct secure_storage_request_get_info *)(req->req_buf.data);
- /* Checking if the response structure would fit the response buffer */
- if (req->resp_buf.size < sizeof(struct secure_storage_response_get_info))
- return TS_RPC_ERROR_INVALID_RESP_BODY;
+ /* Checking if the response structure would fit the response buffer */
+ if (req->resp_buf.size < sizeof(struct secure_storage_response_get_info))
+ return TS_RPC_ERROR_INVALID_RESP_BODY;
response_desc = (struct secure_storage_response_get_info *)(req->resp_buf.data);
req->resp_buf.data_len = sizeof(struct secure_storage_response_get_info);
@@ -227,21 +227,21 @@ static rpc_status_t get_info_handler(void *context, struct call_req *req)
call_req_set_opstatus(req, psa_status);
- return TS_RPC_CALL_ACCEPTED;
+ return TS_RPC_CALL_ACCEPTED;
}
static rpc_status_t remove_handler(void *context, struct call_req *req)
{
- struct mock_store_provider *this_context = (struct mock_store_provider*)context;
+ struct mock_store_provider *this_context = (struct mock_store_provider*)context;
struct secure_storage_request_remove *request_desc;
- psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
+ psa_status_t psa_status = PSA_ERROR_DOES_NOT_EXIST;
struct mock_store_slot *slot;
- /* Checking if the descriptor fits into the request buffer */
- if (req->req_buf.data_len < sizeof(struct secure_storage_request_remove))
- return TS_RPC_ERROR_INVALID_REQ_BODY;
+ /* Checking if the descriptor fits into the request buffer */
+ if (req->req_buf.data_len < sizeof(struct secure_storage_request_remove))
+ return TS_RPC_ERROR_INVALID_REQ_BODY;
- request_desc = (struct secure_storage_request_remove *)(req->req_buf.data);
+ request_desc = (struct secure_storage_request_remove *)(req->req_buf.data);
/* Find and remove the item */
slot = find_slot(this_context, request_desc->uid);
@@ -253,5 +253,5 @@ static rpc_status_t remove_handler(void *context, struct call_req *req)
call_req_set_opstatus(req, psa_status);
- return TS_RPC_CALL_ACCEPTED;
+ return TS_RPC_CALL_ACCEPTED;
} \ No newline at end of file
diff --git a/components/service/secure_storage/provider/mock_store/mock_store_provider.h b/components/service/secure_storage/provider/mock_store/mock_store_provider.h
index ecb457a35..9d2c136e4 100644
--- a/components/service/secure_storage/provider/mock_store/mock_store_provider.h
+++ b/components/service/secure_storage/provider/mock_store/mock_store_provider.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
*/
@@ -31,7 +31,7 @@ struct mock_store_provider
struct mock_store_slot slots[MOCK_STORE_NUM_SLOTS];
};
-struct call_ep *mock_store_provider_init(struct mock_store_provider *context);
+struct rpc_interface *mock_store_provider_init(struct mock_store_provider *context);
void mock_store_provider_deinit(struct mock_store_provider *context);
/* Test support methods */
diff --git a/components/service/secure_storage/provider/secure_flash_store/sfs_provider.c b/components/service/secure_storage/provider/secure_flash_store/sfs_provider.c
index 5c801ed67..76b6cbac1 100644
--- a/components/service/secure_storage/provider/secure_flash_store/sfs_provider.c
+++ b/components/service/secure_storage/provider/secure_flash_store/sfs_provider.c
@@ -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
*/
@@ -9,7 +9,7 @@
#include <protocols/service/secure_storage/packed-c/secure_storage_proto.h>
#include <protocols/service/psa/packed-c/status.h>
#include <protocols/rpc/common/packed-c/status.h>
-#include <components/rpc/common/endpoint/call_ep.h>
+#include <components/rpc/common/endpoint/rpc_interface.h>
#include <stdio.h>
@@ -21,9 +21,9 @@ static const struct service_handler handler_table[] = {
{TS_SECURE_STORAGE_OPCODE_REMOVE, sfs_remove_handler}
};
-struct call_ep *sfs_provider_init(struct sfs_provider *context)
+struct rpc_interface *sfs_provider_init(struct sfs_provider *context)
{
- struct call_ep *call_ep = NULL;
+ struct rpc_interface *rpc_interface = NULL;
if (context == NULL)
goto out;
@@ -34,10 +34,10 @@ struct call_ep *sfs_provider_init(struct sfs_provider *context)
service_provider_init(&context->base_provider, context, handler_table,
sizeof(handler_table) / sizeof(handler_table[0]));
- call_ep = service_provider_get_call_ep(&context->base_provider);
+ rpc_interface = service_provider_get_rpc_interface(&context->base_provider);
out:
- return call_ep;
+ return rpc_interface;
}
rpc_status_t sfs_set_handler(void *context, struct call_req *req)
diff --git a/components/service/secure_storage/provider/secure_flash_store/sfs_provider.h b/components/service/secure_storage/provider/secure_flash_store/sfs_provider.h
index 82887de8a..a1d4c9c01 100644
--- a/components/service/secure_storage/provider/secure_flash_store/sfs_provider.h
+++ b/components/service/secure_storage/provider/secure_flash_store/sfs_provider.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
*/
@@ -17,7 +17,7 @@ struct sfs_provider {
struct service_provider base_provider;
};
-struct call_ep *sfs_provider_init(struct sfs_provider *context);
+struct rpc_interface *sfs_provider_init(struct sfs_provider *context);
rpc_status_t sfs_set_handler(void *context, struct call_req *req);
rpc_status_t sfs_get_handler(void *context, struct call_req *req);
rpc_status_t sfs_get_info_handler(void *context, struct call_req *req);
diff --git a/components/service/secure_storage/test/its_tests.cpp b/components/service/secure_storage/test/its_tests.cpp
index fbd432dd5..9ec24e445 100644
--- a/components/service/secure_storage/test/its_tests.cpp
+++ b/components/service/secure_storage/test/its_tests.cpp
@@ -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
*/
@@ -17,7 +17,7 @@ TEST_GROUP(InternalTrustedStorageTests)
{
void setup()
{
- struct call_ep *storage_ep = sfs_provider_init(&m_storage_provider);
+ struct rpc_interface *storage_ep = sfs_provider_init(&m_storage_provider);
struct rpc_caller *storage_caller = direct_caller_init_default(&m_storage_caller, storage_ep);
psa_its_client_init(storage_caller);
}