Change crypto clients to use rpc_caller_session
Signed-off-by: Imre Kis <imre.kis@arm.com>
Change-Id: I6c370e8dc14f2262a2502995f655888a80d69c7b
diff --git a/components/service/common/serializer/protobuf/pb_helper.h b/components/service/common/serializer/protobuf/pb_helper.h
index 1f109b0..61c0ae9 100644
--- a/components/service/common/serializer/protobuf/pb_helper.h
+++ b/components/service/common/serializer/protobuf/pb_helper.h
@@ -13,6 +13,8 @@
extern "C" {
#endif
+#define PB_PACKET_LENGTH(payload_length) ((payload_length) + 16)
+
/* Returns an initialised pb_callback_t structure for encoding a variable length byte array */
extern pb_callback_t pb_out_byte_array(const pb_bytes_array_t *byte_array);
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h b/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
index c4ffb20..bf39762 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_aead.h
@@ -10,6 +10,7 @@
#include <string.h>
#include <stdlib.h>
#include <psa/crypto.h>
+#include "rpc_caller_session.h"
#include <service/common/client/service_client.h>
#include <protocols/rpc/common/packed-c/status.h>
#include <protocols/service/crypto/packed-c/opcodes.h>
@@ -36,23 +37,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ sizeof(struct ts_crypto_aead_setup_out));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, opcode,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -69,7 +71,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -110,23 +112,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_GENERATE_NONCE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_GENERATE_NONCE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -154,7 +156,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -182,13 +184,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -197,12 +199,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_SET_NONCE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_SET_NONCE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -225,23 +228,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_SET_LENGTHS, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_SET_LENGTHS,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -269,13 +273,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -284,12 +288,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_UPDATE_AD, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_UPDATE_AD,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -321,13 +326,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -336,12 +341,12 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_UPDATE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_UPDATE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -369,7 +374,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -396,23 +401,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_FINISH, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_FINISH,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -458,7 +463,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -490,13 +495,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -505,12 +510,12 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_VERIFY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_VERIFY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -538,7 +543,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -557,23 +562,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_AEAD_ABORT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_AEAD_ABORT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
index 3ff6b52..9b3a68c 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_decrypt.h
@@ -54,13 +54,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -70,12 +70,12 @@
if (salt) tlv_encode(&req_iter, &salt_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_ASYMMETRIC_DECRYPT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_ASYMMETRIC_DECRYPT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -103,7 +103,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
index 8ad40a3..a260526 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_asymmetric_encrypt.h
@@ -54,13 +54,14 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(output_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+ service_status_t service_status = PSA_ERROR_GENERIC_ERROR;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -70,12 +71,12 @@
if (salt) tlv_encode(&req_iter, &salt_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_ASYMMETRIC_ENCRYPT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_ASYMMETRIC_ENCRYPT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -103,7 +104,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h b/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
index 632ca35..de087da 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_cipher.h
@@ -36,23 +36,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -69,7 +69,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -110,23 +110,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(iv_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_CIPHER_GENERATE_IV, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_CIPHER_GENERATE_IV, &resp_buf, &resp_len,
+ &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -154,7 +156,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -182,13 +184,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -197,12 +199,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_CIPHER_SET_IV, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_CIPHER_SET_IV,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -234,13 +237,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -249,12 +252,12 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_CIPHER_UPDATE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_CIPHER_UPDATE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -282,7 +285,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -305,23 +308,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_CIPHER_FINISH, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_CIPHER_FINISH,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -349,7 +352,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -368,23 +371,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_CIPHER_ABORT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_CIPHER_ABORT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
index 8336bdf..0e03ebe 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_copy_key.h
@@ -37,22 +37,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ sizeof(struct ts_crypto_copy_key_out));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
- context->rpc_status = rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_COPY_KEY, &opstatus, &resp_buf, &resp_len);
+ context->rpc_status =
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_COPY_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -69,7 +71,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
index ed3c81c..0a88ab5 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_destroy_key.h
@@ -19,37 +19,38 @@
#endif
static inline psa_status_t crypto_caller_destroy_key(struct service_client *context,
- psa_key_id_t id)
+ psa_key_id_t id)
{
- psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR;
- struct ts_crypto_destroy_key_in req_msg;
- size_t req_len = sizeof(struct ts_crypto_destroy_key_in);
+ psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR;
+ struct ts_crypto_destroy_key_in req_msg;
+ size_t req_len = sizeof(struct ts_crypto_destroy_key_in);
- req_msg.id = id;
+ req_msg.id = id;
- rpc_call_handle call_handle;
- uint8_t *req_buf;
+ rpc_call_handle call_handle;
+ uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
- if (call_handle) {
+ if (call_handle) {
- uint8_t *resp_buf;
- size_t resp_len;
- rpc_opstatus_t opstatus;
+ uint8_t *resp_buf;
+ size_t resp_len;
+ service_status_t service_status;
- memcpy(req_buf, &req_msg, req_len);
+ memcpy(req_buf, &req_msg, req_len);
- context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_DESTROY_KEY, &opstatus, &resp_buf, &resp_len);
+ context->rpc_status =
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_DESTROY_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
- }
+ rpc_caller_session_end(call_handle);
+ }
- return psa_status;
+ return psa_status;
}
#ifdef __cplusplus
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
index fb25ad2..bad11f6 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_export_key.h
@@ -36,23 +36,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(data_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_EXPORT_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_EXPORT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -80,7 +81,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
index 465e86a..0710af6 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_export_public_key.h
@@ -35,23 +35,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(data_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_EXPORT_PUBLIC_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_EXPORT_PUBLIC_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -79,7 +80,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
index ccc952f..2dd67d5 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_key.h
@@ -37,23 +37,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ sizeof(struct ts_crypto_generate_key_out));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_GENERATE_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_GENERATE_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -70,7 +71,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
index 33a0779..b9711bb 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_generate_random.h
@@ -31,23 +31,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(output_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_GENERATE_RANDOM, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_GENERATE_RANDOM,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -74,7 +75,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h b/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
index 9ea3eb4..1a79bc3 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_get_key_attributes.h
@@ -32,23 +32,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ sizeof(struct ts_crypto_get_key_attributes_out));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_GET_KEY_ATTRIBUTES, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_GET_KEY_ATTRIBUTES,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -66,7 +67,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
index 3682007..924f15e 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_hash.h
@@ -33,23 +33,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_SETUP, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_SETUP,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -66,7 +66,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -94,13 +94,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -109,12 +109,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_UPDATE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_UPDATE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -137,23 +138,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(hash_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_FINISH, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_FINISH,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -181,7 +183,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -200,23 +202,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_ABORT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_ABORT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -244,13 +247,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -259,12 +262,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_VERIFY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_VERIFY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -284,23 +288,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_HASH_CLONE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_HASH_CLONE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -317,7 +321,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
index 8c1949d..bc2e6d7 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_import_key.h
@@ -45,13 +45,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -60,12 +60,12 @@
tlv_encode(&req_iter, &key_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_IMPORT_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_IMPORT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -82,7 +82,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h b/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
index 763e2af..c60e02d 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_key_derivation.h
@@ -34,23 +34,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_SETUP, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_SETUP,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -67,7 +68,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -86,23 +87,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_GET_CAPACITY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_GET_CAPACITY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -119,7 +121,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -139,23 +141,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_SET_CAPACITY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_SET_CAPACITY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -185,13 +189,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -200,12 +204,14 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_INPUT_BYTES, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_INPUT_BYTES,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -227,23 +233,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_INPUT_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_INPUT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -265,23 +273,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(output_length));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_OUTPUT_BYTES, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_OUTPUT_BYTES,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -308,7 +318,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -322,6 +332,7 @@
psa_status_t psa_status = PSA_ERROR_GENERIC_ERROR;
struct ts_crypto_key_derivation_output_key_in req_msg;
size_t req_len = sizeof(struct ts_crypto_key_derivation_output_key_in);
+ size_t resp_len = sizeof(struct ts_crypto_key_derivation_output_key_out);
/* Set default outputs for failure case */
*key = 0;
@@ -332,23 +343,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, resp_len);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_OUTPUT_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_OUTPUT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -366,7 +378,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -385,23 +397,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_ABORT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_ABORT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -433,13 +447,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -448,12 +462,14 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_KEY_AGREEMENT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_KEY_AGREEMENT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -486,13 +502,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -501,12 +517,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_KEY_DERIVATION_RAW_KEY_AGREEMENT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle,
+ TS_CRYPTO_OPCODE_KEY_DERIVATION_RAW_KEY_AGREEMENT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -534,7 +551,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h b/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
index 739f312..c476da0 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_mac.h
@@ -36,23 +36,23 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -69,7 +69,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -113,13 +113,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -128,12 +128,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_MAC_UPDATE, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_MAC_UPDATE,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -156,23 +157,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(mac_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_MAC_SIGN_FINISH, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_MAC_SIGN_FINISH,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -200,7 +202,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -228,13 +230,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -243,12 +245,13 @@
tlv_encode(&req_iter, &data_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_MAC_VERIFY_FINISH, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_MAC_VERIFY_FINISH,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
@@ -267,23 +270,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_fixed_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_MAC_ABORT, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_MAC_ABORT,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h b/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
index 84af48f..be30434 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_purge_key.h
@@ -30,23 +30,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
memcpy(req_buf, &req_msg, req_len);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- TS_CRYPTO_OPCODE_PURGE_KEY, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, TS_CRYPTO_OPCODE_PURGE_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
index 4a9ed20..1de03b2 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_sign_hash.h
@@ -45,13 +45,14 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len,
+ tlv_required_space(signature_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -60,12 +61,12 @@
tlv_encode(&req_iter, &hash_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (context->rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -93,7 +94,7 @@
}
}
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h b/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
index daa1133..1f3d46e 100644
--- a/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
+++ b/components/service/crypto/client/caller/packed-c/crypto_caller_verify_hash.h
@@ -49,13 +49,13 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(context->caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(context->session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
struct tlv_iterator req_iter;
memcpy(req_buf, &req_msg, req_fixed_len);
@@ -65,12 +65,13 @@
tlv_encode(&req_iter, &sig_record);
context->rpc_status =
- rpc_caller_invoke(context->caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (context->rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (context->rpc_status == RPC_SUCCESS)
+ psa_status = service_status;
- rpc_caller_end(context->caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
return psa_status;
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
index 393ba44..64e9c61 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_aead.h
@@ -39,7 +39,7 @@
size_t *aeadtext_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
size_t in_len;
int i;
@@ -100,7 +100,7 @@
size_t *plaintext_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
size_t in_len;
int i;
@@ -153,7 +153,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_ENCRYPT_SETUP_SID,
@@ -183,7 +183,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_DECRYPT_SETUP_SID,
@@ -214,7 +214,7 @@
size_t *nonce_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_GENERATE_NONCE_SID,
@@ -244,7 +244,7 @@
size_t nonce_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_SET_NONCE_SID,
@@ -273,7 +273,7 @@
size_t plaintext_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_SET_LENGTHS_SID,
@@ -303,7 +303,7 @@
size_t input_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_UPDATE_AD_SID,
@@ -345,7 +345,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_UPDATE_SID,
@@ -390,7 +390,7 @@
size_t *tag_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_FINISH_SID,
@@ -443,7 +443,7 @@
size_t tag_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_VERIFY_SID,
@@ -489,7 +489,7 @@
uint32_t op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_AEAD_ABORT_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
index 03682e7..368ba39 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_decrypt.h
@@ -34,7 +34,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
size_t in_len;
struct psa_ipc_crypto_pack_iovec iov = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
index 60f5770..9cedbe8 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_asymmetric_encrypt.h
@@ -34,7 +34,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
size_t in_len;
struct psa_ipc_crypto_pack_iovec iov = {
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
index 0d32444..8da954d 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_cipher.h
@@ -31,7 +31,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_ENCRYPT_SETUP_SID,
@@ -59,7 +59,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_DECRYPT_SETUP_SID,
@@ -88,7 +88,7 @@
size_t *iv_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_GENERATE_IV_SID,
@@ -116,7 +116,7 @@
size_t iv_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_SET_IV_SID,
@@ -146,7 +146,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_UPDATE_SID,
@@ -176,7 +176,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_FINISH_SID,
@@ -203,7 +203,7 @@
uint32_t op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_CIPHER_ABORT_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
index 71cf438..f737b8e 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_copy_key.h
@@ -30,7 +30,7 @@
psa_key_id_t *target_key)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_COPY_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
index 85bd2b4..5baeb2f 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_destroy_key.h
@@ -28,7 +28,7 @@
psa_key_id_t id)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_DESTROY_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
index 5e95430..d9a9fca 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_key.h
@@ -31,7 +31,7 @@
size_t *data_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_EXPORT_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
index 349dc6c..5f62d9c 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_export_public_key.h
@@ -31,7 +31,7 @@
size_t *data_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_EXPORT_PUBLIC_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
index 31c6901..adb1957 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_key.h
@@ -29,7 +29,7 @@
psa_key_id_t *id)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_GENERATE_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
index ce51ded..f5dd217 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_generate_random.h
@@ -29,7 +29,7 @@
size_t output_size)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_GENERATE_RANDOM_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
index ea90af7..8ae3512 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_get_key_attributes.h
@@ -30,7 +30,7 @@
psa_key_attributes_t *attributes)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_GET_KEY_ATTRIBUTES_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
index 77ef4ea..e13f5db 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_hash.h
@@ -30,7 +30,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_SETUP_SID,
@@ -57,7 +57,7 @@
size_t input_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_UPDATE_SID,
@@ -85,7 +85,7 @@
size_t *hash_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_FINISH_SID,
@@ -112,7 +112,7 @@
uint32_t op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_ABORT_SID,
@@ -138,7 +138,7 @@
size_t hash_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_VERIFY_SID,
@@ -164,7 +164,7 @@
uint32_t *target_op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_HASH_CLONE_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
index 0c946a2..0444221 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_import_key.h
@@ -30,7 +30,7 @@
psa_key_id_t *id)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_IMPORT_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
index 8bc3297..f165db1 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_key_derivation.h
@@ -30,7 +30,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_SETUP_SID,
@@ -56,7 +56,7 @@
size_t *capacity)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_GET_CAPACITY_SID,
@@ -81,7 +81,7 @@
size_t capacity)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_SET_CAPACITY_SID,
@@ -106,7 +106,7 @@
size_t data_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_BYTES_SID,
@@ -131,7 +131,7 @@
psa_key_id_t key)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_INPUT_KEY_SID,
@@ -156,7 +156,7 @@
size_t output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_BYTES_SID,
@@ -182,7 +182,7 @@
psa_key_id_t *key)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_OUTPUT_KEY_SID,
@@ -208,7 +208,7 @@
uint32_t op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_ABORT_SID,
@@ -236,7 +236,7 @@
size_t peer_key_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_KEY_DERIVATION_KEY_AGREEMENT_SID,
@@ -267,7 +267,7 @@
size_t *output_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_RAW_KEY_AGREEMENT_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
index 5969233..8e8053d 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_mac.h
@@ -31,7 +31,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_SIGN_SETUP_SID,
@@ -59,7 +59,7 @@
psa_algorithm_t alg)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_VERIFY_SETUP_SID,
@@ -87,7 +87,7 @@
size_t input_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_UPDATE_SID,
@@ -115,7 +115,7 @@
size_t *mac_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_SIGN_FINISH_SID,
@@ -144,7 +144,7 @@
size_t mac_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_VERIFY_FINISH_SID,
@@ -169,7 +169,7 @@
uint32_t op_handle)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_MAC_ABORT_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
index b5894e0..6235859 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_purge_key.h
@@ -28,7 +28,7 @@
psa_key_id_t id)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_PURGE_KEY_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
index 254ee5a..ef84458 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_sign_hash.h
@@ -34,7 +34,7 @@
size_t *signature_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_ASYMMETRIC_SIGN_HASH_SID,
@@ -67,7 +67,7 @@
size_t *signature_length)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = TFM_CRYPTO_ASYMMETRIC_SIGN_MESSAGE_SID,
diff --git a/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h b/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
index 515f2a8..0e2aef1 100644
--- a/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
+++ b/components/service/crypto/client/caller/psa_ipc/crypto_caller_verify_hash.h
@@ -34,7 +34,7 @@
uint32_t function_id)
{
struct service_client *ipc = context;
- struct rpc_caller *caller = ipc->caller;
+ struct rpc_caller_interface *caller = ipc->session->caller;
psa_status_t status;
struct psa_ipc_crypto_pack_iovec iov = {
.function_id = function_id,
diff --git a/components/service/crypto/client/cpp/crypto_client.cpp b/components/service/crypto/client/cpp/crypto_client.cpp
index 3537c8a..9d5609a 100644
--- a/components/service/crypto/client/cpp/crypto_client.cpp
+++ b/components/service/crypto/client/cpp/crypto_client.cpp
@@ -5,7 +5,6 @@
*/
#include "crypto_client.h"
-#include <service/discovery/client/discovery_client.h>
#include <protocols/rpc/common/packed-c/status.h>
crypto_client::crypto_client() :
@@ -14,15 +13,10 @@
service_client_init(&m_client, NULL);
}
-crypto_client::crypto_client(struct rpc_caller *caller) :
+crypto_client::crypto_client(struct rpc_caller_session *session) :
m_client()
{
- service_client_init(&m_client, caller);
-
- if (caller) {
-
- discovery_client_get_service_info(&m_client);
- }
+ service_client_init(&m_client, session);
}
crypto_client::~crypto_client()
@@ -30,14 +24,9 @@
service_client_deinit(&m_client);
}
-void crypto_client::set_caller(struct rpc_caller *caller)
+void crypto_client::set_caller(struct rpc_caller_session *session)
{
- m_client.caller = caller;
-
- if (caller) {
-
- discovery_client_get_service_info(&m_client);
- }
+ m_client.session = session;
}
int crypto_client::err_rpc_status() const
diff --git a/components/service/crypto/client/cpp/crypto_client.h b/components/service/crypto/client/cpp/crypto_client.h
index ccb0714..eebe60e 100644
--- a/components/service/crypto/client/cpp/crypto_client.h
+++ b/components/service/crypto/client/cpp/crypto_client.h
@@ -237,8 +237,8 @@
protected:
crypto_client();
- crypto_client(struct rpc_caller *caller);
- void set_caller(struct rpc_caller *caller);
+ crypto_client(struct rpc_caller_session *session);
+ void set_caller(struct rpc_caller_session *session);
struct service_client m_client;
};
diff --git a/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.cpp b/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.cpp
index 4e10f9b..2465f05 100644
--- a/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.cpp
+++ b/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.cpp
@@ -15,8 +15,8 @@
}
-packedc_crypto_client::packedc_crypto_client(struct rpc_caller *caller) :
- crypto_client(caller)
+packedc_crypto_client::packedc_crypto_client(struct rpc_caller_session *session) :
+ crypto_client(session)
{
}
diff --git a/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.h b/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.h
index d74ba60..c0e8958 100644
--- a/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.h
+++ b/components/service/crypto/client/cpp/protocol/packed-c/packedc_crypto_client.h
@@ -7,6 +7,7 @@
#ifndef PACKEDC_CRYPTO_CLIENT_H
#define PACKEDC_CRYPTO_CLIENT_H
+#include "rpc_caller_session.h"
#include <service/crypto/client/cpp/crypto_client.h>
#include <protocols/service/crypto/packed-c/key_attributes.h>
@@ -17,7 +18,7 @@
{
public:
packedc_crypto_client();
- packedc_crypto_client(struct rpc_caller *caller);
+ packedc_crypto_client(struct rpc_caller_session *session);
virtual ~packedc_crypto_client();
/* Key lifecycle methods */
diff --git a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
index 337485f..c84c753 100644
--- a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
+++ b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.cpp
@@ -9,7 +9,6 @@
#include "protobuf_crypto_client.h"
#include <protocols/rpc/common/packed-c/status.h>
#include <service/common/serializer/protobuf/pb_helper.h>
-#include <rpc_caller.h>
#include <service/crypto/protobuf/opcodes.pb.h>
#include <service/crypto/protobuf/generate_key.pb.h>
#include <service/crypto/protobuf/destroy_key.pb.h>
@@ -30,8 +29,8 @@
}
-protobuf_crypto_client::protobuf_crypto_client(struct rpc_caller *caller) :
- crypto_client(caller)
+protobuf_crypto_client::protobuf_crypto_client(struct rpc_caller_session *session) :
+ crypto_client(session)
{
}
@@ -69,23 +68,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_GenerateKeyIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_GENERATE_KEY, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle,
+ ts_crypto_Opcode_GENERATE_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -103,7 +104,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -123,23 +124,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_DestroyKeyIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_DESTROY_KEY, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle, ts_crypto_Opcode_DESTROY_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (m_client.rpc_status == RPC_SUCCESS) psa_status = service_status;
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -164,23 +166,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ImportKeyIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_IMPORT_KEY, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle, ts_crypto_Opcode_IMPORT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -198,7 +201,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -254,23 +257,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len,
+ PB_PACKET_LENGTH(data_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ExportKeyIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_EXPORT_KEY, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle, ts_crypto_Opcode_EXPORT_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -308,7 +313,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -330,23 +335,26 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len,
+ PB_PACKET_LENGTH(data_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_ExportPublicKeyIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_EXPORT_PUBLIC_KEY, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle,
+ ts_crypto_Opcode_EXPORT_PUBLIC_KEY,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -385,7 +393,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -432,23 +440,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len,
+ PB_PACKET_LENGTH(signature_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_SignHashIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -481,7 +491,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -531,23 +541,24 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_VerifyHashIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- opcode, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle, opcode, &resp_buf, &resp_len,
+ &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) psa_status = opstatus;
+ if (m_client.rpc_status == RPC_SUCCESS) psa_status = service_status;
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -586,23 +597,26 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len,
+ PB_PACKET_LENGTH(output_size));
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus = PSA_ERROR_GENERIC_ERROR;
+ service_status_t service_status = PSA_ERROR_GENERIC_ERROR;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_AsymmetricEncryptIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_ASYMMETRIC_ENCRYPT, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle,
+ ts_crypto_Opcode_ASYMMETRIC_ENCRYPT,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -635,7 +649,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -674,23 +688,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, 0);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_AsymmetricDecryptIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_ASYMMETRIC_DECRYPT, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle,
+ ts_crypto_Opcode_ASYMMETRIC_DECRYPT,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -723,7 +739,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
@@ -746,23 +762,25 @@
rpc_call_handle call_handle;
uint8_t *req_buf;
- call_handle = rpc_caller_begin(m_client.caller, &req_buf, req_len);
+ call_handle = rpc_caller_session_begin(m_client.session, &req_buf, req_len, output_size + 8);
if (call_handle) {
uint8_t *resp_buf;
size_t resp_len;
- rpc_opstatus_t opstatus;
+ service_status_t service_status;
pb_ostream_t ostream = pb_ostream_from_buffer(req_buf, req_len);
pb_encode(&ostream, ts_crypto_GenerateRandomIn_fields, &req_msg);
- m_client.rpc_status = rpc_caller_invoke(m_client.caller, call_handle,
- ts_crypto_Opcode_GENERATE_RANDOM, &opstatus, &resp_buf, &resp_len);
+ m_client.rpc_status =
+ rpc_caller_session_invoke(call_handle,
+ ts_crypto_Opcode_GENERATE_RANDOM,
+ &resp_buf, &resp_len, &service_status);
- if (m_client.rpc_status == TS_RPC_CALL_ACCEPTED) {
+ if (m_client.rpc_status == RPC_SUCCESS) {
- psa_status = opstatus;
+ psa_status = service_status;
if (psa_status == PSA_SUCCESS) {
@@ -792,7 +810,7 @@
}
}
- rpc_caller_end(m_client.caller, call_handle);
+ rpc_caller_session_end(call_handle);
}
}
diff --git a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.h b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.h
index abe4439..8ce896f 100644
--- a/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.h
+++ b/components/service/crypto/client/cpp/protocol/protobuf/protobuf_crypto_client.h
@@ -9,6 +9,7 @@
#include <service/crypto/client/cpp/crypto_client.h>
#include <service/crypto/protobuf/key_attributes.pb.h>
+#include "rpc_caller_session.h"
/*
* A concrete crypto_client that uses the protobuf based crypto access protocol
@@ -17,7 +18,7 @@
{
public:
protobuf_crypto_client();
- protobuf_crypto_client(struct rpc_caller *caller);
+ protobuf_crypto_client(struct rpc_caller_session *session);
virtual ~protobuf_crypto_client();
/* Key lifecycle methods */
diff --git a/components/service/crypto/client/psa/psa_crypto_client.c b/components/service/crypto/client/psa/psa_crypto_client.c
index 1c0e055..e42d37a 100644
--- a/components/service/crypto/client/psa/psa_crypto_client.c
+++ b/components/service/crypto/client/psa/psa_crypto_client.c
@@ -9,7 +9,7 @@
struct psa_crypto_client psa_crypto_client_instance = {
- .base.caller = NULL,
+ .base.session = NULL,
/* To conform to PSA API, psa_crypto_init needs to be called.
* This state variable is used enforces this.
@@ -20,17 +20,15 @@
psa_status_t psa_crypto_init(void) {
/* Must be called after psa_crypto_client_init */
- if (psa_crypto_client_instance.base.caller) {
-
+ if (psa_crypto_client_instance.base.session)
psa_crypto_client_instance.init_status = PSA_SUCCESS;
- }
return psa_crypto_client_instance.init_status;
}
-psa_status_t psa_crypto_client_init(struct rpc_caller *caller)
+psa_status_t psa_crypto_client_init(struct rpc_caller_session *session)
{
- return service_client_init(&psa_crypto_client_instance.base, caller);
+ return service_client_init(&psa_crypto_client_instance.base, session);
}
void psa_crypto_client_deinit(void)
diff --git a/components/service/crypto/client/psa/psa_crypto_client.h b/components/service/crypto/client/psa/psa_crypto_client.h
index fbf6046..0041501 100644
--- a/components/service/crypto/client/psa/psa_crypto_client.h
+++ b/components/service/crypto/client/psa/psa_crypto_client.h
@@ -39,7 +39,7 @@
*
* @return A status indicating the success/failure of the operation
*/
-psa_status_t psa_crypto_client_init(struct rpc_caller *caller);
+psa_status_t psa_crypto_client_init(struct rpc_caller_session *session);
/**
* @brief De-initialises the single psa crypto client
diff --git a/components/service/crypto/client/test/standalone/standalone_crypto_client.cpp b/components/service/crypto/client/test/standalone/standalone_crypto_client.cpp
index b36264d..6146477 100644
--- a/components/service/crypto/client/test/standalone/standalone_crypto_client.cpp
+++ b/components/service/crypto/client/test/standalone/standalone_crypto_client.cpp
@@ -5,6 +5,8 @@
*/
#include "standalone_crypto_client.h"
+#include "service/secure_storage/frontend/secure_storage_provider/secure_storage_uuid.h"
+#include "service/crypto/provider/crypto_uuid.h"
#include <service/crypto/factory/crypto_provider_factory.h>
#include <service/crypto/backend/mbedcrypto/mbedcrypto_backend.h>
#include <service/secure_storage/backend/secure_flash_store/secure_flash_store.h>
@@ -17,7 +19,8 @@
m_storage_client(),
m_crypto_caller(),
m_storage_caller(),
- m_dummy_storage_caller()
+ m_crypto_session(),
+ m_storage_session()
{
}
@@ -32,42 +35,55 @@
bool should_do = test_crypto_client::init();
if (should_do) {
-
- struct rpc_caller *storage_caller;
+ const struct rpc_uuid storage_uuid = { .uuid = TS_PSA_INTERNAL_TRUSTED_STORAGE_UUID };
+ const struct rpc_uuid crypto_uuid = { .uuid = TS_PSA_CRYPTO_PROTOBUF_SERVICE_UUID };
+ rpc_status_t rpc_status = RPC_ERROR_INTERNAL;
if (!is_fault_injected(FAILED_TO_DISCOVER_SECURE_STORAGE)) {
/* Establish rpc session with storage provider */
struct storage_backend *storage_backend = sfs_init(sfs_flash_ram_instance());
- struct rpc_interface *storage_ep = secure_storage_provider_init(&m_storage_provider,
- storage_backend);
- storage_caller = direct_caller_init_default(&m_storage_caller, storage_ep);
- }
- else {
+ struct rpc_service_interface *storage_service =
+ secure_storage_provider_init(&m_storage_provider, storage_backend, &storage_uuid);
+ rpc_status = direct_caller_init(&m_storage_caller, storage_service);
+ } else {
/*
* Missing storage service fault injected. To allow a somewhat viable
* crypto service to be started, use a dummy _caller that will safely
* terminate storage calls with an appropriate error.
*/
- storage_caller = dummy_caller_init(&m_dummy_storage_caller,
- TS_RPC_CALL_ACCEPTED, PSA_ERROR_STORAGE_FAILURE);
+ rpc_status = dummy_caller_init(&m_storage_caller, RPC_SUCCESS, PSA_ERROR_STORAGE_FAILURE);
}
- struct rpc_interface *crypto_iface = NULL;
+ if (rpc_status != RPC_SUCCESS)
+ return false;
+
+ rpc_status = rpc_caller_session_find_and_open(&m_storage_session, &m_storage_caller,
+ &storage_uuid, 4096);
+ if (rpc_status != RPC_SUCCESS)
+ return false;
+
+ struct rpc_service_interface *crypto_iface = NULL;
struct storage_backend *client_storage_backend =
- secure_storage_client_init(&m_storage_client, storage_caller);
+ secure_storage_client_init(&m_storage_client, &m_storage_session);
if (mbedcrypto_backend_init(client_storage_backend, 0) == PSA_SUCCESS) {
- m_crypto_provider = crypto_provider_factory_create();
+ m_crypto_provider = crypto_protobuf_provider_factory_create();
crypto_iface = service_provider_get_rpc_interface(&m_crypto_provider->base_provider);
}
- struct rpc_caller *crypto_caller = direct_caller_init_default(&m_crypto_caller, crypto_iface);
- rpc_caller_set_encoding_scheme(crypto_caller, TS_RPC_ENCODING_PROTOBUF);
+ rpc_status = direct_caller_init(&m_crypto_caller, crypto_iface);
+ if (rpc_status != RPC_SUCCESS)
+ return false;
- crypto_client::set_caller(crypto_caller);
+ rpc_status = rpc_caller_session_find_and_open(&m_crypto_session, &m_crypto_caller,
+ &crypto_uuid, 4096);
+ if (rpc_status != RPC_SUCCESS)
+ return false;
+
+ crypto_client::set_caller(&m_crypto_session);
}
return should_do;
@@ -83,6 +99,9 @@
secure_storage_provider_deinit(&m_storage_provider);
secure_storage_client_deinit(&m_storage_client);
+ rpc_caller_session_close(&m_storage_session);
+ rpc_caller_session_close(&m_crypto_session);
+
direct_caller_deinit(&m_storage_caller);
direct_caller_deinit(&m_crypto_caller);
}
diff --git a/components/service/crypto/client/test/standalone/standalone_crypto_client.h b/components/service/crypto/client/test/standalone/standalone_crypto_client.h
index 8df0861..c6d9ace 100644
--- a/components/service/crypto/client/test/standalone/standalone_crypto_client.h
+++ b/components/service/crypto/client/test/standalone/standalone_crypto_client.h
@@ -46,9 +46,10 @@
struct crypto_provider *m_crypto_provider;
struct secure_storage_provider m_storage_provider;
struct secure_storage_client m_storage_client;
- struct direct_caller m_crypto_caller;
- struct direct_caller m_storage_caller;
- struct dummy_caller m_dummy_storage_caller;
+ struct rpc_caller_interface m_crypto_caller;
+ struct rpc_caller_interface m_storage_caller;
+ struct rpc_caller_session m_crypto_session;
+ struct rpc_caller_session m_storage_session;
};
#endif /* STANDALONE_CRYPTO_CLIENT_H */