Tamas Ban | 48a0eb5 | 2018-08-17 12:48:05 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 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 */ |
| 19 | #define TLV_MINOR_IAS_BOOT_SEED 0x0f |
| 20 | #define TLV_MINOR_IAS_DEVICE_ID 0x10 |
| 21 | #define TLV_MINOR_IAS_CHALLENGE 0x11 |
| 22 | #define TLV_MINOR_IAS_CALLER_ID 0x12 |
| 23 | |
| 24 | /*! |
| 25 | * \brief Initialise the initial attestation service during the TF-M boot up |
| 26 | * process. |
| 27 | * |
| 28 | * \return Returns PSA_ATTEST_ERR_SUCCESS if init has been completed, |
| 29 | * otherwise error as specified in \ref psa_attest_err_t |
| 30 | */ |
| 31 | enum psa_attest_err_t attest_init(void); |
| 32 | |
| 33 | /*! |
| 34 | * \brief Get initial attestation token |
| 35 | * |
| 36 | * \param[in] in_vec Pointer to in_vec array, which contains input data |
| 37 | * to attestation service |
| 38 | * \param[in] num_invec Number of elements in in_vec array |
| 39 | * \param[in/out] out_vec Pointer out_vec array, which contains output data |
| 40 | * to attestation service |
| 41 | * \param[in] num_outvec Number of elements in out_vec array |
| 42 | * |
| 43 | * \return Returns error code as specified in \ref psa_attest_err_t |
| 44 | */ |
| 45 | enum psa_attest_err_t |
| 46 | initial_attest_get_token(const psa_invec *in_vec, uint32_t num_invec, |
| 47 | psa_outvec *out_vec, uint32_t num_outvec); |
| 48 | |
| 49 | |
| 50 | #ifdef __cplusplus |
| 51 | } |
| 52 | #endif |
| 53 | |
| 54 | #endif /* __ATTESTATION_H__ */ |