Add se-proxy deployment
Remove mock up backend for secure storage in se proxy
deployment, setup crypto, attestation, secure storage
and its ipc backend with openamp as messenger to
secure enclave side.
Include the makefiles for libmetal and openamp,
setup the memory regions for mhu and openamp.
Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Change-Id: Ifc6f2cb105085388c6987308df2fd9c53a04f181
diff --git a/deployments/se-proxy/common/service_proxy_factory.c b/deployments/se-proxy/common/service_proxy_factory.c
index acfb6e8..bacab1d 100644
--- a/deployments/se-proxy/common/service_proxy_factory.c
+++ b/deployments/se-proxy/common/service_proxy_factory.c
@@ -1,29 +1,42 @@
/*
- * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2021-2023, Linaro Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stddef.h>
+#include <psa/sid.h>
#include <rpc/common/endpoint/rpc_interface.h>
+#include <rpc/psa_ipc/caller/sp/psa_ipc_caller.h>
#include <service/attestation/provider/attest_provider.h>
#include <service/attestation/provider/serializer/packed-c/packedc_attest_provider_serializer.h>
#include <service/crypto/factory/crypto_provider_factory.h>
#include <service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.h>
+#include <trace.h>
-/* Stub backends */
-#include <service/crypto/backend/stub/stub_crypto_backend.h>
-#include <service/secure_storage/backend/mock_store/mock_store.h>
+/* backends */
+#include <service/crypto/backend/psa_ipc/crypto_ipc_backend.h>
+#include <service/secure_storage/backend/secure_storage_ipc/secure_storage_ipc.h>
+#include <service/attestation/client/psa/iat_client.h>
+
+struct psa_ipc_caller psa_ipc;
struct rpc_interface *attest_proxy_create(void)
{
struct rpc_interface *attest_iface;
+ struct rpc_caller *attest_caller;
/* Static objects for proxy instance */
static struct attest_provider attest_provider;
+ attest_caller = psa_ipc_caller_init(&psa_ipc);
+ if (!attest_caller)
+ return NULL;
+
/* Initialize the service provider */
attest_iface = attest_provider_init(&attest_provider);
+ psa_iat_client_init(&psa_ipc.rpc_caller);
attest_provider_register_serializer(&attest_provider,
TS_RPC_ENCODING_PACKED_C, packedc_attest_provider_serializer_instance());
@@ -35,32 +48,49 @@
{
struct rpc_interface *crypto_iface = NULL;
struct crypto_provider *crypto_provider;
+ struct rpc_caller *crypto_caller;
- if (stub_crypto_backend_init() == PSA_SUCCESS) {
+ crypto_caller = psa_ipc_caller_init(&psa_ipc);
+ if (!crypto_caller)
+ return NULL;
- crypto_provider = crypto_provider_factory_create();
- crypto_iface = service_provider_get_rpc_interface(&crypto_provider->base_provider);
- }
+ if (crypto_ipc_backend_init(&psa_ipc.rpc_caller) != PSA_SUCCESS)
+ return NULL;
+
+ crypto_provider = crypto_provider_factory_create();
+ crypto_iface = service_provider_get_rpc_interface(&crypto_provider->base_provider);
return crypto_iface;
}
struct rpc_interface *ps_proxy_create(void)
{
- static struct mock_store ps_backend;
static struct secure_storage_provider ps_provider;
+ static struct secure_storage_ipc ps_backend;
+ struct rpc_caller *storage_caller;
+ struct storage_backend *backend;
- struct storage_backend *backend = mock_store_init(&ps_backend);
+ storage_caller = psa_ipc_caller_init(&psa_ipc);
+ if (!storage_caller)
+ return NULL;
+ backend = secure_storage_ipc_init(&ps_backend, &psa_ipc.rpc_caller);
+ ps_backend.service_handle = TFM_PROTECTED_STORAGE_SERVICE_HANDLE;
return secure_storage_provider_init(&ps_provider, backend);
}
struct rpc_interface *its_proxy_create(void)
{
- static struct mock_store its_backend;
static struct secure_storage_provider its_provider;
+ static struct secure_storage_ipc its_backend;
+ struct rpc_caller *storage_caller;
+ struct storage_backend *backend;
- struct storage_backend *backend = mock_store_init(&its_backend);
+ storage_caller = psa_ipc_caller_init(&psa_ipc);
+ if (!storage_caller)
+ return NULL;
+ backend = secure_storage_ipc_init(&its_backend, &psa_ipc.rpc_caller);
+ its_backend.service_handle = TFM_INTERNAL_TRUSTED_STORAGE_SERVICE_HANDLE;
return secure_storage_provider_init(&its_provider, backend);
}