blob: 93169f0180f8e96e3628e3024416850d14304382 [file] [log] [blame]
Tamas Banc034b732022-02-11 15:24:05 +01001/*
2 * Copyright (c) 2018-2022, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef PSA_INITIAL_ATTESTATION_H
9#define PSA_INITIAL_ATTESTATION_H
10
11#include <limits.h>
12#include <stddef.h>
13#include <stdint.h>
14
15#include "psa/error.h"
16
17/*
18 * Initial attestation API version is: 1.0.0
19 */
20#define PSA_INITIAL_ATTEST_API_VERSION_MAJOR (1)
21#define PSA_INITIAL_ATTEST_API_VERSION_MINOR (0)
22
23/* The allowed size of input challenge in bytes. */
24#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_32 32U
25#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_48 48U
26#define PSA_INITIAL_ATTEST_CHALLENGE_SIZE_64 64U
27
28/* Initial Attestation message types that distinguish Attest services. */
29#define RSS_ATTEST_GET_TOKEN 1001U
30#define RSS_ATTEST_GET_TOKEN_SIZE 1002U
31#define RSS_ATTEST_GET_DELEGATED_KEY 1003U
32
33/**
34 * Get the platform attestation token.
35 *
36 * auth_challenge Pointer to buffer where challenge input is stored. This
37 * must be the hash of the public part of the delegated
38 * attestation key.
39 * challenge_size Size of challenge object in bytes.
40 * token_buf Pointer to the buffer where attestation token will be
41 * stored.
42 * token_buf_size Size of allocated buffer for token, in bytes.
43 * token_size Size of the token that has been returned, in bytes.
44 *
45 * Returns error code as specified in psa_status_t.
46 */
47psa_status_t
48psa_initial_attest_get_token(const uint8_t *auth_challenge,
49 size_t challenge_size,
50 uint8_t *token_buf,
51 size_t token_buf_size,
52 size_t *token_size);
53
54#endif /* PSA_INITIAL_ATTESTATION_H */