[][src]Function sgx_tse::rsgx_create_report

pub fn rsgx_create_report(
    target_info: &sgx_target_info_t,
    report_data: &sgx_report_data_t
) -> SgxResult<sgx_report_t>

The rsgx_create_report function tries to use the information of the target enclave and other information to create a cryptographic report of the enclave.

This function is a wrapper for the SGX EREPORT instruction.

Description

Use the function rsgx_create_report to create a cryptographic report that describes the contents of the calling enclave. The report can be used by other enclaves to verify that the enclave is running on the same platform. When an enclave calls rsgx_verify_report to verify a report, it will succeed only if the report was generated using the target_info for said enclave. This function is a wrapper for the SGX EREPORT instruction.

Before the source enclave calls rsgx_create_report to generate a report, it needs to populate target_info with information about the target enclave that will verify the report. The target enclave may obtain this information calling rsgx_create_report with a default value for target_info and pass it to the source enclave at the beginning of the inter-enclave attestation process.

Parameters

target_info

A pointer to the sgx_target_info_t object that contains the information of the target enclave, which will be able to cryptographically verify the report calling rsgx_verify_report.efore calling this function.

If value is default, sgx_create_report retrieves information about the calling enclave, but the generated report cannot be verified by any enclave.

report_data

A pointer to the sgx_report_data_t object which contains a set of data used for communication between the enclaves.

Requirements

Library: libsgx_tservice.a

Return value

Cryptographic report of the enclave

Errors

SGX_ERROR_INVALID_PARAMETER

An error is reported if any of the parameters memory is not within the enclave or the reserved fields of the data structure are not set to zero.

SGX_ERROR_OUT_OF_MEMORY

Indicates that the enclave is out of memory.