Open Enclave  0.15.0
evidence.h
Go to the documentation of this file.
1 // Copyright (c) Open Enclave SDK contributors.
2 // Licensed under the MIT License.
3 
12 #ifndef _OE_BITS_EVIDENCE_H
13 #define _OE_BITS_EVIDENCE_H
14 
15 #include "defs.h"
16 #include "report.h"
17 #include "types.h"
18 
19 OE_EXTERNC_BEGIN
20 
24 #define OE_EVIDENCE_ATTRIBUTES_SGX_DEBUG OE_REPORT_ATTRIBUTES_DEBUG
25 
28 #define OE_EVIDENCE_ATTRIBUTES_SGX_REMOTE OE_REPORT_ATTRIBUTES_REMOTE
29 
32 #define OE_EVIDENCE_ATTRIBUTES_RESERVED \
33  (~(OE_EVIDENCE_ATTRIBUTES_SGX_DEBUG | OE_EVIDENCE_ATTRIBUTES_SGX_REMOTE))
34 
38 #define OE_UUID_SIZE 16
39 
43 typedef struct _oe_uuid_t
44 {
45  uint8_t b[OE_UUID_SIZE];
46 } oe_uuid_t;
47 
51 typedef struct _oe_claim
52 {
53  char* name;
54  uint8_t* value;
55  size_t value_size;
56 } oe_claim_t;
57 
58 /*
59  * Claims that are known to OE that every attestation plugin should output.
60  */
61 
65 #define OE_CLAIM_ID_VERSION "id_version"
66 
70 #define OE_CLAIM_SECURITY_VERSION "security_version"
71 
75 #define OE_CLAIM_ATTRIBUTES "attributes"
76 
80 #define OE_CLAIM_UNIQUE_ID "unique_id"
81 
85 #define OE_CLAIM_SIGNER_ID "signer_id"
86 
90 #define OE_CLAIM_PRODUCT_ID "product_id"
91 
95 #define OE_CLAIM_FORMAT_UUID "format_uuid"
96 
102 #define OE_REQUIRED_CLAIMS_COUNT 7
103 
104 // This array is needed for tests
105 extern const char* OE_REQUIRED_CLAIMS[OE_REQUIRED_CLAIMS_COUNT];
106 
112 /*
113  * Additional optional claims that are known to OE that plugins can output.
114  */
115 
119 #define OE_CLAIM_VALIDITY_FROM "validity_from"
120 
124 #define OE_CLAIM_VALIDITY_UNTIL "validity_until"
125 
131 #define OE_OPTIONAL_CLAIMS_COUNT 2
132 // This array is needed for tests
133 extern const char* OE_OPTIONAL_CLAIMS[OE_OPTIONAL_CLAIMS_COUNT];
134 
143 #define OE_CLAIM_CUSTOM_CLAIMS_BUFFER "custom_claims_buffer"
144 
149 typedef enum _oe_policy_type
150 {
159 
163 typedef struct _oe_policy
164 {
165  oe_policy_type_t type;
166  void* policy;
167  size_t policy_size;
168 } oe_policy_t;
169 
170 OE_EXTERNC_END
171 
172 #endif /* _OE_BITS_EVIDENCE_H */
types.h
OE_UUID_SIZE
#define OE_UUID_SIZE
The size of a UUID in bytes.
Definition: evidence.h:38
_oe_policy
Generic struct for defining policy for the attestation plugins.
Definition: evidence.h:163
_oe_uuid_t
Struct containing the definition for an UUID.
Definition: evidence.h:43
_oe_policy_type
_oe_policy_type
Supported policies for validation by the verifier attestation plugin.
Definition: evidence.h:149
oe_claim_t
struct _oe_claim oe_claim_t
Claims struct used for claims parameters for the attestation plugins.
report.h
_oe_claim
Claims struct used for claims parameters for the attestation plugins.
Definition: evidence.h:51
OE_POLICY_ENDORSEMENTS_TIME
@ OE_POLICY_ENDORSEMENTS_TIME
Enforces that time fields in the endorsements will be checked with the given time rather than the end...
Definition: evidence.h:157
oe_policy_type_t
enum _oe_policy_type oe_policy_type_t
Supported policies for validation by the verifier attestation plugin.
oe_policy_t
struct _oe_policy oe_policy_t
Generic struct for defining policy for the attestation plugins.
oe_uuid_t
struct _oe_uuid_t oe_uuid_t
Struct containing the definition for an UUID.