TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_secure_client_service_api.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
9 #ifdef TFM_PSA_API
10 #include "psa/client.h"
11 #include "tfm_api.h"
12 #include "psa_manifest/sid.h"
13 #else /* TFM_PSA_API */
14 #include "tfm_veneers.h"
15 #endif /* TFM_PSA_API */
16 
18 {
19 #ifdef TFM_PSA_API
20  psa_handle_t handle;
21  psa_status_t status;
22 
25  if (handle <= 0) {
26  return TFM_ERROR_GENERIC;
27  }
28 
29  status = psa_call(handle, PSA_IPC_CALL, NULL, 0, NULL, 0);
30  psa_close(handle);
31 
32  if (status != PSA_SUCCESS) {
33  return TFM_ERROR_GENERIC;
34  }
35 #else
36  tfm_tfm_secure_client_service_sfn_run_tests_veneer(NULL, 0, NULL, 0);
37 #endif
38 
39  return 0;
40 }
#define PSA_SUCCESS
Definition: crypto_values.h:35
void psa_close(psa_handle_t handle)
Close a connection to an RoT Service.
Definition: psa_client.c:63
psa_handle_t psa_connect(uint32_t sid, uint32_t version)
Connect to an RoT Service by its SID.
Definition: psa_client.c:30
#define TFM_SECURE_CLIENT_SFN_RUN_TESTS_VERSION
Definition: sid.h:97
int32_t psa_handle_t
Definition: client.h:61
#define PSA_IPC_CALL
Definition: client.h:59
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:43
#define TFM_SECURE_CLIENT_SFN_RUN_TESTS_SID
Definition: sid.h:96
psa_status_t psa_call(psa_handle_t handle, int32_t type, const psa_invec *in_vec, size_t in_len, psa_outvec *out_vec, size_t out_len)
Call an RoT Service on an established connection.
Definition: psa_client.c:47
int32_t tfm_secure_client_run_tests(void)
Runs the secure integration tests.