Tamas Ban | a00f285 | 2019-01-23 21:46:29 +0000 | [diff] [blame] | 1 | /* |
Tamas Ban | 5d23170 | 2020-03-10 16:24:58 +0100 | [diff] [blame] | 2 | * Copyright (c) 2019-2020, Arm Limited. All rights reserved. |
Tamas Ban | a00f285 | 2019-01-23 21:46:29 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_ATTEST_HAL_H__ |
| 9 | #define __TFM_ATTEST_HAL_H__ |
| 10 | |
Tamas Ban | d09c38f | 2019-01-23 22:04:50 +0000 | [diff] [blame] | 11 | #include <stdint.h> |
| 12 | |
Tamas Ban | a00f285 | 2019-01-23 21:46:29 +0000 | [diff] [blame] | 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 | |
| 17 | /** |
| 18 | * \brief Security lifecycle of the device |
| 19 | */ |
| 20 | enum tfm_security_lifecycle_t { |
| 21 | TFM_SLC_UNKNOWN = 0x0000u, |
| 22 | TFM_SLC_ASSEMBLY_AND_TEST = 0x1000u, |
| 23 | TFM_SLC_PSA_ROT_PROVISIONING = 0x2000u, |
| 24 | TFM_SLC_SECURED = 0x3000u, |
| 25 | TFM_SLC_NON_PSA_ROT_DEBUG = 0x4000u, |
| 26 | TFM_SLC_RECOVERABLE_PSA_ROT_DEBUG = 0x5000u, |
| 27 | TFM_SLC_DECOMMISSIONED = 0x6000u, |
Tamas Ban | 5d23170 | 2020-03-10 16:24:58 +0100 | [diff] [blame] | 28 | TFM_SLC_MAX_VALUE = 0x60FFu, |
Tamas Ban | a00f285 | 2019-01-23 21:46:29 +0000 | [diff] [blame] | 29 | }; |
| 30 | |
| 31 | /** |
| 32 | * \brief Retrieve the security lifecycle of the device |
| 33 | * |
| 34 | * Security lifecycle is a mandatory claim in the initial attestation token. |
| 35 | * |
| 36 | * \return According to \ref tfm_security_lifecycle_t |
| 37 | */ |
| 38 | enum tfm_security_lifecycle_t tfm_attest_hal_get_security_lifecycle(void); |
| 39 | |
Tamas Ban | d09c38f | 2019-01-23 22:04:50 +0000 | [diff] [blame] | 40 | /** |
| 41 | * \brief Retrieve the verification service indicator for initial attestation. |
| 42 | * |
| 43 | * It is used by relying party to locate a validation service for the token. |
| 44 | * It can be a text string that can be used to locate the service or can be a |
| 45 | * URL specifying the address of the service. |
| 46 | * |
| 47 | * \param[out] size Length of the string, without the termination zero byte. |
| 48 | * |
| 49 | * \return NULL pointer if not available otherwise the address of the |
| 50 | * verification service string in the device memory. |
| 51 | */ |
| 52 | const char * |
| 53 | tfm_attest_hal_get_verification_service(uint32_t *size); |
| 54 | |
| 55 | /** |
| 56 | * \brief Retrieve the name of the profile definition document for initial |
| 57 | * attestation. |
| 58 | * |
| 59 | * This document describes the 'profile' of the initial attestation token, |
| 60 | * being a full description of the claims, their usage, verification and |
| 61 | * token signing. |
| 62 | * |
| 63 | * \param[out] size Length of the document name, without the termination zero |
| 64 | * byte. |
| 65 | * |
| 66 | * \return NULL pointer if not available otherwise the address of the document |
| 67 | * name string in the device memory. |
| 68 | */ |
| 69 | const char * |
| 70 | tfm_attest_hal_get_profile_definition(uint32_t *size); |
| 71 | |
Tamas Ban | a00f285 | 2019-01-23 21:46:29 +0000 | [diff] [blame] | 72 | #ifdef __cplusplus |
| 73 | } |
| 74 | #endif |
| 75 | |
| 76 | #endif /* __TFM_ATTEST_HAL_H__ */ |