TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tfm_attest.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include "tfm_api.h"
9 #include "tfm_secure_api.h"
10 #include "service_api.h"
11 #include "attest.h"
13 #include "tfm_boot_status.h"
14 
15 #ifdef TFM_PSA_API
16 extern int32_t g_attest_caller_id;
17 #endif
18 
20 attest_get_caller_client_id(int32_t *caller_id)
21 {
22  enum psa_attest_err_t attest_res = PSA_ATTEST_ERR_SUCCESS;
23 #ifndef TFM_PSA_API
24  int32_t tfm_res;
25 
26  tfm_res = tfm_core_get_caller_client_id(caller_id);
27  if (tfm_res) {
29  }
30 #else
31  *caller_id = g_attest_caller_id;
32 #endif
33 
34  return attest_res;
35 }
36 
38 attest_get_boot_data(uint8_t major_type,
39  struct tfm_boot_data *boot_data,
40  uint32_t len)
41 {
42  enum psa_attest_err_t attest_res = PSA_ATTEST_ERR_SUCCESS;
43  int32_t tfm_res;
44 
45  tfm_res = tfm_core_get_boot_data(major_type, boot_data, len);
46  if (tfm_res != (int32_t)TFM_SUCCESS) {
47  attest_res = PSA_ATTEST_ERR_INIT_FAILED;
48  }
49 
50  return attest_res;
51 }
enum psa_attest_err_t attest_get_boot_data(uint8_t major_type, struct tfm_boot_data *boot_data, uint32_t len)
Copy the boot data (coming from boot loader) from shared memory area to service memory area...
Definition: tfm_attest.c:38
psa_attest_err_t
Initial attestation service error types.
Definition: attest.h:25
int32_t tfm_core_get_boot_data(uint8_t major_type, struct tfm_boot_data *boot_data, uint32_t len)
Retrieve secure partition related data from shared memory area, which stores shared data between boot...
Definition: service_api.c:13
Store the data for the runtime SW.
int32_t tfm_core_get_caller_client_id(int32_t *caller_client_id)
Definition: arch.c:28
enum psa_attest_err_t attest_get_caller_client_id(int32_t *caller_id)
Get the ID of the caller thread.
Definition: tfm_attest.c:20