TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_ss_core_test.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include <stddef.h>
9 #include "tfm_ss_core_test.h"
10 #include "tfm_api.h"
11 #include "core_test_defs.h"
12 #include "test_framework.h"
13 #include "tfm_veneers.h"
14 #include "tfm_secure_api.h"
15 #include "tfm/tfm_spm_services.h"
16 #include "psa/service.h"
17 #include "tfm_plat_test.h"
18 #include "psa_manifest/pid.h"
20 #ifdef TFM_PSA_API
21 #include "psa_manifest/sid.h"
22 #endif
23 
24 static int32_t partition_init_done;
25 
26 #define INVALID_NS_CLIENT_ID 0x49abcdef
27 #define EXPECTED_NS_CLIENT_ID (-1)
28 
29 #define IRQ_TEST_TOOL_CODE_LOCATION(name)
30 
31 #ifndef TFM_PSA_API
32 /* Don't initialise caller_partition_id_zi and expect it to be linked in the
33  * zero-initialised data area
34  */
35 static int32_t caller_client_id_zi;
36 
37 /* Initialise caller_partition_id_rw and expect it to be linked in the
38  * read-write data area
39  */
40 static int32_t caller_client_id_rw = INVALID_NS_CLIENT_ID;
41 
42 static int32_t* invalid_addresses [] = {(int32_t*)0x0, (int32_t*)0xFFF12000};
43 
44 #else /* !defined(TFM_PSA_API) */
45 
46 static psa_status_t psa_test_common(uint32_t sid, uint32_t version,
47  const psa_invec *in_vecs, size_t in_len,
48  psa_outvec *out_vecs, size_t out_len)
49 {
50  psa_handle_t handle;
51  psa_status_t status;
52 
53  handle = psa_connect(sid, version);
54  if (handle <= 0) {
56  }
57 
58  status = psa_call(handle, PSA_IPC_CALL, in_vecs, in_len, out_vecs, out_len);
59  if (status < 0) {
61  }
62 
63  psa_close(handle);
64  return status;
65 }
66 #endif /* !defined(TFM_PSA_API) */
67 
69  struct psa_invec *in_vec, size_t in_len,
70  struct psa_outvec *out_vec, size_t out_len)
71 {
72  if ((in_len != 0) || (out_len != 0)) {
74  }
75 
76  if (partition_init_done) {
78  } else {
80  }
81 }
82 
83 #ifndef TFM_PSA_API
85  struct psa_invec *in_vec, size_t in_len,
86  struct psa_outvec *out_vec, size_t out_len)
87 {
88  uint32_t depth;
89  struct psa_invec new_vec = {NULL, sizeof(uint32_t)};
90 
91  if ((in_len != 1) || (out_len != 0) ||
92  (in_vec[0].len != sizeof(uint32_t))) {
94  }
95 
96  depth = *((uint32_t *)in_vec[0].base);
97 
98  if (depth != 0) {
99  /* Protect against scenario where TF-M core fails to block recursion */
101  }
102  /* Call to the same service again, should be rejected */
103  depth += 1;
104  new_vec.base = &depth;
105  int32_t ret = tfm_spm_core_test_sfn_direct_recursion_veneer(&new_vec,
106  1, NULL, 0);
107 
108  if (ret == CORE_TEST_ERRNO_SUCCESS) {
109  /* This is an unexpected return value */
111  } else if (ret == CORE_TEST_ERRNO_SP_RECURSION_NOT_REJECTED) {
112  /* This means that service was started in recursion */
114  } else {
116  }
117 }
118 #endif /* !defined(TFM_PSA_API) */
119 
120 static psa_status_t test_peripheral_access(void)
121 {
122 #ifdef TFM_ENABLE_PERIPH_ACCESS_TEST
123  uint32_t leds;
124  uint32_t invleds;
125  uint32_t userled_mask;
126 
127  leds = tfm_plat_test_get_led_status();
128  tfm_plat_test_set_led_status(~leds);
129  invleds = tfm_plat_test_get_led_status();
130  userled_mask = tfm_plat_test_get_userled_mask();
131 
132  if ((invleds & userled_mask) != (~leds & userled_mask)) {
133  /* Code failed to invert value in peripheral reg */
135  }
136 
138 #else
140 #endif
141 }
142 
143 #define SS_BUFFER_LEN 16
144 
145 static psa_status_t test_ss_to_ss_buffer(uint32_t *in_ptr, uint32_t *out_ptr,
146  int32_t len)
147 {
148  int32_t i;
149  /* Service internal buffer */
150  uint32_t ss_buffer[SS_BUFFER_LEN] = {0};
151  uint32_t slave_buffer [len];
152  int32_t result;
153  int32_t *result_ptr = &result;
154  int32_t res;
155  psa_invec in_vec[] = { {slave_buffer, len*sizeof(uint32_t)} };
156  psa_outvec outvec[] = { {slave_buffer, len*sizeof(uint32_t)},
157  {result_ptr, sizeof(int32_t)} };
158 
159  if (len > SS_BUFFER_LEN) {
161  }
162 
163  for (i = 0; i < len; i++) {
164  ss_buffer[i] = in_ptr[i];
165  }
166 
167  for (i = 0; i < len; i++) {
168  slave_buffer[i] = ss_buffer[i];
169  }
170 
171  /* Call internal service with buffer handling */
172 
173 #ifdef TFM_PSA_API
174  res = psa_test_common(SPM_CORE_TEST_2_INVERT_SID,
176  in_vec, 1, outvec, 2);
177 #else /* defined(TFM_PSA_API) */
178  res = tfm_spm_core_test_2_sfn_invert_veneer(in_vec, 1, outvec, 2);
179 #endif /* defined(TFM_PSA_API) */
180 
181  if (res != CORE_TEST_ERRNO_SUCCESS) {
183  }
184 
185  for (i = 0; i < len; i++) {
186  if (slave_buffer[i] != ~ss_buffer[i]) {
188  }
189  ss_buffer[i] = slave_buffer[i];
190  }
191 
192  for (i = 0; i < len; i++) {
193  out_ptr[i] = ss_buffer[i];
194  }
195 
197 }
198 
199 static psa_status_t test_outvec_write(void)
200 {
201  int32_t err;
202  int i;
203  uint8_t data_buf [36]; /* (6 + 12) * 2 = 36 plus some alignment */
204  uint8_t *data_buf_ptr = data_buf;
205  psa_invec in_vec [2];
206  psa_outvec out_vec [2];
207  uint8_t *in_buf_0;
208  uint8_t *in_buf_1;
209  uint8_t *out_buf_0;
210  uint8_t *out_buf_1;
211 
212  in_buf_0 = data_buf_ptr;
213  for (i = 0; i < 5; ++i, ++data_buf_ptr)
214  {
215  *data_buf_ptr = i;
216  }
217  in_vec[0].base = in_buf_0;
218  in_vec[0].len = data_buf_ptr - in_buf_0;
219 
220  in_buf_1 = data_buf_ptr;
221  *(data_buf_ptr++) = 1;
222  *(data_buf_ptr++) = 1;
223  for (i = 2; i < 11; ++i, ++data_buf_ptr)
224  {
225  *data_buf_ptr = *(data_buf_ptr-1) + *(data_buf_ptr-2);
226  }
227  in_vec[1].base = in_buf_1;
228  in_vec[1].len = data_buf_ptr - in_buf_1;
229 
230  out_buf_0 = data_buf_ptr;
231  data_buf_ptr += in_vec[0].len;
232  out_vec[0].base = out_buf_0;
233  out_vec[0].len = data_buf_ptr - out_buf_0;
234 
235  out_buf_1 = data_buf_ptr;
236  data_buf_ptr += in_vec[1].len;
237  out_vec[1].base = out_buf_1;
238  out_vec[1].len = data_buf_ptr - out_buf_1;
239 
240 #ifdef TFM_PSA_API
241  err = psa_test_common(SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID,
243  in_vec, 2, out_vec, 2);
244 #else /* defined(TFM_PSA_API) */
245  err = tfm_spm_core_test_2_get_every_second_byte_veneer(in_vec, 2,
246  out_vec, 2);
247 #endif /* defined(TFM_PSA_API) */
248 
249  if (err != CORE_TEST_ERRNO_SUCCESS) {
251  }
252 
253  if (out_vec[0].len != in_vec[0].len/2 ||
254  out_vec[1].len != in_vec[1].len/2) {
256  }
257  for (i = 1; i < sizeof(in_buf_0); i += 2) {
258  if (((uint8_t *)out_vec[0].base)[i/2] != in_buf_0[i]) {
260  }
261  }
262  for (i = 1; i < sizeof(in_buf_1); i += 2) {
263  if (((uint8_t *)out_vec[1].base)[i/2] != in_buf_1[i]) {
265  }
266  }
267 
269 }
270 
271 static psa_status_t test_ss_to_ss(void)
272 {
273  int32_t ret;
274  /* Call to a different service, should be successful */
275  IRQ_TEST_TOOL_CODE_LOCATION(example_secure_service_start);
276 #ifdef TFM_PSA_API
277  ret = psa_test_common(SPM_CORE_TEST_2_SLAVE_SERVICE_SID,
279  NULL, 0, NULL, 0);
280 #else /* defined(TFM_PSA_API) */
281  ret = tfm_spm_core_test_2_slave_service_veneer(NULL, 0, NULL, 0);
282 #endif /* defined(TFM_PSA_API) */
283  IRQ_TEST_TOOL_CODE_LOCATION(example_secure_service_end);
284  if (ret == CORE_TEST_ERRNO_SUCCESS_2) {
286  } else {
288  }
289 }
290 
291 #ifndef TFM_PSA_API
292 static psa_status_t test_get_caller_client_id(void)
293 {
294  /* Call to a special service that checks the caller service ID */
295  size_t i;
296  int32_t ret;
297  int32_t caller_client_id_stack = INVALID_NS_CLIENT_ID;
298 
299  caller_client_id_zi = INVALID_NS_CLIENT_ID;
300 
301  ret = tfm_spm_core_test_2_check_caller_client_id_veneer(NULL, 0, NULL, 0);
302  if (ret != CORE_TEST_ERRNO_SUCCESS) {
304  }
305 
306  /* test with invalid output pointers */
307  for (i = 0; i < sizeof(invalid_addresses)/sizeof(invalid_addresses[0]); ++i)
308  {
309  ret = tfm_core_get_caller_client_id(invalid_addresses[i]);
310  if (ret != TFM_ERROR_INVALID_PARAMETER) {
312  }
313  }
314 
315  /* test with valid output pointers */
316  ret = tfm_core_get_caller_client_id(&caller_client_id_zi);
317  if (ret != TFM_SUCCESS || caller_client_id_zi != EXPECTED_NS_CLIENT_ID) {
319  }
320 
321  ret = tfm_core_get_caller_client_id(&caller_client_id_rw);
322  if (ret != TFM_SUCCESS || caller_client_id_rw != EXPECTED_NS_CLIENT_ID) {
324  }
325 
326  ret = tfm_core_get_caller_client_id(&caller_client_id_stack);
327  if (ret != TFM_SUCCESS ||
328  caller_client_id_stack != EXPECTED_NS_CLIENT_ID) {
330  }
331 
333 }
334 
335 static psa_status_t test_spm_request(void)
336 {
337  /* Request a reset vote, should be successful */
338  int32_t ret = tfm_spm_request_reset_vote();
339 
340  if (ret != TFM_SUCCESS) {
342  }
343 
345 }
346 #endif /* !defined(TFM_PSA_API) */
347 
348 #ifdef CORE_TEST_INTERACTIVE
349 static void wait_button_event(void)
350 {
351  tfm_plat_test_wait_user_button_pressed();
352  /*
353  * The follow wait is required to skip multiple continues in one go due to
354  * the fast execution of the code and time used by the user to
355  * release button.
356  */
357 
358  tfm_plat_test_wait_user_button_released();
359 }
360 
361 psa_status_t test_wait_button(void)
362 {
363  TEST_LOG("Inside the service, press button to continue...");
364  wait_button_event();
365  TEST_LOG("Leaving the service");
367 }
368 #endif /* defined(CORE_TEST_INTERACTIVE) */
369 
370 static psa_status_t test_block(void)
371 {
372 #ifdef CORE_TEST_INTERACTIVE
373  /* Only block if interactive test is turned on */
374  return test_wait_button();
375 #else /* defined(CORE_TEST_INTERACTIVE) */
376  /* This test should not be run if interactive tests are disabled */
378 #endif /* defined(CORE_TEST_INTERACTIVE) */
379 }
380 
381 #ifndef TFM_PSA_API
382 psa_status_t spm_core_test_sfn(struct psa_invec *in_vec, size_t in_len,
383  struct psa_outvec *out_vec, size_t out_len)
384 {
385  uint32_t tc;
386  int32_t arg1;
387  int32_t arg2;
388  int32_t arg3;
389 
390  if ((in_len < 1) || (in_vec[0].len != sizeof(uint32_t))) {
392  }
393  tc = *((uint32_t *)in_vec[0].base);
394 
395  switch (tc) {
397  return test_ss_to_ss();
399  if ((in_len != 3) || (out_len != 1) ||
400  (in_vec[2].len != sizeof(int32_t))) {
402  }
403  arg3 = *((int32_t *)in_vec[2].base);
404  if ((in_vec[1].len < arg3*sizeof(int32_t)) ||
405  (out_vec[0].len < arg3*sizeof(int32_t))) {
407  }
408  arg1 = (int32_t)in_vec[1].base;
409  arg2 = (int32_t)out_vec[0].base;
410  return test_ss_to_ss_buffer((uint32_t *)arg1, (uint32_t *)arg2, arg3);
412  return test_outvec_write();
414  return test_peripheral_access();
416  return test_get_caller_client_id();
418  return test_spm_request();
419  case CORE_TEST_ID_BLOCK:
420  return test_block();
422  /* dummy service call is enough */
424  default:
426  }
427 }
428 
429 #else /* !defined(TFM_PSA_API) */
430 
431 #define SS_TO_SS_BUFFER_SIZE (16*4)
432 
433 typedef psa_status_t (*core_test_func_t)(psa_msg_t *msg);
434 
435 static psa_status_t tfm_core_test_sfn_wrap_init_success(psa_msg_t *msg)
436 {
437  return spm_core_test_sfn_init_success(NULL, 0, NULL, 0);
438 }
439 
440 static psa_status_t tfm_core_test_sfn_wrap_direct_recursion(psa_msg_t *msg)
441 {
443 }
444 
445 static psa_status_t tfm_core_test_sfn_wrap_ss_to_ss(psa_msg_t *msg)
446 {
447  return test_ss_to_ss();
448 }
449 
450 static psa_status_t tfm_core_test_sfn_wrap_ss_to_ss_buffer(psa_msg_t *msg)
451 {
452  size_t num;
453  uint32_t inbuf[SS_TO_SS_BUFFER_SIZE/sizeof(uint32_t)] = {0};
454  uint32_t outbuf[SS_TO_SS_BUFFER_SIZE/sizeof(uint32_t)] = {0};
455  uint32_t len;
456  psa_status_t res;
457 
458  if ((msg->in_size[0] > SS_TO_SS_BUFFER_SIZE) ||
459  (msg->in_size[1] != sizeof(int32_t)) ||
460  (msg->out_size[0] > SS_TO_SS_BUFFER_SIZE)) {
462  }
463 
464  num = psa_read(msg->handle, 0, inbuf, msg->in_size[0]);
465  if (num != msg->in_size[0]) {
467  }
468 
469  num = psa_read(msg->handle, 1, &len, sizeof(int32_t));
470  if (num != sizeof(int32_t)) {
472  }
473 
474  if (len > SS_TO_SS_BUFFER_SIZE) {
476  }
477 
478  res = test_ss_to_ss_buffer(inbuf, outbuf, len);
479  if (res < 0) {
480  return res;
481  }
482 
483  psa_write(msg->handle, 0, outbuf, len * sizeof(uint32_t));
484 
485  return res;
486 }
487 
488 static psa_status_t tfm_core_test_sfn_wrap_outvec_write(psa_msg_t *msg)
489 {
490  return test_outvec_write();
491 }
492 
493 static psa_status_t tfm_core_test_sfn_wrap_peripheral_access(psa_msg_t *msg)
494 {
495  return test_peripheral_access();
496 }
497 
498 static psa_status_t tfm_core_test_sfn_wrap_get_caller_client_id(psa_msg_t *msg)
499 {
501 }
502 
503 static psa_status_t tfm_core_test_sfn_wrap_spm_request(psa_msg_t *msg)
504 {
506 }
507 
508 static psa_status_t tfm_core_test_sfn_wrap_block(psa_msg_t *msg)
509 {
510  return test_block();
511 }
512 
513 static psa_status_t tfm_core_test_sfn_wrap_ns_thread(psa_msg_t *msg)
514 {
516 }
517 
518 static void core_test_signal_handle(psa_signal_t signal, core_test_func_t pfn)
519 {
520  psa_msg_t msg;
521  psa_status_t status;
522 
523  status = psa_get(signal, &msg);
524  if (status) {
525  return;
526  }
527 
528  switch (msg.type) {
529  case PSA_IPC_CONNECT:
531  break;
532  case PSA_IPC_CALL:
533  status = pfn(&msg);
534  psa_reply(msg.handle, status);
535  break;
536  case PSA_IPC_DISCONNECT:
538  break;
539  default:
540  break;
541  }
542 }
543 #endif /* !defined(TFM_PSA_API) */
544 
546 {
547 #ifdef TFM_PSA_API
548  psa_signal_t signals = 0;
549 #endif /* defined(TFM_PSA_API) */
550 
551  partition_init_done = 1;
552 
553 #ifdef TFM_PSA_API
554  while (1) {
555  signals = psa_wait(PSA_WAIT_ANY, PSA_BLOCK);
556  if (signals & SPM_CORE_TEST_INIT_SUCCESS_SIGNAL) {
557  core_test_signal_handle(SPM_CORE_TEST_INIT_SUCCESS_SIGNAL,
558  tfm_core_test_sfn_wrap_init_success);
559  } else if (signals & SPM_CORE_TEST_DIRECT_RECURSION_SIGNAL) {
560  core_test_signal_handle(SPM_CORE_TEST_DIRECT_RECURSION_SIGNAL,
561  tfm_core_test_sfn_wrap_direct_recursion);
562  } else if (signals & SPM_CORE_TEST_SS_TO_SS_SIGNAL) {
563  core_test_signal_handle(SPM_CORE_TEST_SS_TO_SS_SIGNAL,
564  tfm_core_test_sfn_wrap_ss_to_ss);
565  } else if (signals & SPM_CORE_TEST_SS_TO_SS_BUFFER_SIGNAL) {
566  core_test_signal_handle(SPM_CORE_TEST_SS_TO_SS_BUFFER_SIGNAL,
567  tfm_core_test_sfn_wrap_ss_to_ss_buffer);
568  } else if (signals & SPM_CORE_TEST_OUTVEC_WRITE_SIGNAL) {
569  core_test_signal_handle(SPM_CORE_TEST_OUTVEC_WRITE_SIGNAL,
570  tfm_core_test_sfn_wrap_outvec_write);
571  } else if (signals & SPM_CORE_TEST_PERIPHERAL_ACCESS_SIGNAL) {
572  core_test_signal_handle(SPM_CORE_TEST_PERIPHERAL_ACCESS_SIGNAL,
573  tfm_core_test_sfn_wrap_peripheral_access);
574  } else if (signals & SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SIGNAL) {
575  core_test_signal_handle(SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SIGNAL,
576  tfm_core_test_sfn_wrap_get_caller_client_id);
577  } else if (signals & SPM_CORE_TEST_SPM_REQUEST_SIGNAL) {
578  core_test_signal_handle(SPM_CORE_TEST_SPM_REQUEST_SIGNAL,
579  tfm_core_test_sfn_wrap_spm_request);
580  } else if (signals & SPM_CORE_TEST_BLOCK_SIGNAL) {
581  core_test_signal_handle(SPM_CORE_TEST_BLOCK_SIGNAL,
582  tfm_core_test_sfn_wrap_block);
583  } else if (signals & SPM_CORE_TEST_NS_THREAD_SIGNAL) {
584  core_test_signal_handle(SPM_CORE_TEST_NS_THREAD_SIGNAL,
585  tfm_core_test_sfn_wrap_ns_thread);
586  } else {
587  ; /* do nothing */
588  }
589  }
590 #else
592 #endif /* defined(TFM_PSA_API) */
593 }
psa_status_t spm_core_test_sfn_init_success(struct psa_invec *in_vec, size_t in_len, struct psa_outvec *out_vec, size_t out_len)
Tests whether the initialisation of the service was successful.
#define SPM_CORE_TEST_2_INVERT_SID
Definition: sid.h:88
#define SS_BUFFER_LEN
uint32_t psa_signal_t
Definition: service.h:50
void * base
Definition: client.h:75
#define INVALID_NS_CLIENT_ID
#define PSA_BLOCK
Definition: service.h:31
int32_t type
Definition: service.h:56
#define PSA_SUCCESS
Definition: crypto_values.h:35
size_t len
Definition: client.h:68
#define CORE_TEST_ID_PERIPHERAL_ACCESS
#define SPM_CORE_TEST_INIT_SUCCESS_SIGNAL
#define CORE_TEST_ID_BLOCK
#define IRQ_TEST_TOOL_CODE_LOCATION(name)
void psa_close(psa_handle_t handle)
Close a connection to an RoT Service.
Definition: psa_client.c:63
#define SPM_CORE_TEST_GET_CALLER_CLIENT_ID_SIGNAL
#define SPM_CORE_TEST_SS_TO_SS_SIGNAL
#define SPM_CORE_TEST_DIRECT_RECURSION_SIGNAL
#define SPM_CORE_TEST_2_SLAVE_SERVICE_VERSION
Definition: sid.h:83
size_t psa_read(psa_handle_t msg_handle, uint32_t invec_idx, void *buffer, size_t num_bytes)
Read a message parameter or part of a message parameter from a client input vector.
Definition: psa_service.c:40
psa_handle_t handle
Definition: service.h:61
#define CORE_TEST_ID_NS_THREAD
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 PSA_IPC_DISCONNECT
Definition: service.h:47
#define CORE_TEST_ID_SS_TO_SS
psa_status_t core_test_init(void)
#define SPM_CORE_TEST_NS_THREAD_SIGNAL
#define SPM_CORE_TEST_BLOCK_SIGNAL
int32_t tfm_spm_request_reset_vote(void)
Request a vote from SPM on a system reset.
Definition: arch.c:45
#define SPM_CORE_TEST_PERIPHERAL_ACCESS_SIGNAL
#define PSA_WAIT_ANY
Definition: service.h:36
#define SPM_CORE_TEST_2_SLAVE_SERVICE_SID
Definition: sid.h:82
size_t in_size[PSA_MAX_IOVEC]
Definition: service.h:70
int32_t tfm_core_get_caller_client_id(int32_t *caller_client_id)
Definition: arch.c:28
#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_SID
Definition: sid.h:86
void psa_write(psa_handle_t msg_handle, uint32_t outvec_idx, const void *buffer, size_t num_bytes)
Write a message response to a client output vector.
Definition: psa_service.c:58
void psa_reply(psa_handle_t msg_handle, psa_status_t status)
Complete handling of a specific message and unblock the client.
Definition: psa_service.c:67
psa_signal_t psa_wait(psa_signal_t signal_mask, uint32_t timeout)
Return the Secure Partition interrupt signals that have been asserted from a subset of signals provid...
Definition: psa_service.c:15
#define CORE_TEST_ID_GET_CALLER_CLIENT_ID
size_t len
Definition: client.h:76
int32_t psa_handle_t
Definition: client.h:61
#define SPM_CORE_TEST_SS_TO_SS_BUFFER_SIGNAL
#define TEST_LOG(...)
#define PSA_IPC_CONNECT
Definition: service.h:45
#define SPM_CORE_TEST_2_GET_EVERY_SECOND_BYTE_VERSION
Definition: sid.h:87
size_t out_size[PSA_MAX_IOVEC]
Definition: service.h:73
psa_status_t spm_core_test_sfn(struct psa_invec *in_vec, size_t in_len, struct psa_outvec *out_vec, size_t out_len)
Entry point for multiple test cases to be executed on the secure side.
#define PSA_IPC_CALL
Definition: client.h:59
#define SPM_CORE_TEST_SPM_REQUEST_SIGNAL
psa_status_t spm_core_test_sfn_direct_recursion(struct psa_invec *in_vec, size_t in_len, struct psa_outvec *out_vec, size_t out_len)
Tests what happens when a service calls itself directly.
#define CORE_TEST_ID_SPM_REQUEST
#define SPM_CORE_TEST_2_INVERT_VERSION
Definition: sid.h:89
const void * base
Definition: client.h:67
psa_status_t psa_get(psa_signal_t signal, psa_msg_t *msg)
Retrieve the message which corresponds to a given RoT Service signal and remove the message from the ...
Definition: psa_service.c:24
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:43
#define EXPECTED_NS_CLIENT_ID
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
#define SPM_CORE_TEST_OUTVEC_WRITE_SIGNAL
#define CORE_TEST_ID_SS_TO_SS_BUFFER
#define CORE_TEST_ID_OUTVEC_WRITE