Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Remote EPID-Attestation: LD_LIBRARY_PATH problems

Dix__Isabella
Beginner
1,677 Views

Hi,

I am trying to run this example using my own dev EPID license (aquired here). I followed the README but am uncertain as to how I should set LD_LIBRARY_PATH when running the client.

1) At first I did not set LD_LIBRARY_PATH at all and got the message "This system does not support Intel SGX."

2) Then I debugged a bit and found that the client tries to find the libraries "libsgx_uae_service.so" and "libsgx_urts.so" but cannot due to the unset LD_LIBRARY_PATH. So I ran locate for both and received the following results

  • locate libsgx_urts.so
    /opt/intel/sgxsdk/lib64/libsgx_urts.so
    /usr/lib/x86_64-linux-gnu/libsgx_urts.so
  • locate libsgx_uae_service.so
    /opt/intel/sgxsdk/lib64/libsgx_uae_service.so

So I set LD_LIBRARY_PATH=/opt/intel/sgxsdk/lib64. But then I get the message "Please use the correct uRTS library from PSW package."

3) So I googled a bit and found this issue where a user says "Do not set LD_LIBRARY_PATH=/opt/intel/sgxsdk/lib64/ ". But since "libsgx_uae_service.so" is only present in this folder I could not, but instead I set it to LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:/opt/intel/sgxsdk/lib64/ so the sample would at least find the uRTS at the correct point.
Basically this is working now, but the enclave always returns m1.gid=0 (not EGID, the gid which should not be 0 in HW mode, which I used to built it). I suspect that it has something to do with the fact that the LD_LIBRARY_PATH also contains the libraries for SGX_MODE=SIM but I do not know how to get around linking /opt/intel/sgxsdk/lib64/ 

 

If you need any further information about installation/configuration/host or have any other ideas: Please go ahead, however I don't know how to get this example to work.

Grateful for any help, 

Best regards,

Isabella

0 Kudos
5 Replies
Junli_S_Intel
Employee
1,677 Views

The libraries in the /opt/intel/sgxsdk/lib64 are used in compile time. If you want to execute your App, you need install PSW package: all of needed libraries has been installed in the folder /user/lib/x86_64-linux-gnu

0 Kudos
Dix__Isabella
Beginner
1,677 Views

Hi Junli,

thanks for your answer!

Should I install that manually? I installed PSW according to the installation guide using

"sudo apt-get install libsgx-epid libsgx-urts"

I also tried installing libsgx-epid-dev to no avail. By manually I mean installing it from here

https://download.01.org/intel-sgx/sgx-linux/2.8/distro/ubuntu16.04-server/debian_pkgs/libs/libsgx-uae-service/

0 Kudos
Dix__Isabella
Beginner
1,677 Views

Update: I directly installed this package, it said unmet dependencies, so I decided to install with apt and dependecies and still after that I get 

> locate libsgx_uae_service.so
/opt/intel/sgxsdk/lib64/libsgx_uae_service.so

and

> locate libsgx_uae_service
/opt/intel/sgxsdk/lib64/libsgx_uae_service.so
/opt/intel/sgxsdk/lib64/libsgx_uae_service_sim.so
/opt/intel/sgxsdk/pkgconfig/libsgx_uae_service.pc
/opt/intel/sgxsdk/pkgconfig/libsgx_uae_service_sim.pc
/opt/intel/sgxsdk/sdk_libs/libsgx_uae_service_sim.so

 

Is it related to the fact, that I use the machine for development as well and SDK and the driver are installed on this machine?

0 Kudos
Dix__Isabella
Beginner
1,677 Views

My bad. locate doesn't seem to reliably find the files. After this installation they are now present in /usr/lib/x86_64-linux-gnu and when I set that for LD_LIBRARY_PATH everything works fine.

This can be marked as resolved. Thanks Junli!

0 Kudos
Junli_S_Intel
Employee
1,677 Views

I am grad to see you have resolved the issue. Enjoy your SGX trip. :)

0 Kudos
Reply