<?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 Reproduce enclave measurement from enclave binary in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119033#M1493</link>
    <description>&lt;P&gt;I have a question about enclave measurement. Judging by the SignTool source code for Linux (and high-level description in the manual), it seems like measurement involves loading the enclave file (ELF or PE). But the result of loading varies on different platforms, right? I wonder if I can reproduce consistent enclave measurement from enclave binary.&lt;/P&gt;

&lt;P&gt;In particular, I'm considering the following scenarios:&amp;nbsp;&lt;SPAN style="font-size: 1em;"&gt;Suppose I want to distribute&amp;nbsp;enclave.signed.so to my users and I only want to serve requests from that particular enclave. I guess I can't simply compare the &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;local&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;measurement on my platform with users' (can be included in their attestations). What should I do instead?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Essentially the question boils down to how to link the binary and the measurement cryptographically? There seems to be a paradox: suppose I have the enclave binary, the only way I can get its measurement is to load it. &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;However,&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt; the loading process is not trusted (done by OS)! How can I ensure the measurement I get is indeed for that particular binary? I must have misunderstood something because this seems critical to the entire validity of SGX. Please correct me.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Oct 2016 04:00:40 GMT</pubDate>
    <dc:creator>Fan</dc:creator>
    <dc:date>2016-10-19T04:00:40Z</dc:date>
    <item>
      <title>Reproduce enclave measurement from enclave binary</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119033#M1493</link>
      <description>&lt;P&gt;I have a question about enclave measurement. Judging by the SignTool source code for Linux (and high-level description in the manual), it seems like measurement involves loading the enclave file (ELF or PE). But the result of loading varies on different platforms, right? I wonder if I can reproduce consistent enclave measurement from enclave binary.&lt;/P&gt;

&lt;P&gt;In particular, I'm considering the following scenarios:&amp;nbsp;&lt;SPAN style="font-size: 1em;"&gt;Suppose I want to distribute&amp;nbsp;enclave.signed.so to my users and I only want to serve requests from that particular enclave. I guess I can't simply compare the &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;local&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;measurement on my platform with users' (can be included in their attestations). What should I do instead?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Essentially the question boils down to how to link the binary and the measurement cryptographically? There seems to be a paradox: suppose I have the enclave binary, the only way I can get its measurement is to load it. &lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;However,&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt; the loading process is not trusted (done by OS)! How can I ensure the measurement I get is indeed for that particular binary? I must have misunderstood something because this seems critical to the entire validity of SGX. Please correct me.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 04:00:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119033#M1493</guid>
      <dc:creator>Fan</dc:creator>
      <dc:date>2016-10-19T04:00:40Z</dc:date>
    </item>
    <item>
      <title>&gt;But the result of loading</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119034#M1494</link>
      <description>&lt;P&gt;&amp;gt;But the result of loading varies on different platforms, right?&lt;/P&gt;

&lt;P&gt;No. The sign tool can be run on&amp;nbsp;an older processor that does not support SGX, for example. It will produce the same measurement on various platforms, even if those do support SGX. The measurement procedure is described in &lt;A href="https://community.intel.com/legacyfs/online/drupal_files/managed/48/88/329298-002.pdf"&gt;https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf&lt;/A&gt;&amp;nbsp;Sections 1.4 and 3.1.&lt;/P&gt;

&lt;P&gt;&amp;gt;seems like measurement involves loading the enclave file (ELF or PE).&lt;/P&gt;

&lt;P&gt;Yes. But you can simulate what the memory looks like after it has been loaded. This is what the signing tool does. The signing tool does need to match what the runtime does when it loads the enclave, otherwise the measurement would not match.&lt;/P&gt;

&lt;P&gt;Once&amp;nbsp;you have a measurement for the enclave, you can make that measurement part of the enclave. To avoid circular references it is stored it in a non-measured section of the enclave.&lt;/P&gt;

&lt;P&gt;From the hardware's perspective, it will compare the measurement stored in the enclave to the one it computes itself as part of the enclave creation and initialization process.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2016 18:46:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119034#M1494</guid>
      <dc:creator>Francisco_C_Intel</dc:creator>
      <dc:date>2016-10-19T18:46:39Z</dc:date>
    </item>
    <item>
      <title>Thanks for the detailed</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119035#M1495</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Thanks for the detailed answers. That cleared my confusion.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;For people who run into the same need, here is what I end up doing:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em;"&gt;If you need a tool to measure a given enclave binary, you can sign it using `sgx_sign` and dump the `.note.sgxmeta` section (for ELF only, I didn't try this on Windows but I guess it would be similar for PE). Measurement is part of that section along with other misc info (notably the signature).&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Fan&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 03:08:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Reproduce-enclave-measurement-from-enclave-binary/m-p/1119035#M1495</guid>
      <dc:creator>Fan</dc:creator>
      <dc:date>2016-10-20T03:08:30Z</dc:date>
    </item>
  </channel>
</rss>

