<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hi Surenthar, in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072894#M349</link>
    <description>&lt;P&gt;Hi Surenthar,&lt;/P&gt;

&lt;P&gt;There is probably a small bug in the above sample code. It will never encrypt/decrypt the message if I run with simulated IAS.&lt;/P&gt;

&lt;P&gt;In the Server code "Msg4Builder.cs":&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;private void BuildNonIasMessage4(SpSequenceCheck sigmaSequenceCheck)
        {
            ...
                msg4.respHeader.respStatus = BitConverter.GetBytes((UInt32)enStatusCodes.raErrNone);
            ...

                // This is the successful end of the sequence. 
                // Reset the state machine and return M4
                log.Info("*********** Remote Attestation Sequence Successful with Simulated IAS");
                log.Info("*********** Sending Msg4");
            ...
        }
&lt;/PRE&gt;

&lt;P&gt;Here when the attestation is successful ( I know the IAS is simulated and always returns success, but still the message sequence is successful as you commented in the code ), the msg4.respHeader.respStatus is set to raErrNone, which is defined in "Constants.cs":&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;public enum enStatusCodes : uint
    {
        raErrNone = 0x00,                    // 00, Success
        raErrReqRejected = 0x01,             // 01, External error, ALL  - request message was rejected
        raErrInternal = 0x02,                // 03, Internal error, for debug only
        raErrUnknown = 0x03,                 // 04, Internal error, a handshake error that is not expected.
        raErrMeasurement = 0x10,             // 10, Enclave measurement mismatch error from SP RA server
        raErrKeyCheckFail = 0x11,            // 11, SP RA server error checking ga in Msg3
        raErrCmacCheckFail = 0x12,           // 12, SP RA server error checking CMACsmk in Msg3
        raErrQuoteCheckFail = 0x13,          // 13, SP RA server error checking Quote in Msg3
        raErrREPORTDATACheckFail = 0x14,     // 14, SP RA server error checking REPORTDATA field for Msg3 replay
        raErrVerificationSigCheckFail = 0x15,// 15, SP RA server error checking verification report signature from IAS
        raErrIasGetSuccess = 0xC8,           // C8, (decimal 200) GET Operation success from IAS
        raErrIasCreated = 0xC9,              // C9, (decimal 201) Create Report successful from IAS
        raErrIasBadRequest = 0x190,          // 190, (decimal 400) Invalid Evidence Payload from IAS
        raErrIasUnauth = 0x191,              // 191, (decimal 401) Unauthorized response from IAS
        raErrIasNotFound = 0x194,            // 194, (decimal 404) Not Found response from IAS
        raErrIasInternal = 0x1F4,            // 1F4, (decimal 500) Internal Error from IAS
        raErrIasUnknown = 0x208              // 208, (decimal 520) Unknown IAS Error or Connection Error
    }&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;However, in the Client code "RemoteAttestation.cpp":&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;pplx::task&amp;lt;int&amp;gt; PostM3Request(){
	return pplx::create_task([]() -&amp;gt; pplx::task&amp;lt;http_response&amp;gt;{
		...
	}).then([](http_response response) -&amp;gt; int{
		if (response.status_code() == status_codes::OK)	{
			...
			responseHeader[L"respStatus"] = web::json::value::string(jsonDeserial.buildJsonObject(responseMessage.respHeader.getRespStatus(), 4));
			...
			jsonDeserial.deserializeRespHeader(Pvalue1, m4ResponseMessage.respHeader);
			int status = converter.byteArrayToInt(m4ResponseMessage.respHeader.respStatus);
			if (status == 200 || status == 201){
				jsonDeserial.deserializeM4RespBody(Pvalue0, m4ResponseMessage.respMsg4Body);
			}
			else if (status == 400){
				cout &amp;lt;&amp;lt;endl&amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; endl 
					&amp;lt;&amp;lt;"Quote Attestation with IAS Failed. Check server logs for more info"&amp;lt;&amp;lt;endl;
				AbortProcess();
			}
			else {
				cout &amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; endl;
				AbortProcess();
			}
		}
		else {
			cout &amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; response.status_code() &amp;lt;&amp;lt; endl;
			AbortProcess();
		}
		return 0;
	});
}
&lt;/PRE&gt;

