Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Update for End-to-End remote attestation example

Mansoor_A_
Beginner
357 Views

Hello, in trying to run the sample code (https://software.intel.com/en-us/articles/intel-software-guard-extensions-remote-attestation-end-to-end-example), I have discovered that the developers have used deprecated methods from the cpprest SDK which makes it impossible to run the code on VS2015 without rewriting substantial parts of the code. Are there any plans to update the code especially seeing as the new SGX SDK requires VS2015 or newer?

Trying to use older cpprest SDK with VS2015 results in unresolved external references errors, same as while trying to use the newer SDK with VS2012.

0 Kudos
18 Replies
Anusha_K_Intel
Employee
357 Views

Hi,

Supported IDE for Intel® SGX SDK 1.7 installer:  

  • Microsoft Visual Studio* Professional 2015 with Update 3 /
  • Microsoft Visual C++ compiler from Microsoft Visual Studio* Professional 2015 is required. 
  • Note: Intel SGX SDK 1.7 is not supported in VS2012

Supported IDE for Intel® SGX SDK 1.6 installer:

  • SGX 1.6 SDK supports Visual Studio 2013 Professional or Higher Version only.

And the remote attestation code works for me ,I am using VS2015 professional with Intel SGX SDK 1.7 on my system. And while running the code: Right click the Project--> Properties-->General-->Platform toolset is set as (Intel C++ Compiler 16.0) by deafult change it to (Visual Studio 2015 (v140)).

Mansoor_A_
Beginner
357 Views

Hi Anusha,

Thanks for the helpful reply. I used those settings and the server code seems to work however, the client code still doesn't work. Specifically, we are supposed to install cpprest 1.3.1 (casablanca) for the client code and using that  version with VS2015 results in a file not found error for the http_msg.h and asyncrt_utils.h files. If I try to use a newer version of casablanca, it throws around a 100 errors due to the use of deprecated methods.

Could you please tell me how you resolved this and got the client code to work?

 

Anusha_K_Intel
Employee
357 Views

Hey,

Even I faced the  same errors while running the Remote attestation End to End sample,since the code uses functions which are not available in the jsondeserialization.cpp newer version.  And have you tried running the code with the previous versions like visual studio 2013 and sgx sdk 1.6? My previous answer was regarding the remote attestation sample provided with the Intel SGX SDK 1.7. Sorry. Even my application was showing the same errors .We will let you know when there is an update for the Remote attestation end to end  example.

Mansoor_A_
Beginner
357 Views

Hi,

Yes, I have tried to fix it by using different versions of visual studio(2012,2013 and 2015), SGX SDK(1.1 and 1.7) and cpprestsdk(1.3.1, 1.4.0, 2.x). However, none of those combinations worked for me as they all resulted in different errors due to incompatibilities between the libraries and toolkits.

Would it be possible for you to give me the download link to SGX SDK 1.6? Going to the SGX download page only gives me the option of downloading the latest version (1.7).

Thank you for looking into this, it would be great to have this updated quickly since it is quite difficult to get the IAS attestation to work without the sample code and that has put a hurdle in our workflow.

Mansoor_A_
Beginner
357 Views

Also wanted to let you know that I have re-written parts of the jsondeserialization.cpp and remoteattestation.cpp files in order to make it compatible with cpprest 2.9.1.1. It basically requires rewriting all the value operated .cbegin() and cend() calls with .as_object().cbegin() and .as_object.cend() calls and then reformatting the values as strings and objects. If you so require, I can provide you with the code. Using this code removes all the errors, however, the project fails during code generation with the following error:

2>------ Rebuild All started: Project: ISV-APP, Configuration: Debug x64 ------
2>          1 file(s) copied.
2>  stdafx.cpp
2>  RemoteAttestation.cpp
2>  RaMessages.cpp
2>  JsonDeserialization.cpp
2>  ISV-APP.cpp
2>  EnclaveManagement.cpp
2>  Generating Code...
2>  Enclave_u.c
2>LINK : fatal error LNK1104: cannot open file 'cpprestd_1_3.lib'
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========

I hope this helps!

tjunhao
Beginner
357 Views

Just wondering does anyone has solution to this problem?

Mansoor_A_
Beginner
357 Views

I seem to have solved the problem using VS2015 with cpprest 2.8.0. First you need to remove all the deprecated methods as I described earlier. Create a dummy file by the name 'cpprestd_1_3.lib'; I just copied the cpprest 2.8 files and renamed them. Next, right click the ISV-APP project, go to Properties->Linker->General->Additional Library Directories. Here, enter the path to the dummy file you just created.

Now compile the code. You may get a post-build error because of this line in the Microsoft.cppcommons.targets file:

<Exec Command="%(PostBuildEvent.Command)$(_BuildSuffix)" Condition="'%(PostBuildEvent.Command)' != ''"/>

Simply comment out the line. This will break your VS's ability to run the executable but you can now run the executable from the folder/command line. Admittedly, it is a bit of a hacky solution but there doesn't seem to be a better way and the execution proceeds without any hiccups.

tjunhao
Beginner
357 Views

Hi Mansoor, 

I was wondering is it possible for you to share the jsondeserialization.cpp and remoteattestation.cp that you have modified? Thanks alot :) 

