blob: 192e9768bd6b431095b9d158f9c7ae45e2c1f2c1 [file] [log] [blame]
Patrick Williams975a06f2022-10-21 14:42:47 -05001From 9c7f1e6a5eb9ab887e568cfa3c2003583d387bc9 Mon Sep 17 00:00:00 2001
2From: Vishnu Banavath <vishnu.banavath@arm.com>
3Date: Fri, 3 Dec 2021 19:25:34 +0000
4Subject: [PATCH 07/19] Use secure storage ipc and openamp for se_proxy
5
6Remove mock up backend for secure storage in se proxy
7deployment and use instead the secure storage ipc backend with
8openamp as rpc to secure enclave side.
9
10Upstream-Status: Pending
11Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
12Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
13---
14 .../se-proxy/common/service_proxy_factory.c | 16 +++++++++++++---
15 1 file changed, 13 insertions(+), 3 deletions(-)
16
17diff --git a/deployments/se-proxy/common/service_proxy_factory.c b/deployments/se-proxy/common/service_proxy_factory.c
18index acfb6e8873fa..57290056d614 100644
19--- a/deployments/se-proxy/common/service_proxy_factory.c
20+++ b/deployments/se-proxy/common/service_proxy_factory.c
21@@ -6,15 +6,20 @@
22
23 #include <stddef.h>
24 #include <rpc/common/endpoint/rpc_interface.h>
25+#include <rpc/openamp/caller/sp/openamp_caller.h>
26 #include <service/attestation/provider/attest_provider.h>
27 #include <service/attestation/provider/serializer/packed-c/packedc_attest_provider_serializer.h>
28 #include <service/crypto/factory/crypto_provider_factory.h>
29 #include <service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.h>
30+#include <trace.h>
31
32 /* Stub backends */
33 #include <service/crypto/backend/stub/stub_crypto_backend.h>
34+#include <service/secure_storage/backend/secure_storage_ipc/secure_storage_ipc.h>
35 #include <service/secure_storage/backend/mock_store/mock_store.h>
36
37+struct openamp_caller openamp;
38+
39 struct rpc_interface *attest_proxy_create(void)
40 {
41 struct rpc_interface *attest_iface;
42@@ -47,10 +52,15 @@ struct rpc_interface *crypto_proxy_create(void)
43
44 struct rpc_interface *ps_proxy_create(void)
45 {
46- static struct mock_store ps_backend;
47 static struct secure_storage_provider ps_provider;
48-
49- struct storage_backend *backend = mock_store_init(&ps_backend);
50+ static struct secure_storage_ipc ps_backend;
51+ static struct rpc_caller *storage_caller;
52+ struct storage_backend *backend;
53+
54+ storage_caller = openamp_caller_init(&openamp);
55+ if (!storage_caller)
56+ return NULL;
57+ backend = secure_storage_ipc_init(&ps_backend, &openamp.rpc_caller);
58
59 return secure_storage_provider_init(&ps_provider, backend);
60 }
61--
622.38.0
63