Tamas Ban | 48a0eb5 | 2018-08-17 12:48:05 +0100 | [diff] [blame] | 1 | /* |
Tamas Ban | 2318feb | 2019-01-02 16:50:51 +0000 | [diff] [blame] | 2 | * Copyright (c) 2018-2019, Arm Limited. All rights reserved. |
Tamas Ban | 48a0eb5 | 2018-08-17 12:48:05 +0100 | [diff] [blame] | 3 | * |
| 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 |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /* Extension of shared data TLVs defined in bl2/include/tfm_boot_status.h */ |
Tamas Ban | e2acf5f | 2019-01-02 18:59:41 +0000 | [diff] [blame] | 19 | #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 Ban | f2b8ee5 | 2019-01-02 21:56:18 +0000 | [diff] [blame] | 24 | #define TLV_MINOR_IAS_HW_VERSION 0x14 |
Tamas Ban | 48a0eb5 | 2018-08-17 12:48:05 +0100 | [diff] [blame] | 25 | |
| 26 | /*! |
| 27 | * \brief Initialise the initial attestation service during the TF-M boot up |
| 28 | * process. |
| 29 | * |
| 30 | * \return Returns PSA_ATTEST_ERR_SUCCESS if init has been completed, |
| 31 | * otherwise error as specified in \ref psa_attest_err_t |
| 32 | */ |
| 33 | enum psa_attest_err_t attest_init(void); |
| 34 | |
| 35 | /*! |
| 36 | * \brief Get initial attestation token |
| 37 | * |
| 38 | * \param[in] in_vec Pointer to in_vec array, which contains input data |
| 39 | * to attestation service |
| 40 | * \param[in] num_invec Number of elements in in_vec array |
| 41 | * \param[in/out] out_vec Pointer out_vec array, which contains output data |
| 42 | * to attestation service |
| 43 | * \param[in] num_outvec Number of elements in out_vec array |
| 44 | * |
| 45 | * \return Returns error code as specified in \ref psa_attest_err_t |
| 46 | */ |
| 47 | enum psa_attest_err_t |
| 48 | initial_attest_get_token(const psa_invec *in_vec, uint32_t num_invec, |
| 49 | psa_outvec *out_vec, uint32_t num_outvec); |
| 50 | |
| 51 | |
| 52 | #ifdef __cplusplus |
| 53 | } |
| 54 | #endif |
| 55 | |
| 56 | #endif /* __ATTESTATION_H__ */ |