1

英特尔的文档在这里说,如果没有以前的启动令牌,则应使用全零的“无效”令牌。这在模拟模式下完美运行,但在硬件模式下它返回 SGX_ERROR_INVALID_LAUNCH_TOKEN,即使这正是它所要求的。

    // Initialize an "invalid" first token, as the documentation specifies (all zeros)
    sgx_launch_token_t token = {0};

    // Create enclave
    sgx_enclave_id_t id;
    int updated = 0;
    const auto status = sgx_create_enclave("enclave.signed.so", SGX_DEBUG_FLAG, &token, &updated, &id, NULL);

    if (status != SGX_SUCCESS) {
        throw "Failed to initialize enclave. (" + get_error_message(status) + ")";
    }

代码返回状态 = SGX_ERROR_INVALID_LAUNCH_TOKEN

Failed to initialize enclave. (The launch token is not correct.)

我在构建过程中可能缺少什么吗?

4

1 回答 1

0

问题是由于我的应用程序使用libsgx_urts.so了我/usr/liblibsgx_uae_service.soSGX SDK 的安装路径(/opt/intel/sgxsdk/lib64在我的情况下)。

我将链接更改为以下内容:

Simulation mode: libsgx_urts.so => /opt/intel/sgxsdk/lib64/libsgx_urts.so libsgx_uae_service.so => /opt/intel/sgxsdk/lib64/libsgx_uae_service.so

Hardware mode: libsgx_urts.so => /usr/lib/libsgx_urts.so libsgx_uae_service.so => /usr/lib/libsgx_uae_service.so `

于 2018-03-15T16:48:55.093 回答