blob: 0d77da044be0ce13401c6689c8051d178b1db649 [file] [log] [blame]
Tamas Bana00f2852019-01-23 21:46:29 +00001/*
Tamas Ban5d231702020-03-10 16:24:58 +01002 * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
Tamas Bana00f2852019-01-23 21:46:29 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __TFM_ATTEST_HAL_H__
9#define __TFM_ATTEST_HAL_H__
10
Tamas Band09c38f2019-01-23 22:04:50 +000011#include <stdint.h>
12
Tamas Bana00f2852019-01-23 21:46:29 +000013#ifdef __cplusplus
14extern "C" {
15#endif
16
17/**
18 * \brief Security lifecycle of the device
19 */
20enum 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 Ban5d231702020-03-10 16:24:58 +010028 TFM_SLC_MAX_VALUE = 0x60FFu,
Tamas Bana00f2852019-01-23 21:46:29 +000029};
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 */
38enum tfm_security_lifecycle_t tfm_attest_hal_get_security_lifecycle(void);
39
Tamas Band09c38f2019-01-23 22:04:50 +000040/**
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 */
52const char *
53tfm_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 */
69const char *
70tfm_attest_hal_get_profile_definition(uint32_t *size);
71
Tamas Bana00f2852019-01-23 21:46:29 +000072#ifdef __cplusplus
73}
74#endif
75
76#endif /* __TFM_ATTEST_HAL_H__ */