Open Enclave
host.h
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License.
3 
10 #ifndef _OE_HOST_H
11 #define _OE_HOST_H
12 
13 #ifdef _OE_ENCLAVE_H
14 #error "enclave.h and host.h must not be included in the same compilation unit."
15 #endif
16 
17 #include <stdarg.h>
18 #include <stddef.h>
19 #include <stdint.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <string.h>
23 #include "bits/defs.h"
24 #include "bits/report.h"
25 #include "bits/result.h"
26 #include "bits/types.h"
27 
28 OE_EXTERNC_BEGIN
29 
33 #define OE_ENCLAVE_FLAG_DEBUG 0x00000001
34 
38 #define OE_ENCLAVE_FLAG_SIMULATE 0x00000002
39 
43 #define OE_ENCLAVE_FLAG_RESERVED \
44  (~(OE_ENCLAVE_FLAG_DEBUG | OE_ENCLAVE_FLAG_SIMULATE))
45 
78  const char* path,
79  oe_enclave_type_t type,
80  uint32_t flags,
81  const void* config,
82  uint32_t config_size,
83  oe_enclave_t** enclave);
84 
97 oe_result_t oe_terminate_enclave(oe_enclave_t* enclave);
98 
128  oe_enclave_t* enclave,
129  const char* func,
130  void* args);
131 
160  oe_enclave_t* enclave,
161  uint32_t flags,
162  const void* opt_params,
163  size_t opt_params_size,
164  uint8_t* report_buffer,
165  size_t* report_buffer_size);
166 
191  const uint8_t* report,
192  size_t report_size,
193  void* target_info_buffer,
194  size_t* target_info_size);
195 
211  const uint8_t* report,
212  size_t report_size,
213  oe_report_t* parsed_report);
214 
235  oe_enclave_t* enclave,
236  const uint8_t* report,
237  size_t report_size,
238  oe_report_t* parsed_report);
239 
240 OE_EXTERNC_END
241 
242 #endif /* _OE_HOST_H */
oe_result_t oe_create_enclave(const char *path, oe_enclave_type_t type, uint32_t flags, const void *config, uint32_t config_size, oe_enclave_t **enclave)
Create an enclave from an enclave image file.
Structure to hold the parsed form of a report.
Definition: report.h:112
oe_result_t oe_call_enclave(oe_enclave_t *enclave, const char *func, void *args)
Perform a high-level enclave function call (ECALL).
oe_result_t oe_get_report(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.
This file defines Open Enclave return codes (results).
enum _oe_result oe_result_t
This enumeration type defines return codes for Open Enclave functions.
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_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.
oe_result_t oe_get_target_info(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.
oe_result_t oe_terminate_enclave(oe_enclave_t *enclave)
Terminate an enclave and reclaims its resources.
This file defines structures and options passed to GetReport functions.