aboutsummaryrefslogtreecommitdiff
path: root/components/service/crypto/client/test/mock/mock_crypto_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'components/service/crypto/client/test/mock/mock_crypto_client.cpp')
-rw-r--r--components/service/crypto/client/test/mock/mock_crypto_client.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/components/service/crypto/client/test/mock/mock_crypto_client.cpp b/components/service/crypto/client/test/mock/mock_crypto_client.cpp
index 8e55d34..a654ed1 100644
--- a/components/service/crypto/client/test/mock/mock_crypto_client.cpp
+++ b/components/service/crypto/client/test/mock/mock_crypto_client.cpp
@@ -1,10 +1,11 @@
/*
- * 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
*/
#include "mock_crypto_client.h"
+#include <service/crypto/provider/serializer/protobuf/pb_crypto_provider_serializer.h>
mock_crypto_client::mock_crypto_client() :
test_crypto_client(),
@@ -27,11 +28,19 @@ bool mock_crypto_client::init()
if (should_do) {
- struct call_ep *storage_ep = mock_store_provider_init(&m_storage_provider);
- struct rpc_caller *storage_caller = direct_caller_init_default(&m_storage_caller, storage_ep);
+ struct rpc_interface *storage_ep = mock_store_provider_init(&m_storage_provider);
+ struct rpc_caller *storage_caller = direct_caller_init_default(&m_storage_caller,
+ storage_ep);
- struct call_ep *crypto_ep = mbed_crypto_provider_init(&m_crypto_provider, storage_caller);
- struct rpc_caller *crypto_caller = direct_caller_init_default(&m_crypto_caller, crypto_ep);
+ struct rpc_interface *crypto_ep = mbed_crypto_provider_init(&m_crypto_provider,
+ storage_caller);
+ struct rpc_caller *crypto_caller = direct_caller_init_default(&m_crypto_caller,
+ crypto_ep);
+
+ mbed_crypto_provider_register_serializer(&m_crypto_provider,
+ TS_RPC_ENCODING_PROTOBUF, pb_crypto_provider_serializer_instance());
+
+ rpc_caller_set_encoding_scheme(crypto_caller, TS_RPC_ENCODING_PROTOBUF);
crypto_client::set_caller(crypto_caller);
}