Tools and methodology to debug Intel® Software Guard Extensions (Intel® SGX) enclaves and the remote attestation flow
Ran sgx-ra-sample, the Remote Attestation sample in the Intel® Software Guard Extensions (Intel® SGX) SDK or custom application, and received errors such as:
- SGX_ERROR_UNEXPECTED
- 400: Bad Request Status
- Other errors
Unable to debug the source code to determine the cause of the error.
Linux*:
- Use the sgx-gdb script.
- Refer to the Enclave Debugger section in the Intel® Software Guard Extensions (Intel® SGX) Developer Reference Guide for Linux* for more information on using sgx-gdb.
- To step into the Platform Software (PSW) code or the trusted runtime functions, build and install the debug and development packages of the PSW and the Intel SGX SDK locally.
Windows*:
- Use the native Visual Studio* 2019 debugger.
- Refer to the Enclave Debugger section in the Intel® Software Guard Extensions (Intel® SGX) Developer Reference Guide for Windows* for more information.
Remote Attestation flow:
Refer to the Debugging a Remote Attestation Service Provider section in the Developer Reference Guides for a description of how to provide pre-generated messages that can be replayed and verified to debug the message flow.
The most recent Intel® Software Guard Extensions (Intel® SGX) Developer Reference Guide for Linux* can be found in the Documentation section of the latest release in Intel® Software Guard Extensions SDK for Linux*.