&lt;P&gt;When the Client receives the msg4 from the Server, the &amp;nbsp;"&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px;"&gt;m4ResponseMessage.respHeader.respStatus"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;should be 0, right? Then the program will abort because you only accept "200" and "201". So I think here you should also accept "0", otherwise the program doesn't go through when I run with simulated IAS. BTW, after I changed it to accept "0", it indeeds encrypts/decrypts the message successfully.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Do I misunderstand the code somewhere, or is it really a bug?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zhicong&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2016 08:36:56 GMT</pubDate>
    <dc:creator>Zhicong_H_</dc:creator>
    <dc:date>2016-10-21T08:36:56Z</dc:date>
    <item>
      <title>Intel® Software Guard Extensions Remote Attestation Sample Code now available</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072889#M344</link>
      <description>&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;Remote Attestation sample now live&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;&lt;A href="https://software.intel.com/en-us/articles/intel-software-guard-extensions-remote-attestation-end-to-end-example" style="cursor: pointer;"&gt;https://software.intel.com/en-us/articles/intel-software-guard-extensions-remote-attestation-end-to-end-example&lt;/A&gt;&lt;/P&gt;

&lt;P style="word-wrap: break-word; font-size: 12px;"&gt;-Surenthar.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 07:20:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072889#M344</guid>
      <dc:creator>Surenthar_S_Intel</dc:creator>
      <dc:date>2016-07-27T07:20:31Z</dc:date>
    </item>
    <item>
      <title>Wow, its good to hear new</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072890#M345</link>
      <description>&lt;P&gt;Wow, its good to hear new sample application for remote attestation.&lt;/P&gt;

&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 06:31:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072890#M345</guid>
      <dc:creator>Sam5</dc:creator>
      <dc:date>2016-07-29T06:31:17Z</dc:date>
    </item>
    <item>
      <title>Thanks so much for sharing,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072891#M346</link>
      <description>&lt;P&gt;Thanks so much for sharing, really helps my project.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Chenghong&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 01:31:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072891#M346</guid>
      <dc:creator>Chenghong_W_</dc:creator>
      <dc:date>2016-08-02T01:31:17Z</dc:date>
    </item>
    <item>
      <title>Is there an equivalent of</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072892#M347</link>
      <description>&lt;P&gt;Is there an equivalent of this code available for the SGX SDK for Linux?&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;

&lt;P&gt;Rodolfo&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2016 20:22:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072892#M347</guid>
      <dc:creator>Rodolfo_S_</dc:creator>
      <dc:date>2016-08-09T20:22:47Z</dc:date>
    </item>
    <item>
      <title>At this time there are no</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072893#M348</link>
      <description>&lt;P&gt;&lt;SPAN style="color: rgb(83, 86, 90); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, &amp;quot;Lucida Grande&amp;quot;, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(237, 248, 202);"&gt;At this time there are no plans to provide a remote attestation sample for Linux OS&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2016 05:06:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072893#M348</guid>
      <dc:creator>Surenthar_S_Intel</dc:creator>
      <dc:date>2016-08-10T05:06:19Z</dc:date>
    </item>
    <item>
      <title>Hi Surenthar,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072894#M349</link>
      <description>&lt;P&gt;Hi Surenthar,&lt;/P&gt;

&lt;P&gt;There is probably a small bug in the above sample code. It will never encrypt/decrypt the message if I run with simulated IAS.&lt;/P&gt;

&lt;P&gt;In the Server code "Msg4Builder.cs":&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;private void BuildNonIasMessage4(SpSequenceCheck sigmaSequenceCheck)
        {
            ...
                msg4.respHeader.respStatus = BitConverter.GetBytes((UInt32)enStatusCodes.raErrNone);
            ...

                // This is the successful end of the sequence. 
                // Reset the state machine and return M4
                log.Info("*********** Remote Attestation Sequence Successful with Simulated IAS");
                log.Info("*********** Sending Msg4");
            ...
        }
&lt;/PRE&gt;

