Mistake on this page?
Report an issue in GitHub or email us
pal_attestation_eat.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 #include "qcbor.h"
19 #include "pal_common.h"
20 
21 #define PAL_ATTEST_MIN_ERROR 30
22 
23 #define COSE_HEADER_PARAM_ALG 1
24 #define COSE_HEADER_PARAM_KID 4
25 
26 #define MANDATORY_CLAIM_WITH_SW_COMP 862
27 #define MANDATORY_CLAIM_NO_SW_COMP 926
28 #define MANDATORY_SW_COMP 36
29 #define CBOR_ARM_TOTAL_CLAIM_INSTANCE 10
30 
31 /*
32  CBOR Label for proprietary header indicating short-circuit
33  signing was used. Just a random number in the proprietary
34  label space */
35 #define T_COSE_SHORT_CIRCUIT_LABEL (-8675309)
36 
37 #define EAT_CBOR_ARM_RANGE_BASE (-75000)
38 #define EAT_CBOR_ARM_LABEL_PROFILE_DEFINITION (EAT_CBOR_ARM_RANGE_BASE - 0)
39 #define EAT_CBOR_ARM_LABEL_CLIENT_ID (EAT_CBOR_ARM_RANGE_BASE - 1)
40 #define EAT_CBOR_ARM_LABEL_SECURITY_LIFECYCLE (EAT_CBOR_ARM_RANGE_BASE - 2)
41 #define EAT_CBOR_ARM_LABEL_IMPLEMENTATION_ID (EAT_CBOR_ARM_RANGE_BASE - 3)
42 #define EAT_CBOR_ARM_LABEL_BOOT_SEED (EAT_CBOR_ARM_RANGE_BASE - 4)
43 #define EAT_CBOR_ARM_LABEL_HW_VERSION (EAT_CBOR_ARM_RANGE_BASE - 5)
44 #define EAT_CBOR_ARM_LABEL_SW_COMPONENTS (EAT_CBOR_ARM_RANGE_BASE - 6)
45 #define EAT_CBOR_ARM_LABEL_NO_SW_COMPONENTS (EAT_CBOR_ARM_RANGE_BASE - 7)
46 #define EAT_CBOR_ARM_LABEL_NONCE (EAT_CBOR_ARM_RANGE_BASE - 8)
47 #define EAT_CBOR_ARM_LABEL_UEID (EAT_CBOR_ARM_RANGE_BASE - 9)
48 #define EAT_CBOR_ARM_LABEL_ORIGINATION (EAT_CBOR_ARM_RANGE_BASE - 10)
49 
50 #define EAT_CBOR_SW_COMPONENT_TYPE (1u)
51 #define EAT_CBOR_SW_COMPONENT_MEASUREMENT (2u)
52 #define EAT_CBOR_SW_COMPONENT_EPOCH (3u)
53 #define EAT_CBOR_SW_COMPONENT_VERSION (4u)
54 #define EAT_CBOR_SW_COMPONENT_SIGNER_ID (5u)
55 #define EAT_CBOR_SW_COMPONENT_MEASUREMENT_DESC (6u)
56 
57 
58 enum attestation_error_code {
59  PAL_ATTEST_SUCCESS = 0,
60  PAL_ATTEST_TOKEN_ERR_CBOR_FORMATTING = PAL_ATTEST_MIN_ERROR,
61  PAL_ATTEST_TOKEN_CHALLENGE_MISMATCH,
62  PAL_ATTEST_TOKEN_NOT_SUPPORTED,
63  PAL_ATTEST_TOKEN_NOT_ALL_MANDATORY_CLAIMS,
64  PAL_ATTEST_ERROR,
65 };
66 
68  int64_t label;
69  QCBORItem item;
70 };
71 
72 int32_t pal_initial_attest_verify_token(uint8_t *challenge, uint32_t challenge_size,
73  uint8_t *token, uint32_t token_size);
Copyright (c) 2018, Arm Limited or its affiliates.
Q C B O R E n c o d e / D e c o d e.
QCBORItem holds the type, value and other info for a decoded item returned by GetNextItem().
Definition: qcbor.h:724
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.