blob: 78b74acd6f9e52d0801f09729ffd101d183de36f [file] [log] [blame]
Tamas Ban48a0eb52018-08-17 12:48:05 +01001/*
Tamas Ban2318feb2019-01-02 16:50:51 +00002 * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
Tamas Ban48a0eb52018-08-17 12:48:05 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __ATTESTATION_H__
9#define __ATTESTATION_H__
10
11#include "psa_initial_attestation_api.h"
12#include "psa_client.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/* Extension of shared data TLVs defined in bl2/include/tfm_boot_status.h */
Tamas Bane2acf5f2019-01-02 18:59:41 +000019#define TLV_MINOR_IAS_BOOT_SEED 0x0f
20#define TLV_MINOR_IAS_INSTANCE_ID 0x10
21#define TLV_MINOR_IAS_CHALLENGE 0x11
22#define TLV_MINOR_IAS_CALLER_ID 0x12
23#define TLV_MINOR_IAS_IMPLEMENTATION_ID 0x13
Tamas Banf2b8ee52019-01-02 21:56:18 +000024#define TLV_MINOR_IAS_HW_VERSION 0x14
Tamas Bana58fc862019-01-03 14:53:49 +000025#define TLV_MINOR_IAS_SECURITY_LIFECYCLE 0x15
Tamas Ban48a0eb52018-08-17 12:48:05 +010026
27/*!
28 * \brief Initialise the initial attestation service during the TF-M boot up
29 * process.
30 *
31 * \return Returns PSA_ATTEST_ERR_SUCCESS if init has been completed,
32 * otherwise error as specified in \ref psa_attest_err_t
33 */
34enum psa_attest_err_t attest_init(void);
35
36/*!
37 * \brief Get initial attestation token
38 *
39 * \param[in] in_vec Pointer to in_vec array, which contains input data
40 * to attestation service
41 * \param[in] num_invec Number of elements in in_vec array
42 * \param[in/out] out_vec Pointer out_vec array, which contains output data
43 * to attestation service
44 * \param[in] num_outvec Number of elements in out_vec array
45 *
46 * \return Returns error code as specified in \ref psa_attest_err_t
47 */
48enum psa_attest_err_t
49initial_attest_get_token(const psa_invec *in_vec, uint32_t num_invec,
50 psa_outvec *out_vec, uint32_t num_outvec);
51
Tamas Banb6b80562019-01-04 22:49:24 +000052/**
53 * \brief Get the size of the initial attestation token
54 *
55 * \param[in] in_vec Pointer to in_vec array, which contains input data
56 * to attestation service
57 * \param[in] num_invec Number of elements in in_vec array
58 * \param[out] out_vec Pointer to out_vec array, which contains pointer
59 * where to store the output data
60 * \param[in] num_outvec Number of elements in out_vec array
61 *
62 * \return Returns error code as specified in \ref psa_attest_err_t
63 */
64enum psa_attest_err_t
65initial_attest_get_token_size(const psa_invec *in_vec, uint32_t num_invec,
66 psa_outvec *out_vec, uint32_t num_outvec);
Tamas Ban48a0eb52018-08-17 12:48:05 +010067#ifdef __cplusplus
68}
69#endif
70
71#endif /* __ATTESTATION_H__ */