Mbed OS Reference
Loading...
Searching...
No Matches
attestation.h
1/*
2 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8/** @addtogroup PSA-Attestation
9 * @{
10 */
11
12
13#ifndef __ATTESTATION_H__
14#define __ATTESTATION_H__
15
17#include "tfm_client.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/**
24 * \brief Type of memory access
25 */
27 TFM_ATTEST_ACCESS_RO = 1,
28 TFM_ATTEST_ACCESS_RW = 2,
29};
30
31/**
32 * \brief Copy the boot data (coming from boot loader) from shared memory area
33 * to service memory area
34 *
35 * \param[in] major_type Major type of TLV entries to copy
36 * \param[out] ptr Pointer to the buffer to store the boot data
37 * \param[in] len Size of the buffer to store the boot data
38 *
39 * \return Returns error code as specified in \ref psa_attest_err_t
40 */
42attest_get_boot_data(uint8_t major_type, void *ptr, uint32_t len);
43
44/**
45 * \brief Get the ID of the caller thread.
46 *
47 * \param[out] caller_id Pointer where to store caller ID
48 *
49 * \return Returns error code as specified in \ref psa_attest_err_t
50 */
52attest_get_caller_client_id(int32_t *caller_id);
53
54/**
55 * \brief Verify memory access rights
56 *
57 * \param[in] addr Pointer to the base of the address range to check
58 * \param[in] size Size of the address range to check
59 * \param[in] access Type of memory access as specified in
60 * \ref attest_memory_access_t
61 *
62 * \return Returns error code as specified in \ref psa_attest_err_t
63 */
66 uint32_t size,
67 enum attest_memory_access_t access);
68
69/**
70 * \brief Initialise the initial attestation service during the TF-M boot up
71 * process.
72 *
73 * \return Returns PSA_ATTEST_ERR_SUCCESS if init has been completed,
74 * otherwise error as specified in \ref psa_attest_err_t
75 */
77
78/**
79 * \brief Get initial attestation token
80 *
81 * \param[in] in_vec Pointer to in_vec array, which contains input data
82 * to attestation service
83 * \param[in] num_invec Number of elements in in_vec array
84 * \param[inout] out_vec Pointer out_vec array, which contains output data
85 * to attestation service
86 * \param[in] num_outvec Number of elements in out_vec array
87 *
88 * \return Returns error code as specified in \ref psa_attest_err_t
89 */
91initial_attest_get_token(const psa_invec *in_vec, uint32_t num_invec,
92 psa_outvec *out_vec, uint32_t num_outvec);
93
94/**
95 * \brief Get the size of the initial attestation token
96 *
97 * \param[in] in_vec Pointer to in_vec array, which contains input data
98 * to attestation service
99 * \param[in] num_invec Number of elements in in_vec array
100 * \param[out] out_vec Pointer to out_vec array, which contains pointer
101 * where to store the output data
102 * \param[in] num_outvec Number of elements in out_vec array
103 *
104 * \return Returns error code as specified in \ref psa_attest_err_t
105 */
107initial_attest_get_token_size(const psa_invec *in_vec, uint32_t num_invec,
108 psa_outvec *out_vec, uint32_t num_outvec);
109#ifdef __cplusplus
110}
111#endif
112
113/** @}*/ // PSA-Attestation
114
115#endif /* __ATTESTATION_H__ */
enum psa_attest_err_t attest_init(void)
Initialise the initial attestation service during the TF-M boot up process.
enum psa_attest_err_t initial_attest_get_token(const psa_invec *in_vec, uint32_t num_invec, psa_outvec *out_vec, uint32_t num_outvec)
Get initial attestation token.
enum psa_attest_err_t attest_get_boot_data(uint8_t major_type, void *ptr, uint32_t len)
Copy the boot data (coming from boot loader) from shared memory area to service memory area.
enum psa_attest_err_t attest_get_caller_client_id(int32_t *caller_id)
Get the ID of the caller thread.
enum psa_attest_err_t attest_check_memory_access(void *addr, uint32_t size, enum attest_memory_access_t access)
Verify memory access rights.
enum psa_attest_err_t initial_attest_get_token_size(const psa_invec *in_vec, uint32_t num_invec, psa_outvec *out_vec, uint32_t num_outvec)
Get the size of the initial attestation token.
psa_attest_err_t
Initial attestation service error types.
attest_memory_access_t
Type of memory access.
Definition: attestation.h:26
The list of fixed claims in the initial attestation token is still evolving, you can expect slight ch...