&lt;P&gt;Here when the attestation is successful ( I know the IAS is simulated and always returns success, but still the message sequence is successful as you commented in the code ), the msg4.respHeader.respStatus is set to raErrNone, which is defined in "Constants.cs":&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;public enum enStatusCodes : uint
    {
        raErrNone = 0x00,                    // 00, Success
        raErrReqRejected = 0x01,             // 01, External error, ALL  - request message was rejected
        raErrInternal = 0x02,                // 03, Internal error, for debug only
        raErrUnknown = 0x03,                 // 04, Internal error, a handshake error that is not expected.
        raErrMeasurement = 0x10,             // 10, Enclave measurement mismatch error from SP RA server
        raErrKeyCheckFail = 0x11,            // 11, SP RA server error checking ga in Msg3
        raErrCmacCheckFail = 0x12,           // 12, SP RA server error checking CMACsmk in Msg3
        raErrQuoteCheckFail = 0x13,          // 13, SP RA server error checking Quote in Msg3
        raErrREPORTDATACheckFail = 0x14,     // 14, SP RA server error checking REPORTDATA field for Msg3 replay
        raErrVerificationSigCheckFail = 0x15,// 15, SP RA server error checking verification report signature from IAS
        raErrIasGetSuccess = 0xC8,           // C8, (decimal 200) GET Operation success from IAS
        raErrIasCreated = 0xC9,              // C9, (decimal 201) Create Report successful from IAS
        raErrIasBadRequest = 0x190,          // 190, (decimal 400) Invalid Evidence Payload from IAS
        raErrIasUnauth = 0x191,              // 191, (decimal 401) Unauthorized response from IAS
        raErrIasNotFound = 0x194,            // 194, (decimal 404) Not Found response from IAS
        raErrIasInternal = 0x1F4,            // 1F4, (decimal 500) Internal Error from IAS
        raErrIasUnknown = 0x208              // 208, (decimal 520) Unknown IAS Error or Connection Error
    }&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;However, in the Client code "RemoteAttestation.cpp":&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;pplx::task&amp;lt;int&amp;gt; PostM3Request(){
	return pplx::create_task([]() -&amp;gt; pplx::task&amp;lt;http_response&amp;gt;{
		...
	}).then([](http_response response) -&amp;gt; int{
		if (response.status_code() == status_codes::OK)	{
			...
			responseHeader[L"respStatus"] = web::json::value::string(jsonDeserial.buildJsonObject(responseMessage.respHeader.getRespStatus(), 4));
			...
			jsonDeserial.deserializeRespHeader(Pvalue1, m4ResponseMessage.respHeader);
			int status = converter.byteArrayToInt(m4ResponseMessage.respHeader.respStatus);
			if (status == 200 || status == 201){
				jsonDeserial.deserializeM4RespBody(Pvalue0, m4ResponseMessage.respMsg4Body);
			}
			else if (status == 400){
				cout &amp;lt;&amp;lt;endl&amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; endl 
					&amp;lt;&amp;lt;"Quote Attestation with IAS Failed. Check server logs for more info"&amp;lt;&amp;lt;endl;
				AbortProcess();
			}
			else {
				cout &amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; status &amp;lt;&amp;lt; endl;
				AbortProcess();
			}
		}
		else {
			cout &amp;lt;&amp;lt; "M4 Post response error with status code " &amp;lt;&amp;lt; response.status_code() &amp;lt;&amp;lt; endl;
			AbortProcess();
		}
		return 0;
	});
}
&lt;/PRE&gt;

&lt;P&gt;When the Client receives the msg4 from the Server, the &amp;nbsp;"&lt;SPAN style="font-family: Consolas, &amp;quot;Lucida Console&amp;quot;, Menlo, Monaco, &amp;quot;DejaVu Sans Mono&amp;quot;, monospace, sans-serif; font-size: 13.008px;"&gt;m4ResponseMessage.respHeader.respStatus"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;should be 0, right? Then the program will abort because you only accept "200" and "201". So I think here you should also accept "0", otherwise the program doesn't go through when I run with simulated IAS. BTW, after I changed it to accept "0", it indeeds encrypts/decrypts the message successfully.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Do I misunderstand the code somewhere, or is it really a bug?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zhicong&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2016 08:36:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072894#M349</guid>
      <dc:creator>Zhicong_H_</dc:creator>
      <dc:date>2016-10-21T08:36:56Z</dc:date>
    </item>
    <item>
      <title>Hi Surenthar,</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072895#M350</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;Surenthar,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;It appears to be possible to run the remote attestation example &lt;SPAN style="font-size: 13.008px;"&gt;on Linux&amp;nbsp;&lt;/SPAN&gt;at least in Debug mode, but communicating with the real Intel EPID server. The only thing required after standard installation of the driver, PSW and SDK is to copy the &lt;STRONG&gt;sdk/sample_libcrypto&lt;/STRONG&gt; folder into &lt;STRONG&gt;SampleCode/RemoteAttestation&lt;/STRONG&gt;&amp;nbsp;and make the project.&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;# Run from the extracted 'linux-sdk' folder
cp -R ./sdk/sample_libcrypto/ ./SampleCode/RemoteAttestation/ &amp;amp;&amp;amp; cd ./SampleCode/RemoteAttestation/ &amp;amp;&amp;amp; make SGX_MODE=HW SGX_DEBUG=1 &amp;amp;&amp;amp; ./app
&lt;/PRE&gt;

&lt;P&gt;Best,&lt;/P&gt;

&lt;P&gt;Marcell&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Surenthar Selvaraj. (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;At this time there are no plans to provide a remote attestation sample for Linux OS&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 14:27:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Intel-Software-Guard-Extensions-Remote-Attestation-Sample-Code/m-p/1072895#M350</guid>
      <dc:creator>Marcell_Feher__Choco</dc:creator>
      <dc:date>2016-11-04T14:27:10Z</dc:date>
    </item>
  </channel>
</rss>

