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