Mansoor_A_
Beginner
357 Views

I am not sure I can post the code on a public forum since it's Intel's IP. If someone from Intel gives me the go-ahead, I'll post it right away.

you_w_
New Contributor III
357 Views

Hello I make it works with cpprest 2.9, and I have move the end to end sample on linux。If anyone needs contact me

bob_y_
Beginner
357 Views

you w. wrote:

Hello I make it works with cpprest 2.9, and I have move the end to end sample on linux。If anyone needs contact me

I want to learn something about the sgx remote attestation on linux,

may I learn from your code?

you_w_
New Contributor III
357 Views

bob y. wrote:

Quote:

you w. wrote:

 

Hello I make it works with cpprest 2.9, and I have move the end to end sample on linux。If anyone needs contact me

 

 

I want to learn something about the sgx remote attestation on linux,

may I learn from your code?

I moved the client code to ubuntu 16.04.2. However, for the server code, it 's hard to it work on linux, because .net on linux haven't realize some functions used by the sample code. If you need the client code, Give me your email.

Reguards

you w .

bob_y_
Beginner
357 Views

 

you w. wrote:

Quote:

bob y. wrote:

 

Quote:

you w. wrote:

 

Hello I make it works with cpprest 2.9, and I have move the end to end sample on linux。If anyone needs contact me

 

 

I want to learn something about the sgx remote attestation on linux,

may I learn from your code?

 

 

I moved the client code to ubuntu 16.04.2. However, for the server code, it 's hard to it work on linux, because .net on linux haven't realize some functions used by the sample code. If you need the client code, Give me your email.

Reguards

you w .

Thanks a lot,my email is bobyangpopo@gmail.com.

if you know how to use json to get access to the pse on linux os,please tell me.

thanks again!

SL
Beginner
357 Views

you w. wrote:
Can you please share the client side sample code on linux?  My email is tugesgame@gmail.com . Thank you!

Quote:

bob y. wrote:

 

Quote:

you w. wrote:

 

Hello I make it works with cpprest 2.9, and I have move the end to end sample on linux。If anyone needs contact me

 

 

I want to learn something about the sgx remote attestation on linux,

may I learn from your code?

 

 

I moved the client code to ubuntu 16.04.2. However, for the server code, it 's hard to it work on linux, because .net on linux haven't realize some functions used by the sample code. If you need the client code, Give me your email.

Reguards

you w .

SL
Beginner
357 Views

Understand.  I had some problem compiling the client code in Ubuntu.  Appreciated if you could share your cliend code.  My email is tugesgame@gmail.com Thank you!

you_w_
New Contributor III
357 Views

SL wrote:

Understand.  I had some problem compiling the client code in Ubuntu.  Appreciated if you could share your cliend code.  My email is tugesgame@gmail.com Thank you!

Hi SL:

I have send you that code. Please check.

Regards you

 

SL
Beginner
357 Views

Got it!  Thanks a lot!

you w. wrote:

Quote:

SL wrote:

 

Understand.  I had some problem compiling the client code in Ubuntu.  Appreciated if you could share your cliend code.  My email is tugesgame@gmail.com Thank you!

 

 

Hi SL:

I have send you that code. Please check.

Regards you

 

wong__sin_jin
Beginner
357 Views

you w. wrote:

Quote:

SL wrote:

 

Understand.  I had some problem compiling the client code in Ubuntu.  Appreciated if you could share your cliend code.  My email is tugesgame@gmail.com Thank you!

 

 

Hi SL:

I have send you that code. Please check.

Regards you

 

Hello,
I am interested to know more about remote attestation on linux platform, having a hard time too.
It would be great if you could share your code. My email is kenichi_wong@hotmail.com. 
Thanks in advance!

Best Regards,
Sin Jin
 

Reply