Open Enclave  0.17.0
Data Structures | Macros | Typedefs | Enumerations | Functions
host.h File Reference

This file defines the programming interface for developing host applications. More...

#include <openenclave/bits/asym_keys.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bits/defs.h"
#include "bits/eeid.h"
#include "bits/evidence.h"
#include "bits/result.h"
#include "bits/types.h"
#include "host_verify.h"
Include dependency graph for host.h:

Go to the source code of this file.

Data Structures

struct  _oe_enclave_setting_context_switchless
 The setting for context-switchless calls. More...
 
struct  _oe_sgx_enclave_setting_config_data
 The setting for config_id/config_svn on Ice Lake platform. More...
 
struct  _oe_enclave_setting
 The uniform structure type containing a specific type of enclave setting. More...
 
struct  _oe_ecall_info_t
 Structure describing an ecall. More...
 

Macros

#define _getpid   getpid
 
#define sscanf_s   sscanf
 
#define sprintf_s(buffer, size, format, argument)   sprintf(buffer, format, argument)
 
#define strcat_s(destination, destination_size, source)   strcat(destination, source)
 
#define strcpy_s(destination, destination_size, source)
 
#define _strdup   strdup
 
#define strncat_s(destination, destination_size, source, source_size)   strncat(destination, source, source_size)
 
#define fopen_s(pfp, name, mode)   *(pfp) = fopen((name), (mode))
 
#define OE_ENCLAVE_FLAG_DEBUG   0x00000001u
 Flag passed into oe_create_enclave to run the enclave in debug mode. More...
 
#define OE_ENCLAVE_FLAG_DEBUG_AUTO   0x000000010u
 Flag passed into oe_create_enclave that allows the host to automatically decide to run the enclave in debug mode or not based on the Debug value specified in the enclave configuration file. More...
 
#define OE_ENCLAVE_FLAG_SIMULATE   0x00000002u
 Flag passed into oe_create_enclave to run the enclave in simulation mode.
 
#define oe_get_report   oe_get_report_v2
 
#define oe_get_target_info   oe_get_target_info_v2
 

Typedefs

typedef 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.
 
typedef enum _oe_enclave_setting_type oe_enclave_setting_type_t
 Types of settings passed into oe_create_enclave
 
typedef struct _oe_enclave_setting_context_switchless oe_enclave_setting_context_switchless_t
 The setting for context-switchless calls.
 
typedef struct _oe_sgx_enclave_setting_config_data oe_sgx_enclave_setting_config_data
 The setting for config_id/config_svn on Ice Lake platform.
 
typedef struct _oe_enclave_setting oe_enclave_setting_t
 The uniform structure type containing a specific type of enclave setting.
 
typedef struct _oe_ecall_info_t oe_ecall_info_t
 Structure describing an ecall.
 

Enumerations

enum  _oe_enclave_setting_type { OE_ENCLAVE_SETTING_CONTEXT_SWITCHLESS = 0xdc73a628, OE_SGX_ENCLAVE_CONFIG_DATA = 0x78b5b41d }
 Types of settings passed into oe_create_enclave
 

Functions

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. More...
 
oe_result_t oe_terminate_enclave (oe_enclave_t *enclave)
 Terminate an enclave and reclaims its resources. More...
 
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. More...
 
void oe_free_report (uint8_t *report_buffer)
 Frees a report buffer obtained from oe_get_report. More...
 
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. More...
 
void oe_free_target_info (void *target_info_buffer)
 Frees a target info obtained from oe_get_target_info. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Detailed Description

This file defines the programming interface for developing host applications.