1 /* 2 * Copyright (c) 2022-2023, Arm Limited. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 */ 7 8 #ifndef __ATTEST_BOOT_DATA_H__ 9 #define __ATTEST_BOOT_DATA_H__ 10 11 #include <stdint.h> 12 #include "attest.h" 13 #include "psa/initial_attestation.h" 14 #include "qcbor/qcbor.h" 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif 19 20 /*! 21 * \brief Function to encode all the software components 22 * 23 * The function creates a CBOR array in which 1 item is a SW component. The 24 * encoded list of these software components makes up the SW components claim. 25 * This encoded array can be stand-alone or part of a map, depending on the 26 * \p map_label parameter. The CBOR array is only created if at least 1 SW 27 * component has been found. 28 * 29 * \param[out] encode_ctx Pointer to the encoding context 30 * \param[in] map_label Label/key of the map item to be added to the 31 * context. If NULL, the SW components are added as a 32 * stand-alone array 33 * \param[out] cnt Number of SW component in the encoded array 34 * 35 * \return Returns error code as specified in \ref psa_attest_err_t 36 */ 37 enum psa_attest_err_t 38 attest_encode_sw_components_array(QCBOREncodeContext *encode_ctx, 39 const int32_t *map_label, 40 uint32_t *cnt); 41 42 /*! 43 * \brief Gets the IAS TLV entries (boot data coming from boot loader) from 44 * shared memory area to service memory area 45 * 46 * \return Returns error code as specified in \ref psa_attest_err_t 47 */ 48 enum psa_attest_err_t attest_boot_data_init(void); 49 50 #ifdef __cplusplus 51 } 52 #endif 53 54 #endif /* __ATTEST_BOOT_DATA_H__ */ 55