WooShin
WooShin

Reputation: 11

Intel SGX remote attestation sample code

I'm trying to run the remote attestation sample code in the Intel SGX SDK. I always get error "Error, call sgx_ra_get_msg1 fail [wmain]." I think it's because that the sgx_ra_init(&g_sp_pub_key, b_pse, p_context) function returns a zero value p_context, which can't be used.

Is there anyone can run the remote attestation sample code correctly? PS:I can run the local attestation sample code, I think the Intel SGX development environment is OK.

Upvotes: 1

Views: 1770

Answers (1)

ZeZNiQ
ZeZNiQ

Reputation: 708

I'm assuming you are running the sample code on Ubuntu provided by the following link: https://github.com/01org/linux-sgx/tree/master/SampleCode/RemoteAttestation

I had the same issue. There could be multiple reasons why it didn't work. I resolved it by following the steps mentioned below:

  1. Check for BIOS update. If available, update your BIOS.
  2. Make sure you have Intel(r) Software Guard Extensions (SGX) enabled in BIOS.
  3. Check if the Internet connectivity is restricted due to any firewall/proxy. If it is restricted, you will need to account for that in your environment and/or code or you can just use a connection with no restrictions.
  4. Check if the Intel(r) SGX driver is loaded. You can do that by checking to see if "isgx" is present on the loaded kernel modules list generated by running the following command on the Linux BASH shell:

    sudo lsmod | sort
    
  5. Make sure your Makefile has the correct SGX_SDK path set.
  6. Assuming you've followed the aforementioned steps, you can then restart the AESM daemon service. On the shell:

    sudo service aesmd restart
    
  7. Then try executing the program. You don't need to build the project again.

Just FYI, you can build your project for SGX Hardware & Debug modes and then execute by the following commands on the shell:

make clean
make SGX_MODE=HW SGX_DEBUG=1
./app

I hope this helps.

Upvotes: 2

Related Questions