bl4ck5un / mbedtls-SGX

mbedtls-SGX: a SGX-friendly TLS stack (ported from mbedtls)
Apache License 2.0
91 stars 32 forks source link

0x1007 : SGX_ERROR_ECALL_NOT_ALLOWED #8

Closed gmatesunny closed 6 years ago

gmatesunny commented 6 years ago

I am facing the error: 0x1007 which means SGX_ERROR_ECALL_NOT_ALLOWED and the reason given here: https://software.intel.com/en-us/node/709252

ECALL is not allowed at this time. For examples:ECALL is not public.ECALL is blocked by the dynamic entry table. A nested ECALL is not allowed during global initialization.

I have checked my ecall is public. Could someone can explain the reason:

ECALL is blocked by the dynamic entry table. A nested ECALL is not allowed during global initialization. In my case: The server is running inside SGX(https://github.com/bl4ck5un/mbedtls-SGX/blob/master/example/enclave/ssl_conn_hdlr.cpp) After step 6 and in between step 7. I am calling an ocall, do something with the request payload and then call another different ecall which finally returns to the actual ecall(start of step 7 of ssl_conn_hdlr).

Am I doing nested ecall ? Can't I call an ocall after step 6 and from that ocall I call another ecall which sets up the response?

I am running multi_threaded server example.