Go to the documentation of this file.
14 #error "enclave.h and host.h must not be included in the same compilation unit."
17 #include <openenclave/bits/asym_keys.h>
24 #include "bits/defs.h"
25 #include "bits/eeid.h"
29 #include "host_verify.h"
34 #define _getpid getpid
35 #define sscanf_s sscanf
36 #define sprintf_s(buffer, size, format, argument) \
37 sprintf(buffer, format, argument)
38 #define strcat_s(destination, destination_size, source) \
39 strcat(destination, source)
40 #define strcpy_s(destination, destination_size, source) \
43 (void)(destination_size); \
44 strcpy(destination, source); \
46 #define _strdup strdup
47 #define strncat_s(destination, destination_size, source, source_size) \
48 strncat(destination, source, source_size)
49 #define fopen_s(pfp, name, mode) *(pfp) = fopen((name), (mode))
62 #define OE_ENCLAVE_FLAG_DEBUG 0x00000001u
70 #define OE_ENCLAVE_FLAG_DEBUG_AUTO 0x000000010u
75 #define OE_ENCLAVE_FLAG_SIMULATE 0x00000002u
85 #define OE_ENCLAVE_FLAG_SGX_KSS 0x00000004u
87 #define OE_ENCLAVE_FLAG_RESERVED \
88 (~(OE_ENCLAVE_FLAG_DEBUG | OE_ENCLAVE_FLAG_DEBUG_AUTO | \
89 OE_ENCLAVE_FLAG_SIMULATE))
99 const uint8_t* input_buffer,
100 size_t input_buffer_size,
101 uint8_t* output_buffer,
102 size_t output_buffer_size,
103 size_t* output_bytes_written);
110 OE_ENCLAVE_SETTING_CONTEXT_SWITCHLESS = 0xdc73a628,
111 #ifdef OE_WITH_EXPERIMENTAL_EEID
112 OE_EXTENDED_ENCLAVE_INITIALIZATION_DATA = 0x976a8f66,
114 OE_SGX_ENCLAVE_CONFIG_DATA = 0x78b5b41d
140 uint8_t config_id[64];
142 bool ignore_if_unsupported;
161 context_switchless_setting;
162 #ifdef OE_WITH_EXPERIMENTAL_EEID
221 uint32_t setting_count,
223 uint32_t ocall_count,
225 uint32_t ecall_count,
242 #if (OE_API_VERSION < 2)
243 #error "Only OE_API_VERSION of 2 is supported"
245 #define oe_get_report oe_get_report_v2
272 const void* opt_params,
273 size_t opt_params_size,
274 uint8_t** report_buffer,
275 size_t* report_buffer_size);
284 #if (OE_API_VERSION < 2)
285 #error "Only OE_API_VERSION of 2 is supported"
287 #define oe_get_target_info oe_get_target_info_v2
311 const uint8_t* report,
313 void** target_info_buffer,
314 size_t* target_info_size);
338 const uint8_t* report,
363 const uint8_t* report,
391 const oe_asymmetric_key_params_t* key_params,
392 uint8_t** key_buffer,
393 size_t* key_buffer_size,
395 size_t* key_info_size);
416 const oe_asymmetric_key_params_t* key_params,
417 const uint8_t* key_info,
418 size_t key_info_size,
419 uint8_t** key_buffer,
420 size_t* key_buffer_size);
433 size_t key_buffer_size,
435 size_t key_info_size);
struct _oe_enclave_setting oe_enclave_setting_t
The uniform structure type containing a specific type of enclave setting.
Structure to hold the parsed form of a report.
Definition: report.h:112
enum _oe_enclave_type oe_enclave_type_t
This enumeration defines values for the type parameter passed to oe_create_enclave().
oe_result_t oe_verify_report(oe_enclave_t *enclave, const uint8_t *report, size_t report_size, oe_report_t *parsed_report)
Verify the integrity of the report and its signature.
void oe_free_key(uint8_t *key_buffer, size_t key_buffer_size, uint8_t *key_info, size_t key_info_size)
Frees the given key and/or key info.
union _oe_enclave_setting::@0 u
The specific setting for the enclave, such as for configuring context-switchless calls.
void oe_free_report(uint8_t *report_buffer)
Frees a report buffer obtained from oe_get_report.
oe_result_t oe_parse_report(const uint8_t *report, size_t report_size, oe_report_t *parsed_report)
Parse an enclave report into a standard format for reading.
oe_result_t oe_get_public_key(oe_enclave_t *enclave, const oe_asymmetric_key_params_t *key_params, const uint8_t *key_info, size_t key_info_size, uint8_t **key_buffer, size_t *key_buffer_size)
Returns a public key that is associated with the identity of the enclave.
enum _oe_seal_policy oe_seal_policy_t
This enumeration type defines the policy used to derive a seal key.
The setting for context-switchless calls.
Definition: host.h:120
size_t max_enclave_workers
Context-switchless ecalls are not enabled yet.
Definition: host.h:132
oe_result_t oe_terminate_enclave(oe_enclave_t *enclave)
Terminate an enclave and reclaims its resources.
struct _oe_ecall_info_t oe_ecall_info_t
Structure describing an ecall.
struct _oe_enclave oe_enclave_t
This is an opaque handle to an enclave returned by oe_create_enclave().
Definition: types.h:144
void(* oe_ocall_func_t)(const uint8_t *input_buffer, size_t input_buffer_size, uint8_t *output_buffer, size_t output_buffer_size, size_t *output_bytes_written)
Type of each function in an ocall-table.
Definition: host.h:98
struct _oe_sgx_enclave_setting_config_data oe_sgx_enclave_setting_config_data
The setting for config_id/config_svn on Ice Lake platform.
size_t max_host_workers
The max number of worker threads for context-switchless ocalls.
Definition: host.h:127
struct _oe_enclave_setting_context_switchless oe_enclave_setting_context_switchless_t
The setting for context-switchless calls.
Structure describing an ecall.
Definition: host.h:173
oe_enclave_setting_type_t setting_type
The type of the setting in u
Definition: host.h:154
oe_result_t oe_get_report_v2(oe_enclave_t *enclave, uint32_t flags, const void *opt_params, size_t opt_params_size, uint8_t **report_buffer, size_t *report_buffer_size)
Get a report signed by the enclave platform for use in attestation.
oe_result_t oe_create_enclave(const char *path, oe_enclave_type_t type, uint32_t flags, const oe_enclave_setting_t *settings, uint32_t setting_count, const oe_ocall_func_t *ocall_table, uint32_t ocall_count, const oe_ecall_info_t *ecall_name_table, uint32_t ecall_count, oe_enclave_t **enclave)
Create an enclave from an enclave image file.
The uniform structure type containing a specific type of enclave setting.
Definition: host.h:149
oe_result_t oe_get_target_info_v2(const uint8_t *report, size_t report_size, void **target_info_buffer, size_t *target_info_size)
Extracts additional platform specific data from the report and writes it to target_info_buffer.
The setting for config_id/config_svn on Ice Lake platform.
Definition: host.h:138
oe_result_t oe_get_public_key_by_policy(oe_enclave_t *enclave, oe_seal_policy_t seal_policy, const oe_asymmetric_key_params_t *key_params, uint8_t **key_buffer, size_t *key_buffer_size, uint8_t **key_info, size_t *key_info_size)
Returns a public key that is associated with the identity of the enclave and the specified policy.
enum _oe_enclave_setting_type oe_enclave_setting_type_t
Types of settings passed into oe_create_enclave
void oe_free_target_info(void *target_info_buffer)
Frees a target info obtained from oe_get_target_info.
enum _oe_result oe_result_t
This enumeration type defines return codes for Open Enclave functions.
_oe_enclave_setting_type
Types of settings passed into oe_create_enclave
Definition: host.h:108