Refresh linux-sgx to v1.9+ from upstream. (#42)

commit 2133df2d4ad82119333a003c8f05156998550615
Merge: 0356eb624 f2cf6d18a
Author: yuyuany <yuan.yu@intel.com>
Date:   Wed Sep 13 10:06:33 2017 +0800

    Merge pull request #155 from 01org/revert-151-ocall_exit_enclave

    Revert "Check for crash in sgx_ocall and exit enclave if enclave is crashed"

commit f2cf6d18aa73fdaa916f95b1f3c5ac605a90ff06
Author: yuyuany <yuan.yu@intel.com>
Date:   Thu Sep 7 15:21:45 2017 +0800

    Revert "Check for crash in sgx_ocall and exit enclave if enclave is crashed"

commit 0356eb6249ed93510ca66f057a5ae74dda7b10a2
Merge: 2fe247145 38023b61a
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Wed Sep 6 15:58:16 2017 +0800

    Merge pull request #153 from greglaun/greglaun-typos

    Correct typos in some of the sample apps.

    Signed-off-by: Zhang Lili lili.z.zhang@intel.com

commit 2fe247145943827f04eea8e065a8ad3b0a3d11bd
Merge: df9b03289 2e00f11ed
Author: Li Xun <xun.li@intel.com>
Date:   Wed Sep 6 14:10:42 2017 +0800

    Merge pull request #154 from llly/pull

    Fix build issues with latest OpenSSL and Gcc

commit 2e00f11ed5a2e48445aeabd668105161a55a4502
Author: Vytautas Mickus <vmickus@gmx.com>
Date:   Sat Jul 15 21:00:57 2017 +0300

    Make code compatible with OpenSSL 1.0 and 1.1

commit 95ea2c21a921ceb3851b090f092709c5b08b9b37
Author: Vytautas Mickus <vmickus@gmx.com>
Date:   Sat Jul 15 21:12:03 2017 +0300

    Tell gcc about the fallthroughs (needed because of -Werror in makefiles)

commit 6e0580d110d4c799e0c8aba0cdadee46efe15055
Author: Vytautas Mickus <vmickus@gmx.com>
Date:   Sat Jul 15 21:22:55 2017 +0300

    Use `uname -m` instead of `arch` in installer.

commit 38023b61aaa8f76fbad4391ecafd1342d9a2b4f0
Author: Greg Laun <greg.laun@gmail.com>
Date:   Tue Sep 5 12:33:37 2017 -0700

    Correct typos in some of the sample apps.

    Signed-off-by: Greg Laun <greg.laun@gmail.com>

commit df9b0328986784b603ce0b5af847d15382c795cb
Merge: a2f33d828 a20449f5f
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Tue Sep 5 10:41:22 2017 +0800

    Merge pull request #151 from yuyuany/ocall_exit_enclave

    Check for crash in sgx_ocall and exit enclave if enclave is crashed.

    Signed-off-by: Zhang Lili lili.z.zhang@intel.com

commit a20449f5f85acd4e482c35dd6f8f27f36a3caa60
Author: Yu Yuan <yuan.yu@intel.com>
Date:   Fri Sep 1 22:46:27 2017 +0800

    tRTS check the enclave crash state when doing an OCALL. If the enclave is crashed, tRTS unwind the stack to ECALL, and exit the enclave with SGX_ERROR_ENCLAVE_CRASHED.

    Signed-off-by: Yu Yuan <yuan.yu@intel.com>

commit a2f33d828bc76b49256e9a3128254e3322ef5d52
Merge: aa8e9755a 6979d8180
Author: Andy Zhao <yebin.andy.zhao@intel.com>
Date:   Mon Aug 28 16:30:00 2017 +0800

    Merge pull request #149 from lzha101/add_missing_delete

    Add two missing delete functions

commit 6979d818077c310ec4e75a56937b5aa87b718dae
Author: Zhang Lili <lili.z.zhang@intel.com>
Date:   Mon Aug 28 23:17:47 2017 +0800

    Add two missing delete functions.

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit aa8e9755aaecc4c04ed3f3993a1596adb4ba6286
Author: Dionna Glaze <dionnaglaze@google.com>
Date:   Wed Aug 2 10:48:18 2017 -0700

    Move pms pointer validation before its dereference in local_vars definitions.

    Also fix "sgx_status_t" typo in generated comment.

commit 6f0e20cfd992c073aefe76926d28893c51f52445
Author: John Mechalas <john.p.mechalas@intel.com>
Date:   Thu Aug 10 19:00:34 2017 -0700

    Implements most of libsgx_capable for Linux (previously only available in the Windows SDK) (#107)

    * Adds libsgx_capable, which is currently only available in the Windows
    version of the Intel SGX SDK. The Linux implementation of this library
    adds the following functions:

      sgx_status_t sgx_is_capable (int *sgx_capable);
      sgx_status_t sgx_cap_get_status (sgx_device_status_t *sgx_device_status);
      sgx_status_t sgx_cap_enable_device (sgx_device_status_t *sgx_device_status);

    And adds the following error code (also from the Windows version of the
    Intel SGX SDK):

      SGX_ERROR_NO_PRIVILEGE

    Generates both a static and dynamic build of libsgx_capable. This is
    incorporated into the SDK package, not the PSW package, since software
    installers need to check for Intel SGX capability on systems where the PSW
    may not already be installed. This means that installers will either have
    to statically link, or distribute the .so with their installation package.

    ----------------------

    Developer Certificate of Origin
    Version 1.1

    Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
    660 York Street, Suite 102,
    San Francisco, CA 94110 USA

    Everyone is permitted to copy and distribute verbatim copies of this
    license document, but changing it is not allowed.

    Developer's Certificate of Origin 1.1

    By making a contribution to this project, I certify that:

    (a) The contribution was created in whole or in part by me and I
        have the right to submit it under the open source license
        indicated in the file; or

    (b) The contribution is based upon previous work that, to the best
        of my knowledge, is covered under an appropriate open source
        license and I have the right under that license to submit that
        work with modifications, whether created in whole or in part
        by me, under the same open source license (unless I am
        permitted to submit under a different license), as indicated
        in the file; or

    (c) The contribution was provided directly to me by some other
        person who certified (a), (b) or (c) and I have not modified
        it.

    (d) I understand and agree that this project and the contribution
        are public and that a record of the contribution (including all
        personal information I submit with it, including my sign-off) is
        maintained indefinitely and may be redistributed consistent with
        this project or the open source license(s) involved.

    Signed-off-by: John P Mechalas <john.p.mechalas@intel.com>

commit 268b206f15f25671382b95c5650422b335d5c446
Merge: 803250734 136610236
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Jul 28 12:38:05 2017 +0800

    Merge pull request #129 from dingelish/master

    Fix a mis-understood memory alignment in enclave_create().

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit 1366102364ce67f8c63eaba9bdae80c08634f07f
Author: Yu Ding <dingyu02@baidu.com>
Date:   Mon Jul 24 20:00:04 2017 -0700

    Fix to a mis-understood in enclave_create(). The memory alignment is mistakenly done twice. Once in urts and once in driver. It is unnecessary. This bug has a great impact on the upper limit of enclave memory.

commit 803250734883037a4a1f69085fb31daa6bd8448b
Author: Li Xun <xun.li@intel.com>
Date:   Tue Jul 25 10:44:47 2017 +0800

    Update server port to 80 (#128)

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit d42cd14bdd01a43c58554a4c73231733426356cd
Author: Jaak Randmets <jaak.ra+github@gmail.com>
Date:   Mon Jul 24 09:04:03 2017 +0300

    Merge pull request #124 from Jaak/master

    Improve const correctness of sgx_fopen and sgx_fimport_auto_key.

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit 8383b8c65f49fca017c62eb7efdd97a212829caf
Merge: 0fb9f47e7 768c95174
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Tue Jul 4 09:39:53 2017 +0800

    Merge pull request #120 from aminueza/master

    Fixes sdk and psw version in download_prebuild.sh script

    Zhang Lili <lili.z.zhang@intel.com>

commit 768c95174150e64207b31f5a733bccba25085775
Author: Amanda Souza <amandasouza@quimera.lsd.ufcg.edu.br>
Date:   Mon Jul 3 15:22:45 2017 -0300

    Fixes sdk and psw version in download_prebuild.sh script

    Signed-off-by: Amanda Souza <amandasouza@quimera.lsd.ufcg.edu.br>

commit 0fb9f47e784261369c52c1b49d1484f34409ecaf
Author: Li, Xun <xun.li@intel.com>
Date:   Fri Jun 30 15:51:16 2017 +0800

    Linux 1.9 Open Source Gold release

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit 199911ebaf60d068e4641331a06e71462ba8d324
Merge: 109545891 a2abe4b0d
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Jun 16 12:42:58 2017 +0800

    Merge pull request #115 from danzsmith53/master

    Update README.md

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit a2abe4b0d0490112fff7eb9669adf9d0bc866c54
Author: Daniel Smith <daniel.e.smith@intel.com>
Date:   Wed May 31 16:21:21 2017 -0700

    Update README.md

    Updated grammar and style many places throughout file

    Signed-off-by: Daniel Smith <daniel.e.smith@intel.com>

commit 1095458916fafd9e5870403e1d50cd7e1ca379bc
Merge: a4bfecb96 d6acac1d2
Author: Li Xun <xun.li@intel.com>
Date:   Mon Jun 12 09:26:58 2017 +0800

    Merge pull request #113 from mitar/patch-3

    pkg-config is needed for compilation

commit a4bfecb965a7588dc073a295dd842c301bbf075c
Merge: 02b7d490a 6a7ec7a8c
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Jun 8 13:10:03 2017 +0800

    Merge pull request #112 from mitar/patch-2

    Removing sudo

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit 6a7ec7a8c14ee2ee8f6977110dae9fe99137064d
Author: Mitar <mitar.github@tnode.com>
Date:   Sun Jun 4 14:18:07 2017 -0700

    Removing sudo.

    The whole script has to be run as root anyway.

    Signed-off-by: Mi Tar <mitar.github@tnode.com>

commit d6acac1d25e67516dc6cb8d1dc7b155416078bb1
Author: Mitar <mitar.github@tnode.com>
Date:   Sun Jun 4 16:47:43 2017 -0700

    pkg-config is needed for compilation.

    See: https://github.com/01org/dynamic-application-loader-host-interface/issues/2#issuecomment-306074645

    Signed-off-by: Mi Tar <mitar.github@tnode.com>

commit 02b7d490aca40af134166221c9b4f332f6ca947a
Author: Li, Xun <xun.li@intel.com>
Date:   Tue May 16 08:40:33 2017 +0800

    fix a aesm_service IPC bug

    aesm_service handles closed client socket incorrectly found in #101

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit f287674fef604f4a6ef8710033f6a091fe644d7a
Merge: ce0f128d2 e7f074381
Author: Li Xun <xun.li@intel.com>
Date:   Fri May 12 16:10:42 2017 +0800

    Merge pull request #91 from sean-jc/docker/merge

    Add support for running the AESM and SGX applications in Docker

commit e7f0743812b065750135220a37d890988633cc64
Author: Sean Christopherson <sean.j.christopherson@intel.com>
Date:   Thu Mar 30 09:26:47 2017 -0700

    Add --no-daemon option to AESM

    Application container runtimes, e.g. Docker and RKT, do not provide a
    program manager, e.g. systemd, inside the container, and so attempting
    to run AESM as a daemon will fail.   Add --no-daemon to allow running
    the AESM in a container as a normal process, i.e. do not call daemon().

    Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

commit ce0f128d290e116748a78899673709730ac45964
Author: Li, Xun <xun.li@intel.com>
Date:   Mon May 8 09:01:52 2017 +0800

    fix aesm_service compilation with latest openssl

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit fd91609f543ae08991d76d94d28c4ec300bcbc84
Merge: 9e0c32ee5 75336444e
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Wed Apr 19 13:41:12 2017 +0800

    Merge pull request #96 from lzha101/master

    Fix alignment issue for metadata section

    Signed-off-by: Zhang Lili  <lili.z.zhang@intel.com>

commit 75336444e867082159cd7c99bbe0eca57013c806
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Apr 14 16:03:48 2017 +0800

    Update comment

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit d455716f9c00265976870d167ee2fae52f354daf
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Apr 14 15:45:41 2017 +0800

    Update ELF parser for metadata alignment

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 2224616cb4675c0225a3e1080059f3360e69f800
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Apr 14 15:43:05 2017 +0800

    Change alignment for metadata section

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 9e0c32ee57f7dbd343cc1d75303e308b58b1fe93
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Apr 13 10:33:35 2017 +0800

    Fix typo flase -> false in urts_internal.cpp

    Fix typo flase -> false in urts_internal.cpp

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit 765af6169d80beada705086ec9d5226bbdd96218
Merge: 0cbb1f074 38b3d5f46
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Apr 13 10:30:06 2017 +0800

    Merge pull request #94 from neo9ree/master

    fixed typo flase -> false in psw/urts/linux/urts.cpp:45

    Signed-off-by: Zhang Lili <lili.z.zhang@intel.com>

commit 0cbb1f074d4b805a0492f6a000c5ddd1fda9efd7
Author: Li, Xun <xun.li@intel.com>
Date:   Mon Apr 10 14:24:45 2017 +0800

    Update Linux_SGXEclipsePlugin

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit 38b3d5f4635c617d8181f3b8c1c6aa109a81dc21
Author: Eunchan Kim <eunchan.kim@kaist.ac.kr>
Date:   Thu Apr 6 15:31:02 2017 +0900

    fixed typo flase -> false in psw/urts/linux/urts.cpp:45

    Signed-off-by: Eunchan Kim <eunchan.kim@kaist.ac.kr>

commit 56783b38820f82dcb37f1f48c37a5f705ddf7358
Merge: e5c01189d 885287c13
Author: Li Xun <xun.li@intel.com>
Date:   Wed Apr 5 12:29:14 2017 +0800

    Merge pull request #92 from dcmiddle/fix-readme-pse-install

    fix readme section for PSW install

commit 885287c13df2519ca0318bd908b3827d6e247e17
Author: Dan Middleton <dan.middleton@intel.com>
Date:   Fri Mar 31 22:16:38 2017 -0500

    fix readme section for PSW install

    add missing cmake prerequisite to ubuntu instructions
    correct typos on systemctl

    Signed-off-by: Dan Middleton <dan.middleton@intel.com>

commit 65965c6ab61d103028b8b6a886b57e98ccf7ea9d
Author: Sean Christopherson <sean.j.christopherson@intel.com>
Date:   Tue Feb 7 12:51:44 2017 -0800

    Bind the AESM socket to /var/run/aesmd/aesm.socket

    Exposing sockets to Docker containers is typically done via bind
    mounts, which does not work for abstract sockets since they don't
    exist in the file system.

    Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

commit e5c01189d318e8c59f576377e231c159ffb71abb
Author: Li, Xun <xun.li@intel.com>
Date:   Thu Mar 30 13:45:20 2017 +0900

    update white list URL

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit 072f4e40c0a5f6b7b27bf77f00872853933bd33a
Author: Li, Xun <xun.li@intel.com>
Date:   Fri Mar 24 11:20:35 2017 +0900

    add missing error code logging in aesm_service

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit c7a3f14de9dbda16fd0fa1edbce1af24b350a678
Author: Li, Xun <xun.li@intel.com>
Date:   Mon Mar 20 14:14:23 2017 +0900

    update instructions in README

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit 525cefa817457d8a412d64677d347ebe64f0f77a
Merge: 1115c195c 157108515
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Mar 17 11:32:05 2017 +0800

    Merge pull request #86 from lzha101/master

    Update README.md

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 157108515551a5b465e7ba5e977df5c3e8df20b9
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Fri Mar 17 11:23:06 2017 +0800

    Update README.md

    Update README.md: fix format, update hardware requiremet, etc.

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 1115c195cd60d5ab2b80c12d07e21663e5aa8030
Author: Li, Xun <xun.li@intel.com>
Date:   Thu Mar 16 15:30:38 2017 +0900

    Linux 1.8 Open Source Gold release

    Signed-off-by: Li, Xun <xun.li@intel.com>

commit 2e379dc79fb58cdf921e36d617e6e4b9d694301c
Merge: 0d8a7d248 24dc91d77
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Mon Feb 27 16:24:11 2017 +0800

    Merge pull request #65 from corda/fix-mallinfo

    Change mallinfo field type to int as per system malloc.h

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 0d8a7d248a8ec6ae08451d78c7588711050d7477
Merge: 2cd3c7309 7e00ad320
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Feb 23 16:30:28 2017 +0800

    Merge pull request #75 from kaimast/master

    Fix simulator under GCC6

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 2cd3c73094637b1fa11740b7b9f51254050a9382
Merge: ddec9f872 171c04e0a
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Feb 23 16:30:04 2017 +0800

    Merge pull request #78 from mitar/patch-1

    Added missing dependencies

    Signed-off-by: Lili Zhang <lili.z.zhang@intel.com>

commit 171c04e0a2d079e75580018f891dd32562963cc4
Author: Mitar <mitar.github@tnode.com>
Date:   Wed Feb 22 17:56:41 2017 -0800

    Added missing dependencies.

    Signed-off-by: Mi Tar <mitar.github@tnode.com>

commit 7e00ad320f7dd2c6070d92bec5bf8f52af8d2af0
Author: Kai Mast <kaimast@cs.cornell.edu>
Date:   Sun Feb 19 20:42:49 2017 -0500

    Fix simulator under GCC6

commit ddec9f8725b597b7b656847b5c7cff1e25cb8018
Merge: dd537b756 75349459a
Author: lzha101 <lili.z.zhang@intel.com>
Date:   Thu Feb 16 13:47:12 2017 +0800

    Merge pull request #71 from sean-jc/master

    Bug fix - mprotect may be called with wrong flags

    Signed-off-by:  lzha101 <lili.z.zhang@intel.com>

commit 75349459a935f2b1a5a794ee8c0a0f45f50c5c1e
Author: Sean Christopherson <sean.j.christopherson@intel.com>
Date:   Mon Feb 6 12:31:30 2017 -0800

    Bug fix - mprotect may be called with wrong flags

    Query si_flags instead of attributes when determining whether a layout
    entry should be readable/writable or not accessible.  The current code
    magically works because all layout entries that should be marked R/W
    will have a non-zero value for attributes since added pages are marked
    with either ADD_EXTEND_PAGE or ADD_EXTEND_PAGE.

    Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

commit dd537b7562e16a83a1adf863e9e2874d05e2a9f3
Merge: d89c9abfd 91d5e850d
Author: haitaohuang <haitao.huang@intel.com>
Date:   Tue Jan 31 07:55:26 2017 -0600

    Merge pull request #68 from haitaohuang/master

    Clarify versions of the IPP crypto primitives

commit 91d5e850d1fcd1f4ae289639670bd48c67b2c6e1
Author: haitao huang <haitao.huang@intel.com>
Date:   Mon Jan 30 17:17:59 2017 -0600

    Clarify versions of the IPP crypto primitives

    Added statement in README.txt to clarify differences in two versions IPP crypto used for build.

    Signed-off-by: haitao huang <haitao.huang@intel.com>
This commit is contained in:
Chris Rankin 2017-09-13 14:52:21 +01:00 committed by GitHub
parent 697e2a6352
commit 6bb9d0015a
2220 changed files with 543303 additions and 74702 deletions

View File

@ -1,6 +1,6 @@
BSD License
Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -30,14 +30,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=================================================================
SGX Eclipse plug-in is licensed under Eclipse Public License-v1.0
Intel(R) Software Guard Extensions (Intel(R) SGX) Eclipse plug-in is licensed under Eclipse Public License-v1.0
http://www.eclipse.org/legal/epl-v10.html
==============================================================
libsgx_le.signed.so, libsgx_pce.signed.so, libsgx_pve.signed.so and libsgx_qe.signed.so are licensed as Intel redistributable binary firmware and other blobs.
libsgx_le.signed.so, libsgx_pce.signed.so, libsgx_pve.signed.so, libsgx_qe.signed.so, libsgx_pse_pr.signed.so and libsgx_pse_op.signed.so are licensed as Intel redistributable binary firmware and other blobs.
Copyright (c) Intel Corporation.
@ -83,7 +83,7 @@ DAMAGE.
===========================================================================================================================================================
SGX software for Linux also uses third-party projects that may be distributed under different licenses. Please see below for details.
Intel(R) SGX software for Linux also uses third-party projects that may be distributed under different licenses. Please see below for details.
1. Android Open Source Project
@ -98,21 +98,26 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS" AND A
2. compiler_rt
2. compiler_rt and libc++
The compiler_rt library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license. As a user of this code you may choose
to use it under either license. As a contributor, you agree to allow your code
to be used under both.
The libc++ library is dual licensed under both the University of Illinois
"BSD-Like" license and the MIT license. As a user of this code you may choose
to use it under either license. As a contributor, you agree to allow your code
to be used under both.
Full text of the relevant licenses is included below.
=============================================================================
==============================================================================
University of Illinois/NCSA
Open Source License
Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
Copyright (c) 2009-2016 by the contributors listed in CREDITS.TXT
All rights reserved.
@ -124,72 +129,72 @@ Developed by:
http://llvm.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal with the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so, subject
to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal with
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimers.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the documentation and/or
other materials provided with the distribution.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimers in the
documentation and/or other materials provided with the distribution.
- Neither the names of the LLVM Team, University of Illinois at Urbana-Champaign,
nor the names of its contributors may be used to endorse or romote products derived
from this Software without specific prior written permission.
* Neither the names of the LLVM Team, University of Illinois at
Urbana-Champaign, nor the names of its contributors may be used to
endorse or promote products derived from this Software without specific
prior written permission.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS WITH THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
=============================================================================
==============================================================================
Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT
Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=============================================================================
Copyrights and Licenses for Third Party Software Distributed with LLVM:
=============================================================================
The LLVM software contains code written by third parties. Such software will have its
own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply to that code.
The LLVM software contains code written by third parties. Such software will
have its own individual LICENSE.TXT file in the directory in which it appears.
This file will describe the copyrights, license, and restrictions which apply
to that code.
The disclaimer of warranty in the University of Illinois Open Source License applies to all
code in the LLVM Distribution, and nothing in any of the other licenses gives permission to
use the names of the LLVM Team or the University of Illinois to endorse or promote products
derived from this Software.
The following pieces of software have additional or alternate copyrights, licenses, and/or
restrictions:
Program Directory
------- ---------
mach_override lib/interception/mach_override
The disclaimer of warranty in the University of Illinois Open Source License
applies to all code in the LLVM Distribution, and nothing in any of the
other licenses gives permission to use the names of the LLVM Team or the
University of Illinois to endorse or promote products derived from this
Software.
3. DLmalloc
@ -1115,7 +1120,7 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
16. EPID SDK
16. Intel(R) Enhanced Privacy ID (Intel(R) EPID) SDK
Apache License
Version 2.0, January 2004
@ -1394,3 +1399,44 @@ All Recipient's rights under this Agreement shall terminate if it fails to compl
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
18. TCMALLOC
TCMALLOC is part of Google Perf Tools, which is distributed under the terms of the BSD license.
http://goog-perftools.sourceforge.net/
Copyright (c) 2005, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -12,23 +12,23 @@
<!-- -->
<feature
id="com.intel.sgx.feature"
label="Software Guard Extensions Plugin"
label="Intel(R) Software Guard Extensions Plugin"
version="1.0.1.qualifier"
provider-name="INTEL">
<description url="http://fso-dev-machine.ed.intel.com">
The Software Guard Extensions Plug-in enables Independent Service
The Intel(R) Software Guard Extensions Plug-in enables Independent Service
Vendors in developing Linux applications
with Software Guard Extensions. The Plug-in extends the C/C++ Development
with Intel(R) Software Guard Extensions. The Plug-in extends the C/C++ Development
tools Plug-in to allow ISVs develop secure extensions in C or
C++. The Plug-in also allows conversion of an Linux Application
project into an Linux Application project with Software Guard
Extensions.
Using the Plug-in features and SGX Plug-in Menu options, a developer
Using the Plug-in features and Intel(R) SGX Plug-in Menu options, a developer
can modify the Signing keys and Enclave Configuration for an
Enclave project and can add enclaves inside a project with SGX Nature.
Enclave project and can add enclaves inside a project with Intel(R) SGX Nature.
Once development is complete, the developer can build the Enclave
and the Linux project using the SGX SDK for Linux with Release/Debug Configurations in Simulation/Hardware
and the Linux project using the Intel(R) SGX SDK for Linux with Release/Debug Configurations in Simulation/Hardware
mode and Hardware Prerelease mode.
</description>
@ -110,7 +110,7 @@ This Agreement is governed by the laws of the State of New York and the intellec
</license>
<url>
<update label="Software Guard Extensions Eclipse Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx"/>
<update label="Intel(R) Software Guard Extensions Eclipse Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx"/>
</url>
<requires>

View File

@ -1,7 +1,7 @@
License: Eclipse Public License Version 1.0 ("EPL")
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SGX Eclipse Plugin Userguide
Bundle-Name: Intel(R) SGX Eclipse Plugin Userguide
Bundle-SymbolicName: com.intel.sgx.userguide;singleton:=true
Bundle-Version: 1.0.1.qualifier
Bundle-Activator: com.intel.sgx.userguide.Activator

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -109,8 +109,8 @@ developers by the Intel(R) SGX SDK.</p>
</div>
<div id='Introducing_Intel_Software_Guard_Extensions'>
<h2>Introducing Intel(R) Software Guard Extensions Eclipse* Plug-in</h2>
<p>The Intel(R) Software Guard Extensions Eclipse* Plug-in helps the enclave developer to maintain enclaves and untrusted related code inside Eclipse* C/C++ projects. To use this support, add SGX nature to the C/C++ project. See <a href="#Adding_SGX_Nature_to_a_Project">Adding SGX Nature to a Project</a> for details.</p>
<p>Once the SGX nature is added to a project, you will have access to the SGX commands. SGX nature adds also a folder called <code>sgx</code> to the root of the project, and a Makefile inside it. All resources of the project managed by Intel(R) Software Guard Extensions Eclipse Plug-inare located inside this directory. You can build and run enclaves related code using GNU* Make tool through the Makefile.</p>
<p>The Intel(R) Software Guard Extensions Eclipse* Plug-in helps the enclave developer to maintain enclaves and untrusted related code inside Eclipse* C/C++ projects. To use this support, add Intel(R) SGX nature to the C/C++ project. See <a href="#Adding_SGX_Nature_to_a_Project">Adding Intel(R) SGX Nature to a Project</a> for details.</p>
<p>Once the Intel(R) SGX nature is added to a project, you will have access to the Intel(R) SGX commands. Intel(R) SGX nature adds also a folder called <code>sgx</code> to the root of the project, and a Makefile inside it. All resources of the project managed by Intel(R) Software Guard Extensions Eclipse Plug-in are located inside this directory. You can build and run enclaves related code using GNU* Make tool through the Makefile.</p>
<p>The plugin is generating minimal but ready-to-work code skeletons, complete with their own Makefile having all the required make targets as to call <code>sgx_edger8r</code> tool to generate the proxies and bridges, compile these source, generate a shared object and finally, to sign the enclave with the <code>sgx_sign</code> tool. This provide a starting point you may build upon.</p>
</div>
<div id='Getting_Started'>
@ -123,7 +123,7 @@ developers by the Intel(R) SGX SDK.</p>
<h2>Pre-requisites</h2>
<p>To use Intel(R) Software Guard Extensions Eclipse Plug-in, install the following softwares:</p>
<ul>
<li>Eclipse* Mars 1 with CDT IDE for C/C++ Developpers (version 4.5.1). To use this version, install Java* Development Kit (JDK) or Java* Runtime Environment (JRE) version 1.8 or above.</li>
<li>Eclipse* Mars 1 with CDT IDE for C/C++ Developers (version 4.5.1). To use this version, install Java* Development Kit (JDK) or Java* Runtime Environment (JRE) version 1.8 or above.</li>
<li>gcc/g++ tools</li>
<li>Openssl*</li>
<li>Intel(R) SGX SDK for Linux* OS</li>
@ -142,62 +142,62 @@ developers by the Intel(R) SGX SDK.</p>
<p class="figcap">Add Repository Dialog</p>
</li>
<li>
<p>Enter <code>SGX Archive</code> in the <b>Name</b> field . Click the <b>Archive...</b> button and select the location of the downloaded archive as shown in the following graphic:</p>
<p>Enter <code>Intel(R) SGX Archive</code> in the <b>Name</b> field . Click the <b>Archive...</b> button and select the location of the downloaded archive as shown in the following graphic:</p>
<p>
<img src="Resources/Images/The_Location_of_the_Plugin_zip_Archive.png" />
</p>
<p class="figcap">The Location of the Plugin zip Archive</p>
</li>
<li>Press <b>OK</b> to add the archive as a repository.</li>
<li>In the <b>Install</b> dialog, select the <b>Software Guard Extensions Plugin</b> check-box and proceed with the usual steps.</li>
<li>In the <b>Install</b> dialog, select the <b>Intel(R) Software Guard Extensions Plugin</b> check-box and proceed with the usual steps.</li>
</ol>
</div>
<div id='Configuring_Intel_Software_Guard_Extensions_Eclipse_Plug-in'>
<h2>Configuring Intel(R) Software Guard Extensions Eclipse* Plug-in</h2>
<p>If you do not install Intel(R) SGX SDK for Linux* OS in the default location, you need to specify the path for Intel SGX SDK using the following steps:</p>
<p>If you do not install Intel(R) SGX SDK for Linux* OS in the default location, you need to specify the path for Intel(R) SGX SDK using the following steps:</p>
<ol>
<li>
<p>Go to <b>Window menu -&gt;Preferences</b>. Enter SGX in the filter text field to quickly locate the <b>SGX Preferences</b> page.</p>
<p>Go to <b>Window menu -&gt;Preferences</b>. Enter Intel(R) SGX in the filter text field to quickly locate the <b>Intel(R) SGX Preferences</b> page.</p>
<p>
<img src="Resources/Images/SGX_Preference_Page.png" />
</p>
<p class="figcap">SGX Preference Page</p>
<p class="figcap">Intel(R) SGX Preference Page</p>
</li>
<li>Enter the path for Intel SGX SDK for Linux OS in the <b>SGX SDK Directory</b> field.</li>
<li>Enter the path for Intel(R) SGX SDK for Linux OS in the <b>Intel(R) SGX SDK Directory</b> field.</li>
</ol>
</div>
<div id='Command_Reference'>
<h1>Command Reference</h1>
<p>This topic provides the command reference for the following scenarios of using Intel(R) Software Guard Extensions Eclipse* Plug-in:</p>
<ul>
<li>Adding SGX nature to a project</li>
<li>Adding an SGX enclave</li>
<li>Adding an SGX trusted library</li>
<li>Adding an SGX untrusted module</li>
<li>Updating SGX enclave signing key</li>
<li>Adding Intel(R) SGX nature to a project</li>
<li>Adding an Intel(R) SGX enclave</li>
<li>Adding an Intel(R) SGX trusted library</li>
<li>Adding an Intel(R) SGX untrusted module</li>
<li>Updating Intel(R) SGX enclave signing key</li>
<li>Updating enclave configuration files</li>
<li>Two steps sign enclave</li>
</ul>
<p>All commands brought by Intel(R) Software Guard Extensions Eclipse Plug-in are available by right-clicking on the Project root in Project explorer view in menu <b>Software Guard Extension Tools</b>:</p>&#160;<p><img src="Resources/Images/Project_Explorer.png" /></p><p class="figcap">Project Explorer</p>&#160;</div>
<p>All commands brought by Intel(R) Software Guard Extensions Eclipse Plug-in are available by right-clicking on the Project root in Project explorer view in menu <b>Intel(R) Software Guard Extensions Tools</b>:</p>&#160;<p><img src="Resources/Images/Project_Explorer.png" /></p><p class="figcap">Project Explorer</p>&#160;</div>
<div id='Adding_SGX_Nature_to_a_Project'>
<h2>Adding SGX Nature to a Project</h2>
<p>The <i>nature</i> of an Eclipse project is a concept defined by an Eclipse Platform which allows a plug-in to tag a project as a specific kind of project. Intel(R) Software Guard Extensions uses an <i>SGX nature</i> to add SGX-specific behavior to projects. Project natures are defined by plug-ins, and are typically added or removed per-project when the user performs some action defined by the plug-in.</p>
<p>To use Intel(R) Software Guard Extensions Eclipse Plug-in in your project, you need to add SGX nature to it. You may either add SGX nature to a pre-existing C/C++ project or create a project with SGX nature from start. See <a href="#Adding_SGX_Nature_to_a_non_SGX_project">Adding SGX Nature to a non-SGX project</a> and <a href="#Creating_a_New_C_C_Project_with_SGX_Nature">Creating a New C/C++ Project with SGX Nature</a> for how to complete these tasks.</p>
<h2>Adding Intel(R) SGX Nature to a Project</h2>
<p>The <i>nature</i> of an Eclipse project is a concept defined by an Eclipse Platform which allows a plug-in to tag a project as a specific kind of project. Intel(R) Software Guard Extensions uses an <i>Intel(R) SGX nature</i> to add Intel(R) SGX-specific behavior to projects. Project natures are defined by plug-ins, and are typically added or removed per-project when the user performs some action defined by the plug-in.</p>
<p>To use Intel(R) Software Guard Extensions Eclipse Plug-in in your project, you need to add Intel(R) SGX nature to it. You may either add Intel(R) SGX nature to a pre-existing C/C++ project or create a project with Intel(R) SGX nature from start. See <a href="#Adding_SGX_Nature_to_a_non_SGX_project">Adding Intel(R) SGX Nature to a non-SGX project</a> and <a href="#Creating_a_New_C_C_Project_with_SGX_Nature">Creating a New C/C++ Project with Intel(R) SGX Nature</a> for how to complete these tasks.</p>
</div>
<div id='Adding_SGX_Nature_to_a_non_SGX_project'>
<h3>Adding SGX Nature to a non-SGX project</h3>
<p>When you have a C/C++ project created without Intel SGX, you cannot use Intel SGX support. In this case, you need to add SGX nature to this project to use Intel SGX support:</p>
<h3>Adding Intel(R) SGX Nature to a non-SGX project</h3>
<p>When you have a C/C++ project created without Intel(R) SGX, you cannot use Intel(R) SGX support. In this case, you need to add Intel(R) SGX nature to this project to use Intel(R) SGX support:</p>
<ol>
<li>Right-click on the project root <![CDATA[ ]]></li>
<li>Right-click on the project root</li>
<li>
<p>Select <b>Software Guard Extension Tools → Add SGX Nature</b></p>
<p>Select <b>Intel(R) Software Guard Extensions Tools → Add Intel(R) SGX Nature</b></p>
<p>
<img src="Resources/Images/Add_SGX_Nature.png" />
</p>
<p class="figcap">Add SGX Nature</p>
<p class="figcap">Add Intel(R) SGX Nature</p>
</li>
</ol>
<p>After you add the SGX nature to your project, you should see:</p>
<p>After you add the Intel(R) SGX nature to your project, you should see:</p>
<ul>
<li>
<p>A subdirectory <code>sgx</code> in the project which contains a Makefile file.</p>
@ -207,14 +207,14 @@ developers by the Intel(R) SGX SDK.</p>
<p class="figcap">Makefile for Intel(R) SGX</p>
</li>
<li>
<p>The Intel SGX tools as shown in the following graphic:</p>
<p>The Intel(R) SGX tools as shown in the following graphic:</p>
<p>
<img src="Resources/Images/Intel_SGX_Tools.png" />
</p>
<p class="figcap">Intel(R) SGX Tools</p>
</li>
<li>
<p>New configurations specific to SGX technology. You may see the configurations for the project by clicking to the down arrow of button <img src="Resources/Images/Down_Arrow_Button.png" /> usually found at the top of the Eclipse window:</p>
<p>New configurations specific to Intel(R) SGX technology. You may see the configurations for the project by clicking to the down arrow of button <img src="Resources/Images/Down_Arrow_Button.png" /> usually found at the top of the Eclipse window:</p>
<p>
<img src="Resources/Images/Configurations_Specific_to_Intel_SGX_Technology.png" />
</p>
@ -223,36 +223,36 @@ developers by the Intel(R) SGX SDK.</p>
</ul>
</div>
<div id='Creating_a_New_C_C_Project_with_SGX_Nature'>
<h3>Creating a New C/C++ Project with SGX Nature</h3>
<p>You can create a new project with SGX nature. To create such a project, follow these steps:</p>
<h3>Creating a New C/C++ Project with Intel(R) SGX Nature</h3>
<p>You can create a new project with Intel(R) SGX nature. To create such a project, follow these steps:</p>
<ol>
<li>
<p>Open a standard Eclipse new project: <b>File menu → Project...</b> . If you have installed Intel® Software Guard Extensions Eclipse Plug-in, you can see the category C/C++ with SGX Enabled in the <b>New Project</b> dialog.</p>
<p>Open a standard Eclipse new project: <b>File menu → Project...</b> . If you have installed Intel(R) Software Guard Extensions Eclipse Plug-in, you can see the category C/C++ with Intel(R) SGX Enabled in the <b>New Project</b> dialog.</p>
<p>
<img src="Resources/Images/New_Project.png" />
</p>
<p class="figcap">New Project</p>
<p>This category has 2 sub-categories, <b>SGX C project</b> and <b>SGX C++ project</b>. These sub-categories are similar to the sub-categories C Project and C++ Project of standard C/C++ category.</p>
<p>This category has 2 sub-categories, <b>C project</b> and <b>C++ project</b>. These sub-categories are similar to the sub-categories C Project and C++ Project of standard C/C++ category.</p>
</li>
<li>Select one of the 2 sub-categories, SGX C project or SGX C++ project, and click <b>Next</b>.</li>
<li>Select one of the 2 sub-categories, C project or C++ project, and click <b>Next</b>.</li>
<li>Complete creating the project using the regular process of creating a standard C or C++ project.</li>
</ol>
<div class="NoteCont">
<p class="NoteTipHead">NOTE:</p>
<p>Projects created following the subcategories under <b>C/C++ with SGX Enabled</b> are identical with their standard counterparts, except that they have SGX Nature added. There is no difference between creating a C or C++ project with SGX enabled, or creating a standard C/C++ project and launch <b>Add SGX nature</b> from it, as described in precedent paragraph.</p>
<p>Projects created following the subcategories under <b>C/C++ with Intel(R) SGX Enabled</b> are identical with their standard counterparts, except that they have Intel(R) SGX Nature added. There is no difference between creating a C or C++ project with Intel(R) SGX enabled, or creating a standard C/C++ project and launch <b>Add Intel(R) SGX nature</b> from it, as described in precedent paragraph.</p>
</div>
</div>
<div id='Adding_an_SGX_Enclave'>
<h2>Adding an SGX Enclave</h2>
<p>After you add the SGX nature to a project, you can start creating a minimal but complete skeleton for a new enclave:</p>
<h2>Adding an Intel(R) SGX Enclave</h2>
<p>After you add the Intel(R) SGX nature to a project, you can start creating a minimal but complete skeleton for a new enclave:</p>
<ol>
<li>Right-click on the project root in <b>Project Explorer</b>.</li>
<li>
<p>Open the dialog <b>Add New SGX Enclave</b> by selecting <b>Software Guard Extensions Tools → Add SGX Enclave</b> from the contextual menu.</p>
<p>Open the dialog <b>Add New Intel(R) SGX Enclave</b> by selecting <b>Intel(R) Software Guard Extensions Tools → Add Intel(R) SGX Enclave</b> from the contextual menu.</p>
<p>
<img src="Resources/Images/Add_New_Intel_SGX_Enclave_Dialog.png" />
</p>
<p class="figcap">Add New Intel® SGX Enclave Dialog</p>
<p class="figcap">Add New Intel(R) SGX Enclave Dialog</p>
</li>
<li>
<p>Choose a name for the enclave in <b>Enclave name</b> field. This name is used in the process of generation of the skeleton to give unicity to the source files and the name of the resulting executable, so you can add more than one enclave to the same project.</p>
@ -276,20 +276,20 @@ developers by the Intel(R) SGX SDK.</p>
</ol>
<div class="NoteCont">
<p class="NoteTipHead">NOTE:</p>
<p>If you select the <b>Generate sample untrusted application</b> checkbox, ecalls from the untrusted part are not be resolved by Eclipse C/C++ indexer. These functions are marked with a red line. The declaration of these ecalls resides in the unstrusted stub header which is generated during the build proces and is not indexed by Eclipse. To resolve this problem, right-click on project root and select <b>Index → Freshen All Files</b>.</p>
<p>If you select the <b>Generate sample untrusted application</b> checkbox, ecalls from the untrusted part are not be resolved by Eclipse C/C++ indexer. These functions are marked with a red line. The declaration of these ecalls resides in the unstrusted stub header which is generated during the build process and is not indexed by Eclipse. To resolve this problem, right-click on project root and select <b>Index → Freshen All Files</b>.</p>
</div>
</div>
<div id='Adding_an_SGX_Trusted_Library'>
<h2>Adding an SGX Trusted Library</h2>
<h2>Adding an Intel(R) SGX Trusted Library</h2>
<p>Trusted Static Libraries helps enclave author have libraries of shared code to be reused by enclaves, in exactly the same manner as usual static <code>libxxx.a</code> libraries are used to share code between regular non-SGX applications. The plugin adds a command to generate the skeleton of a trusted shared library.</p>
<p>To add a new SGX Trusted Library:</p>
<p>To add a new Intel(R) SGX Trusted Library:</p>
<ol>
<li>
<p>Open <b>Add New SGX Static Trusted Library</b> dialog by right-click on the root of the project and select the appropriate command from <b>Software Guard Extensions Tools</b> menu:</p>
<p>Open <b>Add New Intel(R) SGX Static Trusted Library</b> dialog by right-click on the root of the project and select the appropriate command from <b>Intel(R) Software Guard Extensions Tools</b> menu:</p>
<p>
<img src="Resources/Images/Add_New_SGX_Static_Trusted_Library_Dialog.png" />
</p>
<p class="figcap">Add New SGX Static Trusted Library Dialog</p>
<p class="figcap">Add New Intel(R) SGX Static Trusted Library Dialog</p>
</li>
<li>
<p>Choose a name for the library and click <b>OK</b>. A skeleton for a trusted library is generated in directory <code>&lt;root&gt;/sgx/trustedlib_&lt;name&gt;</code>:</p>
@ -301,16 +301,16 @@ developers by the Intel(R) SGX SDK.</p>
</ol>
</div>
<div id='Adding_an_SGX_Untrusted_Module'>
<h2>Adding an SGX Untrusted Module</h2>
<h2>Adding an Intel(R) SGX Untrusted Module</h2>
<p>Add an untrusted module to generate the untrusted stubs so you use an enclave, provided you have access to its <code>.edl</code> file. The enclave might have been built in the current project or in a different project.</p>
<p>To use trusted functionality of an enclave for which its <code>*.edl</code> is known, use the command <b>Add SGX Untrusted Module</b>:</p>
<p>To use trusted functionality of an enclave for which its <code>*.edl</code> is known, use the command <b>Add Intel(R) SGX Untrusted Module</b>:</p>
<ol>
<li>
<p>Open dialog <b>Add Sgx Untrusted Module</b> by right-click-ing the project root in <b>Package Explorer</b> and chose the command from <b>Software Guard Extension Tools</b>.</p>
<p>Open dialog <b>Add Intel(R) SGX Untrusted Module</b> by right-click-ing the project root in <b>Package Explorer</b> and chose the command from <b>Intel(R) Software Guard Extensions Tools</b>.</p>
<p>
<img src="Resources/Images/Add_SGX_Untrusted_Module.png" />
</p>
<p class="figcap">Add SGX Untrusted Module</p>
<p class="figcap">Add Intel(R) SGX Untrusted Module</p>
</li>
<li>
<p>Use the <b>Browse</b> button to navigate the file system using a file dialog, and click <b>OK</b>. The untrusted module is copied to <code>&lt;root&gt;/sgx/untrusted_&lt;edl file name&gt;</code>. The selected <code>*.edl</code> is copied to the project.</p>
@ -322,13 +322,13 @@ developers by the Intel(R) SGX SDK.</p>
</ol>
</div>
<div id='Updating_SGX_Enclave_Signing_Key'>
<h2>Updating SGX Enclave Signing Key</h2>
<p>All skeletons enclave samples produced by the plugin contain a sample signing key. You might want to import another sign key that you already have, or generate a new one. Use the command <b>Update SGX Enclave Signing Key</b> to complete this task.</p>
<h2>Updating Intel(R) SGX Enclave Signing Key</h2>
<p>All skeletons enclave samples produced by the plugin contain a sample signing key. You might want to import another sign key that you already have, or generate a new one. Use the command <b>Update Intel(R) SGX Enclave Signing Key</b> to complete this task.</p>
<ol>
<li>Choose <b>Update SGX Enclave Signing Key</b> by right-click on the project in <b>Project Explorer -&gt; Software Guard Extension Tools</b> menu. The <b>Import or (Re)Generate Enclave Signing Key</b> dialog appears.</li>
<li>Choose <b>Update Intel(R) SGX Enclave Signing Key</b> by right-click on the project in <b>Project Explorer -&gt; Intel(R) Software Guard Extensions Tools</b> menu. The <b>Import or (Re)Generate Enclave Signing Key</b> dialog appears.</li>
<li>In the <b>Import or (Re)Generate Enclave Signing Key</b> dialog, click <b>Select</b> to open a file dialog to select the output key.</li>
<li>
<p>Click <b>Improt Key</b> to update a selected signing key by copying another existing key or click <b>Generate Key</b> to update the selected signing key by generating a new key. In both cases, the new signature key is put into the file in text field <b>Enclave Signing Key</b>.</p>
<p>Click <b>Import Key</b> to update a selected signing key by copying another existing key or click <b>Generate Key</b> to update the selected signing key by generating a new key. In both cases, the new signature key is put into the file in text field <b>Enclave Signing Key</b>.</p>
<p>
<img src="Resources/Images/Import_or_Re_Generate_Enclave_Signing_Key.png" />
</p>
@ -347,7 +347,7 @@ developers by the Intel(R) SGX SDK.</p>
<p>To update this configuration file, use the <b>Update Config</b> command:</p>
<ol>
<li>
<p>Right-click on the root project, <b>Software Extension Guards Tools-&gt;Select Config File</b>.</p>
<p>Right-click on the root project, <b>Intel(R) Software Guard Extensions Tools-&gt;Select Config File</b>.</p>
<p>
<img src="Resources/Images/Select_Configuration_File.png" />
</p>
@ -388,17 +388,17 @@ developers by the Intel(R) SGX SDK.</p>
<li>The <code>.hex</code> file matches the unsigned enclave and the configuration file,</li>
<li>The signed material is verified with the public key</li>
</ul>
<p>If the parameters are consistenet, the production signed enclave is produced.</p>
<p>If the parameters are consistent, the production signed enclave is produced.</p>
<div class="NoteCont">
<p class="NoteTipHead">NOTE:</p>
<p>If you generate signed enclave right after generating hash, you can only enter the parameters specific for generating signed enclave.</p>
</div>
<p>To use the two-step signing function, activate the configuration <b>SGX Hardware Release mode</b>. When this configuration is active, the compilation does not produce a signed enclave, as in the other SGX configurations; the process only produces unsigned enclaves.</p>
<p>To use the two-step signing function, activate the configuration <b>Intel(R) SGX Hardware Release mode</b>. When this configuration is active, the compilation does not produce a signed enclave, as in the other Intel(R) SGX configurations; the process only produces unsigned enclaves.</p>
<p>
<img src="Resources/Images/Configure_SGX_Hardware_Release_Mode.png" />
</p>
<p class="figcap">Configure SGX Hardware Release Mode</p>
<p>When you configure the plugin in the <b>SGX Hardware Release Mode</b>, you can see the <b>Generate Hash</b> and <b>Generate Signed Enclave</b> options through <b>Software Guard Extension Tools-&gt;Two Step Sign Enclave</b>.</p>
<p class="figcap">Configure Intel(R) SGX Hardware Release Mode</p>
<p>When you configure the plugin in the <b>Intel(R) SGX Hardware Release Mode</b>, you can see the <b>Generate Hash</b> and <b>Generate Signed Enclave</b> options through <b>Intel(R) Software Guard Extensions Tools-&gt;Two Step Sign Enclave</b>.</p>
<p>
<img src="Resources/Images/Two_Step_Sign_Enclave_Menu.png" />
</p>
@ -409,13 +409,13 @@ developers by the Intel(R) SGX SDK.</p>
<p>Generating hash is the first step in the 2-Steps signing process.To generate hash, use the following steps:</p>
<ol>
<li>
<p>Right-click on project root, go to <b>Software Guard Extensions Tools menu → Two StepSigne Enclave → Generate Hash</b></p>
<p>Right-click on project root, go to <b>Intel(R) Software Guard Extensions Tools menu → Two Step Enclave Sign → Generate Hash</b></p>
<p>
<img src="Resources/Images/Two_StepSigne_Enclave_Generate_Hash.png" />
</p>
<p class="figcap">Two StepSigne Enclave - Generate Hash</p>
<p class="figcap">Two Step Enclave Sign - Generate Hash</p>
</li>
<li> In the <b>Generate Hash</b> dialog, enter the required inputs to the corresponding fields:<ul><li>Enter the path to the compiled enclave to be signed in the <b>Enclave Path</b> field. Click <b>Select Enclave</b> to open a file dialog to select the enclave.</li><li>In the <b>Hash File Location</b> field , enter the path of the output file that will contain signing materials. By default this file has the same file name as the unsigned enclave, with <code>.hex</code> extension added. To change the path, click <b>Select File Path</b> to open a file dialog to select the file path.</li><li>In the <b>Configuration File</b> path field, enter the path of the configuration filefor the generated hash. Click <b>Select Config</b> to open a dialog to select from all enclave configuration files in the project (similar with the one of the command <b>Update Config</b>).</li></ul></li>
<li> In the <b>Generate Hash</b> dialog, enter the required inputs to the corresponding fields:<ul><li>Enter the path to the compiled enclave to be signed in the <b>Enclave Path</b> field. Click <b>Select Enclave</b> to open a file dialog to select the enclave.</li><li>In the <b>Hash File Location</b> field , enter the path of the output file that will contain signing materials. By default this file has the same file name as the unsigned enclave, with <code>.hex</code> extension added. To change the path, click <b>Select File Path</b> to open a file dialog to select the file path.</li><li>In the <b>Configuration File</b> path field, enter the path of the configuration file for the generated hash. Click <b>Select Config</b> to open a dialog to select from all enclave configuration files in the project (similar with the one of the command <b>Update Config</b>).</li></ul></li>
<li>
<p>Click <b>OK</b> after you fill in all the fields. The Intel(R) SGX SDK is launched under the hood with the provided parameters and the hash file is generated. A dialog box appears to confirm the completion:</p>
<p>
@ -425,7 +425,7 @@ developers by the Intel(R) SGX SDK.</p>
</li>
</ol>
<p>You complete the first step, generating hash, in the two step signing enclave. The <code>*.hex</code> file may be signed with the external facility, which generates a signature for it and a public verification key.</p>
<p>If you click <b>OK</b>, the <b>Generate Signed Enclave</b> dialog appears. The required fileds in this dialog have been pre-configured with the paths of the unsigned enclave, the configuration file and of the <code>*.hex</code> file. To generated the final signed enclave ready for production immediately, click <b>OK</b>.</p>
<p>If you click <b>OK</b>, the <b>Generate Signed Enclave</b> dialog appears. The required fields in this dialog have been pre-configured with the paths of the unsigned enclave, the configuration file and of the <code>*.hex</code> file. To generated the final signed enclave ready for production immediately, click <b>OK</b>.</p>
<p>
<img src="Resources/Images/Generate_Signed_Enclave_Dialog_with_Pre_configurations.png" />
</p>
@ -441,10 +441,10 @@ developers by the Intel(R) SGX SDK.</p>
<li>The signature of the <code>.hex</code> file</li>
<li>The public verification key</li>
</ul>
<p>To generate signed encalves, use the following steps:</p>
<p>To generate signed enclaves, use the following steps:</p>
<ol>
<li>
<p>Right-click on the project root, and go to <b>Software Guard Extensions Tools menu → Two Step Sign Enclave → Generate Signed Enclave</b>.</p>
<p>Right-click on the project root, and go to <b>Intel(R) Software Guard Extensions Tools menu → Two Step Sign Enclave → Generate Signed Enclave</b>.</p>
<p>
<img src="Resources/Images/Generate_Signed_Enclave_Dialog.png" />
</p>
@ -454,28 +454,28 @@ developers by the Intel(R) SGX SDK.</p>
</ol>
</div>
<div id='Building_and_Running_SGX_Code'>
<h1>Building and Running SGX Code</h1>
<p>This section describes the following topics about building and running SGX code:</p>
<h1>Building and Running Intel(R) SGX Code</h1>
<p>This section describes the following topics about building and running Intel(R) SGX code:</p>
<ul>
<li>SGX build configurations</li>
<li>Intel(R) SGX build configurations</li>
<li>Running samples generated for enclaves</li>
</ul>&#160;</div>
<div id='SGX_Build_Configurations'>
<h2>SGX Build Configurations</h2>
<h2>Intel(R) SGX Build Configurations</h2>
<p>There are usually two types of builds that a regular non-SGX project defines:</p>
<ul>
<li>Debug</li>
<li>Release</li>
</ul>
<p>SGX-enabled projects add to this picture support to build and test SGX-enabled application on non-SGX platforms (or emulator) using simulation libraries. This approach doubles the set of build types, creating four possible combinations. For these combinations, you need to use different sets of compilation and linking flags and link different libraries.</p>
<p>The non-debug hardware build is meant to give production code, so it requires the maximum attention when signed. The Two Steps Sign schema is required for production enclaves, which involves an external signing facility, not part of Intel SGX SDK. The other configurations are not meant for production but they have to be signed too. The simplest and more convenient Single Step schema is used for them.</p>
<p>Again for testing purpose, you might want to experiment with a non-production enclave built with release compilation and linking flags, on a real hardware SGX-enabled platform. That would be an enclave built exactly as a production enclave, except for the sign process which would be Single Step. To support the construction of such enclave, there is a hardware non-debug build configuration dubbed <i>Prerelease</i>.</p>
<p>So there are five SGX related configurations when SGX Nature is added to a project:</p>
<p>Intel(R) SGX-enabled projects add to this picture support to build and test Intel(R) SGX-enabled application on non-SGX platforms (or emulator) using simulation libraries. This approach doubles the set of build types, creating four possible combinations. For these combinations, you need to use different sets of compilation and linking flags and link different libraries.</p>
<p>The non-debug hardware build is meant to give production code, so it requires the maximum attention when signed. The Two Steps Sign schema is required for production enclaves, which involves an external signing facility, not part of Intel(R) SGX SDK. The other configurations are not meant for production but they have to be signed too. The simplest and more convenient Single Step schema is used for them.</p>
<p>Again for testing purpose, you might want to experiment with a non-production enclave built with release compilation and linking flags, on a real hardware Intel(R) SGX-enabled platform. That would be an enclave built exactly as a production enclave, except for the sign process which would be Single Step. To support the construction of such enclave, there is a hardware non-debug build configuration dubbed <i>Prerelease</i>.</p>
<p>So there are five Intel(R) SGX related configurations when Intel(R) SGX Nature is added to a project:</p>
<p>
<img src="Resources/Images/Intel_SGX_Configurations.png" />
</p>
<p>Intel(R) SGX Configurations</p>
<p>The following table resumes the existing SGX configurations and relate them with compilation/linking flags (debug/non-debug) and signing scheme (single vs. two steps):</p>
<p>The following table resumes the existing Intel(R) SGX configurations and relate them with compilation/linking flags (debug/non-debug) and signing scheme (single vs. two steps):</p>
<p class="tablecap">Intel(R) SGX Configurations</p>
<table style="width: 100%;border-left-style: solid;border-left-width: 1px;border-right-style: solid;border-right-width: 1px;border-top-style: solid;border-top-width: 1px;border-bottom-style: solid;border-bottom-width: 1px;">
<col />
@ -490,50 +490,50 @@ developers by the Intel(R) SGX SDK.</p>
<th>Signing Schema</th>
</tr>
<tr>
<td>SGX Hardware Debug</td>
<td>Intel(R) SGX Hardware Debug</td>
<td>Hardware</td>
<td>Debug</td>
<td>Single Step</td>
</tr>
<tr>
<td>SGX Hardware Pre-release</td>
<td>Intel(R) SGX Hardware Pre-release</td>
<td>Hardware</td>
<td>Non-debug</td>
<td>Single Step</td>
</tr>
<tr>
<td>SGX Hardware Release</td>
<td>Intel(R) SGX Hardware Release</td>
<td>Hardware</td>
<td>Non-debug</td>
<td>Two Step</td>
</tr>
<tr>
<td>SGX Simulation</td>
<td>Intel(R) SGX Simulation</td>
<td>Simulation</td>
<td>Non-debug</td>
<td>Single Step</td>
</tr>
<tr>
<td>SGX Simulation</td>
<td>Intel(R) SGX Simulation</td>
<td>Debug Simulation</td>
<td>Debug</td>
<td>Single step</td>
</tr>
</tbody>
</table>
<p>Intel® Software Guard Extensions Eclipse Plug-in uses standard GNU* make tool to build the trusted and the untrusted code, using the generated file <code>sgx/Makefile</code>.</p>
<p>This fact does not impose any restriction on the build tool chosen for the hosting project. Intel® Software Guard Extensions Eclipse* Plug-in uses its own build configurations which do not interfere with the configurations that you might have in your project.</p>
<p>When SGX configurations are selected, by default only code under <code>&lt;root&gt;/sgx</code> directory get built.</p>
<p>You can customize SGX configurations as any other Eclipse build configurations from the project properties dialog. For example:</p>
<p>Intel(R) Software Guard Extensions Eclipse Plug-in uses standard GNU* make tool to build the trusted and the untrusted code, using the generated file <code>sgx/Makefile</code>.</p>
<p>This fact does not impose any restriction on the build tool chosen for the hosting project. Intel(R) Software Guard Extensions Eclipse* Plug-in uses its own build configurations which do not interfere with the configurations that you might have in your project.</p>
<p>When Intel(R) SGX configurations are selected, by default only code under <code>&lt;root&gt;/sgx</code> directory get built.</p>
<p>You can customize Intel(R) SGX configurations as any other Eclipse build configurations from the project properties dialog. For example:</p>
<ol>
<li>Right-click in Project Explorer Properties → C/C++ Build</li>
<li>Uncheck the Use default build command checkbox.</li>
</ol>
<p>Then you can customize and integrate SGX build process. You can use Makefile instead of <code>sgx/Makefile</code> in the example shown in the following figure:</p>
<p>Then you can customize and integrate Intel(R) SGX build process. You can use Makefile instead of <code>sgx/Makefile</code> in the example shown in the following figure:</p>
<p>
<img src="Resources/Images/Customization_of_SGX_build_command.png" />
</p>
<p class="figcap">Customization of SGX Build Command </p>
<p class="figcap">Customization of Intel(R) SGX Build Command </p>
<p>The build process is done using standard Eclipse interface for build, by example from the main <b>Project</b> menu: </p>
<p>
<img src="Resources/Images/Project_Menu.png" />

View File

@ -24,22 +24,22 @@
<topic label='Configuring Intel(R) SGX Plug-in' href='html/content.html#Configuring_Intel_Software_Guard_Extensions_Eclipse_Plug-in' />
</topic>
<topic label='Command Reference' href='html/content.html#Command_Reference'>
<topic label='Adding SGX Nature to a Project' href='html/content.html#Adding_SGX_Nature_to_a_Project'>
<topic label='Adding SGX Nature to a non-SGX project' href='html/content.html#Adding_SGX_Nature_to_a_non_SGX_project' />
<topic label='Creating a New C/C++ Project with SGX Nature' href='html/content.html#Creating_a_New_C_C_Project_with_SGX_Nature' />
<topic label='Adding Intel(R) SGX Nature to a Project' href='html/content.html#Adding_SGX_Nature_to_a_Project'>
<topic label='Adding Intel(R) SGX Nature to a non-SGX project' href='html/content.html#Adding_SGX_Nature_to_a_non_SGX_project' />
<topic label='Creating a New C/C++ Project with Intel(R) SGX Nature' href='html/content.html#Creating_a_New_C_C_Project_with_SGX_Nature' />
</topic>
<topic label='Adding an SGX Enclave' href='html/content.html#Adding_an_SGX_Enclave' />
<topic label='Adding an SGX Trusted Library' href='html/content.html#Adding_an_SGX_Trusted_Library' />
<topic label='Adding an SGX Untrusted Module' href='html/content.html#Adding_an_SGX_Untrusted_Module' />
<topic label='Updating SGX Enclave Signing Key' href='html/content.html#Updating_SGX_Enclave_Signing_Key' />
<topic label='Adding an Intel(R) SGX Enclave' href='html/content.html#Adding_an_SGX_Enclave' />
<topic label='Adding an Intel(R) SGX Trusted Library' href='html/content.html#Adding_an_SGX_Trusted_Library' />
<topic label='Adding an Intel(R) SGX Untrusted Module' href='html/content.html#Adding_an_SGX_Untrusted_Module' />
<topic label='Updating Intel(R) SGX Enclave Signing Key' href='html/content.html#Updating_SGX_Enclave_Signing_Key' />
<topic label='Updating Enclave Configuration Files' href='html/content.html#Updating_Enclave_Configuration_Files' />
<topic label='Two Steps Sign Enclave' href='html/content.html#Two_Steps_Sign_Enclave'>
<topic label='Generate Hash' href='html/content.html#Generate_Hash' />
<topic label='Generate Signed Enclaves' href='html/content.html#Generate_Signed_Enclaves' />
</topic>
</topic>
<topic label='Building and Running SGX Code' href='html/content.html#Building_and_Running_SGX_Code'>
<topic label='SGX Build Configurations' href='html/content.html#SGX_Build_Configurations' />
<topic label='Building and Running Intel(R) SGX Code' href='html/content.html#Building_and_Running_SGX_Code'>
<topic label='Intel(R) SGX Build Configurations' href='html/content.html#SGX_Build_Configurations' />
<topic label='Running Samples Generated for Enclaves' href='html/content.html#Running_Samples_Generated_for_Enclaves' />
</topic>
</toc>

View File

@ -12,20 +12,20 @@
<!-- -->
<?eclipse version="3.4"?>
<plugin>
<extension id="com.intel.sgx.sgxbuilderdefinitions" name="Software Guard Extensions Builder Definition"
<extension id="com.intel.sgx.sgxbuilderdefinitions" name="Intel(R) Software Guard Extensions Builder Definition"
point="org.eclipse.cdt.managedbuilder.core.buildDefinitions">
<toolChain configurationEnvironmentSupplier="com.linux.ide.eclipse.ndk.internal.build.NdkEnvSupplier"
id="com.intel.sgx.SGXtoolChain" isAbstract="false" name="SGX GCC"
id="com.intel.sgx.SGXtoolChain" isAbstract="false" name="Intel(R) SGX"
supportsManagedBuild="false">
<builder cleanBuildTarget="clean" command="make"
commandLauncher="com.intel.sgx.build.SGXSDKCommandLauncher" id="com.intel.sgx.sgxbuilder"
isAbstract="false" isVariableCaseSensitive="false"
name="Software Guard Extensions Linux Builder">
name="Intel(R) Software Guard Extensions Linux Builder">
</builder>
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF"
id="com.intel.sgx.targetEnclave" isAbstract="false">
</targetPlatform>
<tool id="com.intel.sgx.compiler" isAbstract="false" name="SGX GCC Compiler"
<tool id="com.intel.sgx.compiler" isAbstract="false" name="Intel(R) SGX"
natureFilter="both">
<option browseType="directory" id="com.intel.sgx.option.includePath"
isAbstract="false" resourceFilter="all" valueType="includePath">
@ -39,97 +39,97 @@
<configuration id="com.intel.sgx.configuration.Sim.Debug" name="SGX Simulation Debug">
<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
<toolChain id="com.intel.sgx.toolChain.Sim.Debug" isAbstract="false"
name="SGX GCC" superClass="com.intel.sgx.SGXtoolChain">
name="Intel(R) SGX" superClass="com.intel.sgx.SGXtoolChain">
<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f sgx/Makefile" command="make"
id="com.intel.sgx.builder2" isAbstract="false"
isVariableCaseSensitive="false" name="Software Guard Extensions Linux Builder"
isVariableCaseSensitive="false" name="Intel(R) Software Guard Extensions Linux Builder"
superClass="com.intel.sgx.sgxbuilder">
</builder>
</toolChain>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Debug" name="SGX Hardware Debug">
<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
<toolChain id="com.intel.sgx.toolChain.HW.Debug" isAbstract="false"
name="SGX GCC" superClass="com.intel.sgx.SGXtoolChain">
name="Intel(R) SGX" superClass="com.intel.sgx.SGXtoolChain">
<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f sgx/Makefile" command="make"
id="com.intel.sgx.builder1" isAbstract="false"
isVariableCaseSensitive="false" name="Software Guard Extensions Linux Builder"
isVariableCaseSensitive="false" name="Intel(R) Software Guard Extensions Linux Builder"
superClass="com.intel.sgx.sgxbuilder">
</builder>
</toolChain>
</configuration>
<configuration id="com.intel.sgx.configuration.Sim.Release" name="SGX Simulation">
<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
<toolChain id="com.intel.sgx.toolChain.Sim.Release" isAbstract="false"
name="SGX GCC" superClass="com.intel.sgx.SGXtoolChain">
name="Intel(R) SGX" superClass="com.intel.sgx.SGXtoolChain">
<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f sgx/Makefile" command="make"
id="com.intel.sgx.builder3" isAbstract="false"
isVariableCaseSensitive="false" name="Software Guard Extensions Linux Builder"
isVariableCaseSensitive="false" name="Intel(R) Software Guard Extensions Linux Builder"
superClass="com.intel.sgx.sgxbuilder">
</builder>
</toolChain>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Hardware Prerelease">
<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
<toolChain id="com.intel.sgx.toolChain.HW.Prerelease" isAbstract="false"
name="SGX GCC" superClass="com.intel.sgx.SGXtoolChain">
name="Intel(R) SGX" superClass="com.intel.sgx.SGXtoolChain">
<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f sgx/Makefile" command="make"
id="com.intel.sgx.builder5" isAbstract="false"
isVariableCaseSensitive="false" name="Software Guard Extensions Linux Builder"
isVariableCaseSensitive="false" name="Intel(R) Software Guard Extensions Linux Builder"
superClass="com.intel.sgx.sgxbuilder">
</builder>
</toolChain>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Release" name="SGX Hardware Release">
<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
<toolChain id="com.intel.sgx.toolChain.HW.Release" isAbstract="false"
name="SGX GCC" superClass="com.intel.sgx.SGXtoolChain">
name="Intel(R) SGX" superClass="com.intel.sgx.SGXtoolChain">
<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f sgx/Makefile" command="make"
id="com.intel.sgx.builder6" isAbstract="false"
isVariableCaseSensitive="false" name="Software Guard Extensions Linux Builder"
isVariableCaseSensitive="false" name="Intel(R) Software Guard Extensions Linux Builder"
superClass="com.intel.sgx.sgxbuilder">
</builder>
</toolChain>
</configuration>
</extension>
<extension id="com.intel.sgx.SGXPerProjectProfile" name="SGX Per Project Profile"
<extension id="com.intel.sgx.SGXPerProjectProfile" name="Intel(R) SGX Per Project Profile"
point="org.eclipse.cdt.make.core.ScannerConfigurationDiscoveryProfile">
<scannerInfoCollector
class="com.intel.sgx.discovery.SGXSDKScannerInfoCollector" scope="project">
</scannerInfoCollector>
</extension>
<extension id="com.intel.sgx.commands" name="SGX Commands"
<extension id="com.intel.sgx.commands" name="Intel(R) SGX Commands"
point="org.eclipse.ui.commands">
<category id="com.intel.sgx.category.enclaveIF" name="SGX Untrusted Enclave Interface">
<category id="com.intel.sgx.category.enclaveIF" name="Intel(R) SGX Untrusted Enclave Interface">
</category>
<category id="com.intel.sgx.category.trustedIF" name="SGX Trusted Enclave Interface">
<category id="com.intel.sgx.category.trustedIF" name="Intel(R) SGX Trusted Enclave Interface">
</category>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.addEnclave"
name="Add SGX Enclave">
name="Add Intel(R) SGX Enclave">
<commandParameter id="com.intel.sgx.commandParameter3"
name="name" optional="true">
</commandParameter>
</command>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.addTrustedStaticLib"
name="Add SGX Trusted Static Library">
name="Add Intel(R) SGX Trusted Static Library">
<commandParameter id="com.intel.sgx.commandParameter3"
name="name" optional="true">
</commandParameter>
</command>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.removeEnclave"
name="Remove SGX Enclave">
name="Remove Intel(R) SGX Enclave">
</command>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.addUntrustedModule"
name="Add SGX Untrusted Module">
name="Add Intel(R) SGX Untrusted Module">
</command>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.addSGXNature"
name="Add SGX Nature">
name="Add Intel(R) SGX Nature">
</command>
<command categoryId="com.intel.sgx.category.enclaveIF" id="com.intel.sgx.command.updateSigningKey"
name="Update SGX Enclave Signing Key">
name="Update Intel(R) SGX Enclave Signing Key">
</command>
<command categoryId="com.intel.sgx.category.enclaveIF"
id="com.intel.sgx.command.enclaveConfigHandler" name="Update Config">
@ -144,7 +144,7 @@
<extension point="org.eclipse.ui.menus">
<menuContribution allPopups="false"
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<menu label="Software Guard Extension Tools">
<menu label="Intel(R) Software Guard Extensions Tools">
<visibleWhen checkEnabled="false">
<with variable="selection">
<test property="com.intel.sgx.testers.sgxNatureAdded"
@ -281,7 +281,7 @@
</menu>
</menu>
<menu label="Software Guard Extension Options">
<menu label="Intel(R) Software Guard Extensions Options">
<visibleWhen checkEnabled="false">
<with variable="selection">
<iterate ifEmpty="false" operator="or">
@ -367,7 +367,7 @@
</extension>
<extension point="org.eclipse.ui.preferencePages">
<page class="com.intel.sgx.preferences.SGXPreferencePage" id="com.intel.sgx.preferences.SGXPreferencePage"
name="SGX Preferences">
name="Intel(R) SGX Preferences">
</page>
</extension>
<extension point="org.eclipse.core.runtime.preferences">
@ -677,7 +677,7 @@
<template id="com.intel.sgx.AddSGXNature" location="templates/SGXtemplates/common/addnaturetemplate.xml"
projectType="Software Guard Extensions Project">
projectType="Intel(R) Software Guard Extensions Project">
</template>
<template id="com.intel.sgx.SGXEnclaveConfig" location="templates/SGXtemplates/configtemplate.xml"
@ -715,19 +715,19 @@
natures="org.eclipse.cdt.core.cnature">
</provider>
</extension>
<extension id="sgxnature" name="SGX Nature"
<extension id="sgxnature" name="Intel(R) SGX Nature"
point="org.eclipse.core.resources.natures">
<runtime>
<run class="com.intel.sgx.natures.SGXNature" />
</runtime>
</extension>
<extension id="sgxccnature" name="SGX CCNature"
<extension id="sgxccnature" name="Intel(R) SGX CCNature"
point="org.eclipse.core.resources.natures">
<runtime>
<run class="com.intel.sgx.natures.SGXCCNature" />
</runtime>
</extension>
<extension id="sgxstaticccnature" name="SGX StaticCCNature"
<extension id="sgxstaticccnature" name="Intel(R) SGX StaticCCNature"
point="org.eclipse.core.resources.natures">
<runtime>
<run class="com.intel.sgx.natures.SGXStaticCCNature" />
@ -748,7 +748,7 @@
<category
id = "com.intel.sgx.wizzards"
name="C/C++ projects with SGX Enabled">
name="C/C++ projects with Intel(R) SGX Enabled">
</category>
<wizard
@ -762,7 +762,7 @@ name="C/C++ projects with SGX Enabled">
name="C Project"
project="true">
<description>
An C project, with SGX Commands and Configurations
An C project, with Intel(R) SGX Commands and Configurations
</description>
</wizard>
@ -777,7 +777,7 @@ name="C/C++ projects with SGX Enabled">
name="C++ Project"
project="true">
<description>
An C++ project, with SGX Commands and Configurations
An C++ project, with Intel(R) SGX Commands and Configurations
</description>
</wizard>

View File

@ -95,7 +95,7 @@ public class AddEnclaveFileDialog extends SGXDialogBase {
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Add New SGX Enclave Dialog");
newShell.setText("Add New Intel(R) SGX Enclave Dialog");
newShell.layout();
}

View File

@ -79,7 +79,7 @@ public class AddTrustedStaticLibFileDialog extends SGXDialogBase {
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Add New SGX Static Trusted Library Dialog");
newShell.setText("Add New Intel(R) SGX Static Trusted Library Dialog");
}
@Override

View File

@ -112,7 +112,7 @@ public class AddUntrustedModuleDialog extends Dialog {
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText("Add SGX Untrusted Module.");
newShell.setText("Add Intel(R) SGX Untrusted Module.");
}
@Override

View File

@ -82,7 +82,7 @@ public abstract class TwoStepSignHandlerBase extends SGXHandler {
void initializeSigntool() throws ErrorException {
signtool = PreferenceConstants.getSDKDescriptor().getSignerPath();
if (!signtool.exists() || signtool.isDirectory()) {
quitWithError("Error generating hash! Sign Tool Not Found !\n Please make sure to have written in the box the value for SGX SDK Directory in Window->Preferences->SGX Preferences. \n Usually the path is in /opt/intel/sgxsdk/" );
quitWithError("Error generating hash! Sign Tool Not Found !\n Please make sure to have written in the box the value for Intel(R) SGX SDK Directory in Window->Preferences->Intel(R) SGX Preferences. \n Usually the path is in /opt/intel/sgxsdk/" );
}
}

View File

@ -65,7 +65,7 @@ public class UpdateSigningKey extends SGXHandler {
IPath destFile = Path.fromOSString(destinationKeyFile);
copyFile(sourceFile.toFile(), destFile.toFile());
refreshProject();
info("Update SGX Enclave Signing Key","copied \n'" + sourceKeyFile + "' into \n'" + destFile + "'");
info("Update Intel(R) SGX Enclave Signing Key","copied \n'" + sourceKeyFile + "' into \n'" + destFile + "'");
} else {
UpdateSignKeyDialog.regenerate = false;
try {
@ -84,7 +84,7 @@ public class UpdateSigningKey extends SGXHandler {
}
project.refreshLocal(IResource.DEPTH_INFINITE, null);
if (q.exitValue() == 0){
info("Update SGX Enclave Signing Key","'"+destinationKeyFile+"'"+" was generated!");
info("Update Intel(R) SGX Enclave Signing Key","'"+destinationKeyFile+"'"+" was generated!");
} else {
quitWithError("Could not generate '"+destinationKeyFile+"'!!!");
}

View File

@ -46,7 +46,7 @@ public class SGXPreferencePage
public SGXPreferencePage() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore());
setDescription("SGX Preferences");
setDescription("Intel(R) SGX Preferences");
}
/**
@ -59,12 +59,12 @@ public class SGXPreferencePage
@Override
protected void createFieldEditors() {
sgxSdkDirectoryEditor = new SGXSdkDirectoryFieldEditor(PreferenceConstants.SDK_PATH,
"&SGX SDK Directory:", getFieldEditorParent());
"&Intel(R) SGX SDK Directory:", getFieldEditorParent());
addField(sgxSdkDirectoryEditor);
}
/*
* Validates whether the path entered in the SGX SDK Preferences points to the SGX SDK or not.
* Validates whether the path entered in the Intel(R) SGX SDK Preferences points to the Intel(R) SGX SDK or not.
*/
private static class SGXSdkDirectoryFieldEditor extends DirectoryFieldEditor {
public SGXSdkDirectoryFieldEditor(String name, String labelText, Composite parent) {
@ -75,13 +75,13 @@ public class SGXPreferencePage
@Override
protected boolean doCheckState() {
if (!super.doCheckState()) {
setErrorMessage("SGX Preferences: Not a Valid directory");
setErrorMessage("Intel(R) SGX Preferences: Not a Valid directory");
return false;
}
String dirname = getTextControl().getText().trim();
if (!dirname.isEmpty() && !SdkPathVariableProvider.isValidSGXSdkLocation(dirname)) {
setErrorMessage("SGX SDK: Not a Valid SGX SDK directory");
setErrorMessage("Intel(R) SGX SDK: Not a Valid SGX SDK directory");
return false;
}
return true;

View File

@ -12,34 +12,34 @@
SGX.author=Intel
#Add Nature template Values
SGX.naturetemplate.title.description=A Software Guard Extensions Project template.
SGX.naturetemplate.title.label=SGX Project
SGX.naturetemplate.title.description=A Intel Software Guard Extensions Project template.
SGX.naturetemplate.title.label=Intel SGX Project
SGX.naturetemplate.title.id=AddSGXNature
#Enclave Config template Values
SGX.enclaveconfig.template.title.description=A Software Guard Extensions Configuration template.
SGX.enclaveconfig.template.title.label=SGX Enclave Configuration
SGX.enclaveconfig.template.title.description=A Intel Software Guard Extensions Configuration template.
SGX.enclaveconfig.template.title.label=Intel SGX Enclave Configuration
SGX.enclaveconfig.template.title.id=SGXEnclaveConfig
#Untrusted Module template values
SGX.untrustedModule.template.title.description= A Software Guard Extensions Untrusted Module template.
SGX.untrustedModule.template.title.label=SGX Untrusted Module
SGX.untrustedModule.template.title.description= A Intel Software Guard Extensions Untrusted Module template.
SGX.untrustedModule.template.title.label=Intel SGX Untrusted Module
#Enclave template values
SGX.enclave.template.title.description= A Software Guard Extensions Project template.
SGX.enclave.template.title.label=SGX Project
SGX.enclave.template.title.description= A Intel Software Guard Extensions Project template.
SGX.enclave.template.title.label=Intel SGX Project
SGX.enclave.template.title.id=SGXProject
#C template Values
SGX.Ctemplate.title.description=A Software Guard Extensions C Enclave Project template.
SGX.Ctemplate.title.label=SGX C Enclave Project
SGX.Ctemplate.title.description=A Intel Software Guard Extensions C Enclave Project template.
SGX.Ctemplate.title.label=Intel SGX C Enclave Project
SGX.Ctemplate.title.id=SGXCProject
SGX.Ctemplate.enclaveSettings.label=Enclave Settings
SGX.Ctemplate.enclaveSettings.description=Initial settings required for a new enclave.
#C Static lib template Values
SGX.CStatictemplate.title.description=A Software Guard Extensions C Enclave Project template.
SGX.CStatictemplate.title.label=SGX C Enclave Library Project
SGX.CStatictemplate.title.description=A Intel Software Guard Extensions C Enclave Project template.
SGX.CStatictemplate.title.label=Intel SGX C Enclave Library Project
SGX.CStatictemplate.title.id=SGXCEnclaveLibProject
SGX.CStatictemplate.enclaveSettings.label=Enclave Settings
SGX.CStatictemplate.enclaveSettings.description=Initial settings required for a new enclave Library.
@ -47,15 +47,15 @@
SGX.CStatictemplate.requiresEdl.description=De-select this option to create an Non-SGX trusted static library without an Edl file. By default, the project creates an Enclave library with an Edl file.
#CXX template Values
SGX.CXXtemplate.title.description=A Software Guard Extensions C++ Enclave Project template.
SGX.CXXtemplate.title.label=C/C++ Project with SGX Nature
SGX.CXXtemplate.title.description=A Intel Software Guard Extensions C++ Enclave Project template.
SGX.CXXtemplate.title.label=C/C++ Project with Intel SGX Nature
SGX.CXXtemplate.title.id=SGXCPPProject
SGX.CXXtemplate.enclaveSettings.label=Enclave Settings
SGX.CXXtemplate.enclaveSettings.description=Initial settings required for a new enclave.
#CXX Static lib template Values
SGX.CXXStatictemplate.title.description=A Software Guard Extensions C++ Enclave Library Project template.
SGX.CXXStatictemplate.title.label=SGX C++ Enclave Library Project
SGX.CXXStatictemplate.title.description=A Intel Software Guard Extensions C++ Enclave Library Project template.
SGX.CXXStatictemplate.title.label=Intel SGX C++ Enclave Library Project
SGX.CXXStatictemplate.title.id=SGXCPPEnclaveLibProject
SGX.CXXStatictemplate.enclaveSettings.label=Enclave Settings
SGX.CXXStatictemplate.enclaveSettings.description=Initial settings required for a new enclave Library.

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64
@ -45,7 +45,7 @@ Crypto_Library_Name := sgx_tcrypto
$(EnclaveName)_Cpp_Files := trusted/$(enclaveName).cpp
$(EnclaveName)_C_Files :=
$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
@ -57,7 +57,7 @@ $(EnclaveName)_Cpp_Flags := $($(EnclaveName)_Cpp_Flags) -fno-builtin-printf
$(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64
@ -44,7 +44,7 @@ endif
Crypto_Library_Name := sgx_tcrypto
$(EnclaveName)_C_Files := trusted/$(enclaveName).c
$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
$(EnclaveName)_Include_Paths := -IInclude -Itrusted -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@ -52,7 +52,7 @@ $(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags)
$(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -69,8 +69,8 @@ static sgx_errlist_t sgx_errlist[] = {
},
{
SGX_ERROR_NO_DEVICE,
"Invalid SGX device.",
"Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards."
"Invalid Intel(R) SGX device.",
"Please make sure Intel(R) SGX module is enabled in the BIOS, and install Intel(R) SGX driver afterwards."
},
{
SGX_ERROR_MEMORY_MAP_CONFLICT,
@ -84,7 +84,7 @@ static sgx_errlist_t sgx_errlist[] = {
},
{
SGX_ERROR_DEVICE_BUSY,
"SGX device was busy.",
"Intel(R) SGX device was busy.",
NULL
},
{

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64
@ -45,7 +45,7 @@ Crypto_Library_Name := sgx_tcrypto
$(EnclaveName)_Cpp_Files := static_trusted/$(enclaveName).cpp
$(EnclaveName)_C_Files :=
$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@ -56,7 +56,7 @@ $(EnclaveName)_Cpp_Flags := $($(EnclaveName)_Cpp_Flags) -fno-builtin-printf
$(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64
@ -44,7 +44,7 @@ endif
Crypto_Library_Name := sgx_tcrypto
$(EnclaveName)_C_Files := static_trusted/$(enclaveName).c
$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/stlport
$(EnclaveName)_Include_Paths := -IInclude -I$(EnclaveName) -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
Flags_Just_For_C := -Wno-implicit-function-declaration -std=c11
Common_C_Cpp_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $($(EnclaveName)_Include_Paths) -fno-builtin-printf -I.
@ -52,7 +52,7 @@ $(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags)
$(EnclaveName)_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tstdcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -1,4 +1,4 @@
######## SGX SDK Settings ########
######## Intel(R) SGX SDK Settings ########
SGX_SDK ?= $(SdkPathFromPlugin)
SGX_MODE ?= SIM
SGX_ARCH ?= x64

View File

@ -11,13 +11,13 @@
<!-- Intel Corporation - initial implementation and documentation -->
<!-- -->
<site>
<description name="Software Guard Extensions Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx">
<description name="Intel(R) Software Guard Extensions Plug-in" url="http://fso-dev-machine.rd.intel.com/sgx">
This website hosts an evaluation version of the Eclipse Plug-in developed for Secure Guard Extensions Application development for Linux platforms.
</description>
<feature url="features/com.intel.sgx.feature_1.0.1.qualifier.jar" id="com.intel.sgx.feature" version="1.0.1.qualifier">
<category name="com.intel.security.sgx"/>
</feature>
<category-def name="com.intel.security.sgx" label="SGX Eclipse Plugin">
<description>SGX Eclipse Plugin 1.0.1.qualifier</description>
<category-def name="com.intel.security.sgx" label="Intel(R) SGX Eclipse Plugin">
<description>Intel(R) SGX Eclipse Plugin 1.0.1.qualifier</description>
</category-def>
</site>

View File

@ -12,7 +12,7 @@ The following plugins are pre-requisites to be installed in Eclipse before tryin
run ./build.sh from command line under current directory.
Once the build script is run, the folder build_directory/updatesite/sgx-eclipse-plugin contains the update site. This is the path that needs to be provided to the eclipse while doing installation.
If the sgx eclipse plugin is already installed to eclipse and to build and install a newer version, uninstall the old version and start eclipse with the -clean option.
If the Intel(R) Software Guard Extensions (Intel(R) SGX) eclipse plugin is already installed to eclipse and to build and install a newer version, uninstall the old version and start eclipse with the -clean option.
Then try to build the new version of the plugin and install it in eclipse.
http://wiki.eclipse.org/FAQ_How_do_I_remove_a_plug-in%3F

View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
# Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -52,6 +52,12 @@ clean:
@$(MAKE) -C psw/ clean
@$(RM) -r $(ROOT_DIR)/build
@$(RM) -r linux/installer/bin/sgx_linux*.bin
@$(RM) -rf linux/installer/common/psw/output
@$(RM) -rf linux/installer/common/psw/gen_source.py
@$(RM) -rf linux/installer/common/sdk/output
@$(RM) -rf linux/installer/common/sdk/pkgconfig/x64
@$(RM) -rf linux/installer/common/sdk/pkgconfig/x86
@$(RM) -rf linux/installer/common/sdk/gen_source.py
rebuild:
$(MAKE) clean

View File

@ -7,63 +7,77 @@ Introduction
------------
Intel(R) Software Guard Extensions (Intel(R) SGX) is an Intel technology for application developers seeking to protect select code and data from disclosure or modification.
The Linux SGX software stack is comprised of the SGX driver, the SGX SDK, and the SGX Platform Software. The SGX SDK and SGX PSW are hosted in the [linux-sgx](https://github.com/01org/linux-sgx) project.
The Linux\* Intel(R) SGX software stack is comprised of the Intel(R) SGX driver, the Intel(R) SGX SDK, and the Intel(R) SGX Platform Software (PSW). The Intel(R) SGX SDK and Intel(R) SGX PSW are hosted in the [linux-sgx](https://github.com/01org/linux-sgx) project.
The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux SGX software stack, which will be used until the driver upstreaming process is complete.
The [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project hosts the out-of-tree driver for the Linux\* Intel(R) SGX software stack, which will be used until the driver upstreaming process is complete.
**Note** This repository includes a subset of the Intel(R) Integrated Performance Primitives (IPP) Cryptography library under [external/crypto_px](external/crypto_px). It is provided as reference implementation for the cryptographic primitives used in SDK and PSW. The primitives are written in pure C and are not optimized for performance. Instructions are provided below for building the SDK and PSW with both precompiled optimized IPP binaries and the non-optimized source code version.
License
-------
See License.txt for details.
See [License.txt](License.txt) for details.
Contributing
-------
See CONTRIBUTING.md for details.
See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
Documentation
-------------
- [Intel(R) SGX for Linux\* OS][1] project home page on [01.org](https://01.org)
- [Intel(R) SGX Programming Reference][2]
[1]: https://01.org/intel-softwareguard-extensions
[2]: https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf
- [Intel(R) SGX for Linux\* OS](https://01.org/intel-softwareguard-extensions) project home page on [01.org](https://01.org)
- [Intel(R) SGX Programming Reference](https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf)
Build and Install the Intel(R) SGX Driver
-----------------------------------------
Follow the instructions in the [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project to build and install the SGX driver.
Follow the instructions in the [linux-sgx-driver](https://github.com/01org/linux-sgx-driver) project to build and install the Intel(R) SGX driver.
Build the Intel(R) SGX SDK and Intel(R) SGX PSW Package
-------------------------------------------------------
###Prerequisites:
- Ensure that you have the following required operating systems:
Ubuntu\* Desktop-14.04-LTS 64bits
- Use the following command to install the required tools to build Intel(R) SGX SDK:
```
$ sudo apt-get install build-essential ocaml automake autoconf libtool
```
- Use the following command to install additional required tools to build Intel(R) SGX PSW:
```
$ sudo apt-get install libcurl4-openssl-dev protobuf-compiler protobuf-c-compiler libprotobuf-dev libprotobuf-c0-dev
```
### Prerequisites:
- Ensure that you have one of the following required operating systems:
* Ubuntu\* Desktop-16.04-LTS 64bits
* Red Hat Enterprise Linux Server release 7.3 64bits
* CentOS 7.3.1611 64bits
- Use the following command(s) to install the required tools to build the Intel(R) SGX SDK:
* On Ubuntu 16.04:
```
$ sudo apt-get install build-essential ocaml automake autoconf libtool wget python
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum groupinstall 'Development Tools'
$ sudo yum install ocaml wget python
```
- Use the following command to install additional required tools to build the Intel(R) SGX PSW:
* On Ubuntu 16.04:
```
$ sudo apt-get install libssl-dev libcurl4-openssl-dev protobuf-compiler libprotobuf-dev
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum install openssl-devel libcurl-devel protobuf-compiler protobuf-devel
```
- Use the script ``download_prebuilt.sh`` inside source code package to download prebuilt binaries to prebuilt folder
You may need set https proxy for wget tool used by the script (such as ``export https_proxy=http://test-proxy:test-port``)
You may need set an https proxy for the `wget` tool used by the script (such as ``export https_proxy=http://test-proxy:test-port``)
```
$ ./download_prebuilt.sh
```
###Build the Intel(R) SGX SDK and Intel(R) SGX PSW
The following steps describe how to build the Intel SGX SDK and PSW. You can build the project according to your requirement.
- To build both Intel SGX SDK and PSW with default configuration, enter the following command:
You can find the tools and libraries generated in the `build/linux` directory.
**Note**: You can also go to the sdk folder and use the `make` command to build the Intel SGX SDK component only. However, the building of PSW component is dependent on the building result of Intel SGX SDK.
### Build the Intel(R) SGX SDK and Intel(R) SGX PSW
The following steps describe how to build the Intel(R) SGX SDK and PSW. You can build the project according to your requirements.
- To build both Intel(R) SGX SDK and PSW with default configuration, enter the following command:
```
$ make
```
You can find the tools and libraries generated in the `build/linux` directory.
**Note**: You can also go to the `sdk` folder and use the `make` command to build the Intel(R) SGX SDK component only. However, building the PSW component is dependent on the result of building the Intel(R) SGX SDK.
- The default build uses precompiled optimized libraries which have been downloaded by the script ``./download_prebuilt.sh``.
- The default build uses precompiled optimized libraries, which are downloaded by the script ``./download_prebuilt.sh``.
You can also use the non-optimized source code version implementation instead by entering the following command:
```
$ make USE_OPT_LIBS=0
```
- To build Intel SGX SDK and PSW with debug information, enter the following command:
- To build Intel(R) SGX SDK and PSW with debug information, enter the following command:
```
$ make DEBUG=1
```
@ -72,108 +86,144 @@ The following steps describe how to build the Intel SGX SDK and PSW. You can bui
$ make clean
```
- The build above uses prebuilt Intel(R) Architecture Enclaves(LE/PvE/QE/PCE) - the files ``psw/ae/data/prebuilt/libsgx_*.signed.so``, which have been signed by Intel in advance.
To build those binaries by yourself (without a signature), first you need to build both Intel SGX SDK and PSW with the default configuration. After that, you can build each Architecture Enclave by using the `make` command from the corresponding folder:
- The build above uses prebuilt Intel(R) Architecture Enclaves(LE/PvE/QE/PCE/PSE-OP/PSE-PR) and applet(PSDA) - the files ``psw/ae/data/prebuilt/libsgx_*.signed.so`` and ``psw/ae/data/prebuilt/PSDA.dalp``, which have been signed by Intel in advance.
To build those enclaves by yourself (without a signature), first you need to build both Intel(R) SGX SDK and PSW with the default configuration. After that, you can build each Architecture Enclave by using the `make` command from the corresponding folder:
```
$ cd psw/ae/le
$ make
```
###Build Intel(R) SGX SDK Installer
To build Intel(R) SGX SDK installer, enter the following command:
### Build the Intel(R) SGX SDK Installer
To build the Intel(R) SGX SDK installer, enter the following command:
```
$ make sdk_install_pkg
```
You can find the generated Intel SGX SDK installer ``sgx_linux_x64_sdk_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
You could also make an SGX SDK installer with non-optimized source code for crypto library by
You can find the generated Intel(R) SGX SDK installer ``sgx_linux_x64_sdk_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
**Note**: The above command builds the Intel(R) SGX SDK with default configuration firstly and then generates the target SDK Installer. To build the Intel(R) SGX SDK Installer with debug information kept in the tools and libraries, enter the following command:
```
$ make sdk_install_pkg USE_OPT_LIBS=0
$ make sdk_install_pkg DEBUG=1
```
###Build Intel(R) SGX PSW Installer
To build Intel(R) SGX PSW installer, enter the following command:
### Build the Intel(R) SGX PSW Installer
To build the Intel(R) SGX PSW installer, enter the following command:
```
$ make psw_install_pkg
```
You can find the generated Intel SGX PSW installer ``sgx_linux_x64_psw_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
You could also make an SGX PSW intaller with non-optimized source code for crypto library by
You can find the generated Intel(R) SGX PSW installer ``sgx_linux_x64_psw_${version}.bin`` located under `linux/installer/bin/`, where `${version}` refers to the version number.
**Note**: The above command builds the Intel(R) SGX SDK and PSW with default configuration firstly and then generates the target PSW Installer. To build the Intel(R) SGX PSW Installer with debug information kept in the tools and libraries, enter the following command:
```
$ make psw_install_pkg USE_OPT_LIBS=0
```
Install Intel(R) SGX SDK
------------------------
###Prerequisites
- Ensure that you have the following required operating systems:
Ubuntu\* Desktop-14.04-LTS 64bits
- Use the following command to install the required tool to use Intel(R) SGX SDK:
```
$ sudo apt-get install build-essential
$ make psw_install_pkg DEBUG=1
```
###Install Intel(R) SGX SDK
To install Intel(R) SGX SDK, execute the installer with root privilege:
Install the Intel(R) SGX SDK
------------------------
### Prerequisites
- Ensure that you have one of the following operating systems:
* Ubuntu\* Desktop-16.04-LTS 64bits
* Red Hat Enterprise Linux Server release 7.3 64bits
* CentOS 7.3.1611 64bits
- Use the following command to install the required tool to use Intel(R) SGX SDK:
* On Ubuntu 16.04:
```
$ sudo apt-get install build-essential python
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum groupinstall 'Development Tools'
$ sudo yum install python
```
### Install the Intel(R) SGX SDK
To install the Intel(R) SGX SDK, invoke the installer, as follows:
```
$ cd linux/installer/bin
$ sudo ./sgx_linux_x64_sdk_${version}.bin
$ ./sgx_linux_x64_sdk_${version}.bin
```
###Test Intel(R) SGX SDK Package with the Sample Codes
- Copy the sample codes installed by Intel(R) SGX SDK package into your work folder, such as
### Test the Intel(R) SGX SDK Package with the Code Samples
- Compile and run each code sample in Simulation mode to make sure the package works well:
```
$ cp -r /opt/intel/sgxsdk/SampleCode ~
$ cd SampleCode/LocalAttestation
$ make SGX_MODE=SIM
$ ./app
```
- Compile and run each sample codes in the simulation mode to make sure the package works well.
Use similar commands for other sample codes.
### Compile and Run the Code Samples in the Hardware Mode
If you use an Intel SGX hardware enabled machine, you can run the code samples in Hardware mode.
Ensure that you install Intel(R) SGX driver and Intel(R) SGX PSW installer on the machine.
See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on how to install the Intel(R) SGX driver.
See the later topic, *Install Intel(R) SGX PSW*, for information on how to install the PSW package.
- Compile and run each code sample in Hardware mode, debug build, as follows:
```
$ cd SampleCode/LocalAttestation
$ make
$ ./app
```
Use similar commands for other sample codes.
Use similar commands for other code samples.
###Compile and Run the Sample Codes in the Hardware Mode
If you use an SGX hardware enabled machine, you need to run the sample codes in the hardware mode.
Ensure that you install SGX driver and Intel(R) SGX PSW installer on the machine.
See the topic, Install Intel(R) SGX PSW, on how to install the PSW package.
- Copy the sample codes installed by the Intel(R) SGX SDK package into your work folder, such as
```
$ cp -r /opt/intel/sgxsdk/SampleCode ~
```
- Compile and run each sample codes in the debug mode.
```
$ cd SampleCode/LocalAttestation
$ make SGX_MODE=HW SGX_DEBUG=1
$ ./app
```
Use similar commands for other sample codes.
Install Intel(R) SGX PSW
Install the Intel(R) SGX PSW
------------------------
###Prerequisites
- Ensure that you have the following required operating systems:
Ubuntu\* Desktop-14.04-LTS 64bits
- Ensure that you have the following required hardware:
6th Generation Intel(R) Core(TM) Processor (code named Skylake)
- Configure the system with the **SGX hardware enabled** option and install SGX driver in advance.
See the topic, Build and Install the Intel(R) SGX Driver, on how to install the SGX driver.
### Prerequisites
- Ensure that you have one of the following operating systems:
* Ubuntu\* Desktop-16.04-LTS 64bits
* Red Hat Enterprise Linux Server release 7.3 64bits
* CentOS 7.3.1611 64bits
- Ensure that you have a system with the following required hardware:
* 6th Generation Intel(R) Core(TM) Processor or newer
- Configure the system with the **Intel SGX hardware enabled** option and install Intel(R) SGX driver in advance.
See the earlier topic, *Build and Install the Intel(R) SGX Driver*, for information on how to install the Intel(R) SGX driver.
- Install the library using the following command:
```
$ sudo apt-get install libcurl4-openssl-dev libprotobuf-dev libprotobuf-c0-dev
```
* On Ubuntu 16.04:
```
$ sudo apt-get install libssl-dev libcurl4-openssl-dev libprotobuf-dev
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum install openssl-devel libcurl-devel protobuf-devel
```
- To use Trusted Platform Service functions:
Ensure `mei_me` driver is enabled and `/dev/mei0` exists.
Download [iclsClient](https://software.intel.com/en-us/sgx-sdk/download) and install it using the following commands:
* On Ubuntu 16.04:
```
$ sudo apt-get install alien
$ sudo alien --scripts iclsClient-1.45.449.12-1.x86_64.rpm
$ sudo dpkg -i iclsclient_1.45.449.12-2_amd64.deb
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum install iclsClient-1.45.449.12-1.x86_64.rpm
```
Download source code from [dynamic-application-loader-host-interface](https://github.com/01org/dynamic-application-loader-host-interface) project. In the source code folder, build and install the `JHI` service using the following commands:
* On Ubuntu 16.04:
```
$ sudo apt-get install uuid-dev libxml2-dev cmake pkg-config
$ cmake .;make;sudo make install;sudo systemctl enable jhi
```
* On Red Hat Enterprise Linux 7.3 and CentOS 7.3:
```
$ sudo yum install libuuid-devel libxml2-devel cmake pkgconfig
$ cmake .;make;sudo make install;sudo ldconfig;sudo systemctl enable jhi
```
###Install Intel(R) SGX PSW
To install Intel(R) SGX PSW, execute the installer with root privilege:
### Install the Intel(R) SGX PSW
To install the Intel(R) SGX PSW, invoke the installer with root privilege:
```
$ cd linux/installer/bin
$ sudo ./sgx_linux_x64_psw_${version}.bin
```
###Start or Stop aesmd Service
The Intel(R) SGX PSW installer installs an aesmd service in your machine which is running in a special linux account aesmd.
### Start or Stop aesmd Service
The Intel(R) SGX PSW installer installs an aesmd service in your machine, which is running in a special linux account `aesmd`.
To stop the service: `$ sudo service aesmd stop`
To start the service: `$ sudo service aesmd start`
To restart the service: `$ sudo service aesmd restart`
###Configure the Proxy for aesmd Service
The aesmd service uses HTTP protocol to initialize some services.
If proxy is required for HTTP protocol, you may need manually setup the proxy for aesmd service.
You should manually edit file `/etc/aesmd.conf` (refer the comment in the file) to set the proxy for aesmd service.
### Configure the Proxy for aesmd Service
The aesmd service uses the HTTP protocol to initialize some services.
If a proxy is required for the HTTP protocol, you may need to manually set up the proxy for the aesmd service.
You should manually edit the file `/etc/aesmd.conf` (refer to the comments in the file) to set the proxy for the aesmd service.
After you configure the proxy, you need to restart the service to enable the proxy.

View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Release">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="Cxx11SGXDemo.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Intel(R) SGX Hardware Debug">
<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
</configuration>
<configuration configurationName="Intel(R) SGX Simulation Debug">
<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
</configuration>
<configuration configurationName="Intel(R) SGX Hardware Prerelease">
<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
</configuration>
<configuration configurationName="Intel(R) SGX Simulation">
<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
</configuration>
<configuration configurationName="Intel(R) SGX Hardware Release">
<resource resourceType="PROJECT" workspacePath="/Cxx11SGXDemo"/>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Cxx11SGXDemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>com.intel.sgx.sgxnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@ -0,0 +1,263 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
# include <unistd.h>
# include <pwd.h>
# define MAX_PATH FILENAME_MAX
#include "sgx_urts.h"
#include "sgx_uae_service.h"
#include "App.h"
#include "Enclave_u.h"
/* Global EID shared by multiple threads */
sgx_enclave_id_t global_eid = 0;
typedef struct _sgx_errlist_t {
sgx_status_t err;
const char *msg;
const char *sug; /* Suggestion */
} sgx_errlist_t;
/* Error code returned by sgx_create_enclave */
static sgx_errlist_t sgx_errlist[] = {
{
SGX_ERROR_UNEXPECTED,
"Unexpected error occurred.",
NULL
},
{
SGX_ERROR_INVALID_PARAMETER,
"Invalid parameter.",
NULL
},
{
SGX_ERROR_OUT_OF_MEMORY,
"Out of memory.",
NULL
},
{
SGX_ERROR_ENCLAVE_LOST,
"Power transition occurred.",
"Please refer to the sample \"PowerTransition\" for details."
},
{
SGX_ERROR_INVALID_ENCLAVE,
"Invalid enclave image.",
NULL
},
{
SGX_ERROR_INVALID_ENCLAVE_ID,
"Invalid enclave identification.",
NULL
},
{
SGX_ERROR_INVALID_SIGNATURE,
"Invalid enclave signature.",
NULL
},
{
SGX_ERROR_OUT_OF_EPC,
"Out of EPC memory.",
NULL
},
{
SGX_ERROR_NO_DEVICE,
"Invalid SGX device.",
"Please make sure SGX module is enabled in the BIOS, and install SGX driver afterwards."
},
{
SGX_ERROR_MEMORY_MAP_CONFLICT,
"Memory map conflicted.",
NULL
},
{
SGX_ERROR_INVALID_METADATA,
"Invalid enclave metadata.",
NULL
},
{
SGX_ERROR_DEVICE_BUSY,
"SGX device was busy.",
NULL
},
{
SGX_ERROR_INVALID_VERSION,
"Enclave version was invalid.",
NULL
},
{
SGX_ERROR_INVALID_ATTRIBUTE,
"Enclave was not authorized.",
NULL
},
{
SGX_ERROR_ENCLAVE_FILE_ACCESS,
"Can't open enclave file.",
NULL
},
{
SGX_ERROR_NDEBUG_ENCLAVE,
"The enclave is signed as product enclave, and can not be created as debuggable enclave.",
NULL
},
};
/* Check error conditions for loading enclave */
void print_error_message(sgx_status_t ret)
{
size_t idx = 0;
size_t ttl = sizeof sgx_errlist/sizeof sgx_errlist[0];
for (idx = 0; idx < ttl; idx++) {
if(ret == sgx_errlist[idx].err) {
if(NULL != sgx_errlist[idx].sug)
printf("Info: %s\n", sgx_errlist[idx].sug);
printf("Error: %s\n", sgx_errlist[idx].msg);
break;
}
}
if (idx == ttl)
printf("Error: Unexpected error occurred.\n");
}
/* Initialize the enclave:
* Step 1: try to retrieve the launch token saved by last transaction
* Step 2: call sgx_create_enclave to initialize an enclave instance
* Step 3: save the launch token if it is updated
*/
int initialize_enclave(void)
{
char token_path[MAX_PATH] = {'\0'};
sgx_launch_token_t token = {0};
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
int updated = 0;
/* Step 1: try to retrieve the launch token saved by last transaction
* if there is no token, then create a new one.
*/
/* try to get the token saved in $HOME */
const char *home_dir = getpwuid(getuid())->pw_dir;
if (home_dir != NULL &&
(strlen(home_dir)+strlen("/")+sizeof(TOKEN_FILENAME)+1) <= MAX_PATH) {
/* compose the token path */
strncpy(token_path, home_dir, strlen(home_dir));
strncat(token_path, "/", strlen("/"));
strncat(token_path, TOKEN_FILENAME, sizeof(TOKEN_FILENAME)+1);
} else {
/* if token path is too long or $HOME is NULL */
strncpy(token_path, TOKEN_FILENAME, sizeof(TOKEN_FILENAME));
}
FILE *fp = fopen(token_path, "rb");
if (fp == NULL && (fp = fopen(token_path, "wb")) == NULL) {
printf("Warning: Failed to create/open the launch token file \"%s\".\n", token_path);
}
if (fp != NULL) {
/* read the token from saved file */
size_t read_num = fread(token, 1, sizeof(sgx_launch_token_t), fp);
if (read_num != 0 && read_num != sizeof(sgx_launch_token_t)) {
/* if token is invalid, clear the buffer */
memset(&token, 0x0, sizeof(sgx_launch_token_t));
printf("Warning: Invalid launch token read from \"%s\".\n", token_path);
}
}
/* Step 2: call sgx_create_enclave to initialize an enclave instance */
/* Debug Support: set 2nd parameter to 1 */
ret = sgx_create_enclave(ENCLAVE_FILENAME, SGX_DEBUG_FLAG, &token, &updated, &global_eid, NULL);
if (ret != SGX_SUCCESS) {
print_error_message(ret);
if (fp != NULL) fclose(fp);
return -1;
}
/* Step 3: save the launch token if it is updated */
if (updated == FALSE || fp == NULL) {
/* if the token is not updated, or file handler is invalid, do not perform saving */
if (fp != NULL) fclose(fp);
return 0;
}
/* reopen the file with write capablity */
fp = freopen(token_path, "wb", fp);
if (fp == NULL) return 0;
size_t write_num = fwrite(token, 1, sizeof(sgx_launch_token_t), fp);
if (write_num != sizeof(sgx_launch_token_t))
printf("Warning: Failed to save launch token to \"%s\".\n", token_path);
fclose(fp);
return 0;
}
/* OCall functions */
void ocall_print_string(const char *str)
{
/* Proxy/Bridge will check the length and null-terminate
* the input string to prevent buffer overflow.
*/
printf("%s", str);
}
/* Application entry */
int SGX_CDECL main(int argc, char *argv[])
{
(void)(argc);
(void)(argv);
/* Initialize the enclave */
if(initialize_enclave() < 0){
printf("Enter a character before exit ...\n");
getchar();
return -1;
}
/* Utilize trusted libraries */
ecall_libcxx_functions();
/* Destroy the enclave */
sgx_destroy_enclave(global_eid);
printf("Info: Cxx11DemoEnclave successfully returned.\n");
//printf("Enter a character before exit ...\n");
//getchar();
return 0;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -28,30 +28,42 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <AEInternalServicesProvider.h>
#include <AEServicesImpl.h>
#ifndef _APP_H_
#define _APP_H_
#include <Config.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#ifndef CONFIG_SOCKET_PATH
#error "CONFIG_SOCKET_PATH is not defined"
#include "sgx_error.h" /* sgx_status_t */
#include "sgx_eid.h" /* sgx_enclave_id_t */
#ifndef TRUE
# define TRUE 1
#endif
#include <string>
#ifndef FALSE
# define FALSE 0
#endif
AEInternalServices* AEInternalServicesProvider::mProviderInstance = NULL;
#if defined(__GNUC__)
# define TOKEN_FILENAME "enclave.token"
# define ENCLAVE_FILENAME "enclave.signed.so"
#endif
AEInternalServicesProvider::AEInternalServicesProvider() { /* empty */ }
extern sgx_enclave_id_t global_eid; /* global enclave id */
AEInternalServices* AEInternalServicesProvider::GetInternalServicesProvider()
{
if (mProviderInstance)
return mProviderInstance;
#if defined(__cplusplus)
extern "C" {
#endif
const char *socketbase = CONFIG_SOCKET_PATH;
void ecall_libcxx_functions(void);
mProviderInstance = new AEServicesImpl(socketbase);
return mProviderInstance;
#if defined(__cplusplus)
}
#endif
#endif /* !_APP_H_ */

View File

@ -0,0 +1,212 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdio.h>
#include "../App.h"
#include "Enclave_u.h"
#include <thread>
/* ecall_libcxx_functions:
* Invokes standard C++11 functions.
*/
//This function is part of mutex demo
void demo_counter_without_mutex()
{
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
ret = ecall_mutex_demo_no_protection(global_eid);
if (ret != SGX_SUCCESS)
abort();
}
//This function is part of mutex demo
void demo_counter_mutex()
{
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
ret = ecall_mutex_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
}
//This function is used by processing thread of condition variable demo
void demo_cond_var_run()
{
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
ret = ecall_condition_variable_run(global_eid);
if (ret != SGX_SUCCESS)
abort();
}
//This function is used by the loader thread of condition variable demo
void demo_cond_var_load()
{
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
ret = ecall_condition_variable_load(global_eid);
if (ret != SGX_SUCCESS)
abort();
}
// Examples for C++11 library and compiler features
void ecall_libcxx_functions(void)
{
sgx_status_t ret = SGX_ERROR_UNEXPECTED;
// Example for lambda function feature:
ret = ecall_lambdas_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for auto feature:
ret = ecall_auto_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for decltype:
ret = ecall_decltype_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for strongly_typed_enum:
ret = ecall_strongly_typed_enum_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for range based for loops:
ret = ecall_range_based_for_loops_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for static_assert:
ret = ecall_static_assert_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for virtual function controls : override, final, default, and delete
ret = ecall_virtual_function_control_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for delegating_constructors:
ret = ecall_delegating_constructors_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for std::function:
ret = ecall_std_function_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for algorithms (std::all_of, std::any_of, std::none_of):
ret = ecall_cxx11_algorithms_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for variadic_templates feature:
ret = ecall_variadic_templates_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for SFINAE:
ret = ecall_SFINAE_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for initializer_list:
ret = ecall_initializer_list_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for rvalue:
ret = ecall_rvalue_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for nullptr:
ret = ecall_nullptr_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for enum class:
ret = ecall_enum_class_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for new container classes (unordered_set, unordered_map, unordered_multiset, and unordered_multimap):
ret = ecall_new_container_classes_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for tuple:
ret = ecall_tuple_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for shared_ptr:
ret = ecall_shared_ptr_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
// Example for atomic:
ret = ecall_atomic_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
//The following threads are part of mutex demo
std::thread t1(demo_counter_without_mutex);
std::thread t2(demo_counter_without_mutex);
std::thread t3(demo_counter_without_mutex);
t1.join();
t2.join();
t3.join();
ret = ecall_print_final_value_no_protection(global_eid);
if (ret != SGX_SUCCESS)
abort();
//The following threads are part of mutex demo
std::thread tm1(demo_counter_mutex);
std::thread tm2(demo_counter_mutex);
std::thread tm3(demo_counter_mutex);
tm1.join();
tm2.join();
tm3.join();
ret = ecall_print_final_value_mutex_demo(global_eid);
if (ret != SGX_SUCCESS)
abort();
//The following threads are part of condition variable demo
std::thread th1(demo_cond_var_run);
std::thread th2(demo_cond_var_load);
th2.join();
th1.join();
}

View File

@ -0,0 +1,12 @@
<!-- Please refer to User's Guide for the explanation of each field -->
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>10</TCSNum>
<TCSPolicy>1</TCSPolicy>
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>

View File

@ -0,0 +1,50 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <stdarg.h>
#include <stdio.h> /* vsnprintf */
#include "Enclave.h"
#include "Enclave_t.h" /* print_string */
/*
* printf:
* Invokes OCALL to display the enclave buffer to the terminal.
*/
void printf(const char *fmt, ...)
{
char buf[BUFSIZ] = {'\0'};
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, BUFSIZ, fmt, ap);
va_end(ap);
ocall_print_string(buf);
}

View File

@ -0,0 +1,55 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* Enclave.edl - Top EDL file. */
enclave {
/* Import ECALL/OCALL from sub-directory EDLs.
* [from]: specifies the location of EDL file.
* [import]: specifies the functions to import,
* [*]: implies to import all functions.
*/
from "TrustedLibrary/Libcxx.edl" import *;
from "sgx_tstdc.edl" import sgx_thread_wait_untrusted_event_ocall, sgx_thread_set_untrusted_event_ocall, sgx_thread_setwait_untrusted_events_ocall, sgx_thread_set_multiple_untrusted_events_ocall;
/*
* ocall_print_string - invokes OCALL to display string buffer inside the enclave.
* [in]: copy the string buffer to App outside.
* [string]: specifies 'str' is a NULL terminated buffer.
*/
untrusted {
void ocall_print_string([in, string] const char *str);
};
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -28,20 +28,21 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef _AE_INTERNAL_SERVICES_PROVIDER_H
#define _AE_INTERNAL_SERVICES_PROVIDER_H
class AEInternalServices;
#ifndef _ENCLAVE_H_
#define _ENCLAVE_H_
class AEInternalServicesProvider
{
public:
static AEInternalServices* GetInternalServicesProvider();
protected:
AEInternalServicesProvider();
static AEInternalServices* mProviderInstance;
};
#include <stdlib.h>
#include <assert.h>
#if defined(__cplusplus)
extern "C" {
#endif
void printf(const char *fmt, ...);
#if defined(__cplusplus)
}
#endif
#endif /* !_ENCLAVE_H_ */

View File

@ -0,0 +1,9 @@
enclave.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
local:
*;
};

View File

@ -0,0 +1,10 @@
enclave.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
local:
*;
};

View File

@ -0,0 +1,39 @@
-----BEGIN RSA PRIVATE KEY-----
MIIG4gIBAAKCAYEAroOogvsj/fZDZY8XFdkl6dJmky0lRvnWMmpeH41Bla6U1qLZ
AmZuyIF+mQC/cgojIsrBMzBxb1kKqzATF4+XwPwgKz7fmiddmHyYz2WDJfAjIveJ
ZjdMjM4+EytGlkkJ52T8V8ds0/L2qKexJ+NBLxkeQLfV8n1mIk7zX7jguwbCG1Pr
nEMdJ3Sew20vnje+RsngAzdPChoJpVsWi/K7cettX/tbnre1DL02GXc5qJoQYk7b
3zkmhz31TgFrd9VVtmUGyFXAysuSAb3EN+5VnHGr0xKkeg8utErea2FNtNIgua8H
ONfm9Eiyaav1SVKzPHlyqLtcdxH3I8Wg7yqMsaprZ1n5A1v/levxnL8+It02KseD
5HqV4rf/cImSlCt3lpRg8U5E1pyFQ2IVEC/XTDMiI3c+AR+w2jSRB3Bwn9zJtFlW
KHG3m1xGI4ck+Lci1JvWWLXQagQSPtZTsubxTQNx1gsgZhgv1JHVZMdbVlAbbRMC
1nSuJNl7KPAS/VfzAgEDAoIBgHRXxaynbVP5gkO0ug6Qw/E27wzIw4SmjsxG6Wpe
K7kfDeRskKxESdsA/xCrKkwGwhcx1iIgS5+Qscd1Yg+1D9X9asd/P7waPmWoZd+Z
AhlKwhdPsO7PiF3e1AzHhGQwsUTt/Y/aSI1MpHBvy2/s1h9mFCslOUxTmWw0oj/Q
ldIEgWeNR72CE2+jFIJIyml6ftnb6qzPiga8Bm48ubKh0kvySOqnkmnPzgh+JBD6
JnBmtZbfPT97bwTT+N6rnPqOOApvfHPf15kWI8yDbprG1l4OCUaIUH1AszxLd826
5IPM+8gINLRDP1MA6azECPjTyHXhtnSIBZCyWSVkc05vYmNXYUNiXWMajcxW9M02
wKzFELO8NCEAkaTPxwo4SCyIjUxiK1LbQ9h8PSy4c1+gGP4LAMR8xqP4QKg6zdu9
osUGG/xRe/uufgTBFkcjqBHtK5L5VI0jeNIUAgW/6iNbYXjBMJ0GfauLs+g1VsOm
WfdgXzsb9DYdMa0OXXHypmV4GwKBwQDUwQj8RKJ6c8cT4vcWCoJvJF00+RFL+P3i
Gx2DLERxRrDa8AVGfqaCjsR+3vLgG8V/py+z+dxZYSqeB80Qeo6PDITcRKoeAYh9
xlT3LJOS+k1cJcEmlbbO2IjLkTmzSwa80fWexKu8/Xv6vv15gpqYl1ngYoqJM3pd
vzmTIOi7MKSZ0WmEQavrZj8zK4endE3v0eAEeQ55j1GImbypSf7Idh7wOXtjZ7WD
Dg6yWDrri+AP/L3gClMj8wsAxMV4ZR8CgcEA0fzDHkFa6raVOxWnObmRoDhAtE0a
cjUj976NM5yyfdf2MrKy4/RhdTiPZ6b08/lBC/+xRfV3xKVGzacm6QjqjZrUpgHC
0LKiZaMtccCJjLtPwQd0jGQEnKfMFaPsnhOc5y8qVkCzVOSthY5qhz0XNotHHFmJ
gffVgB0iqrMTvSL7IA2yqqpOqNRlhaYhNl8TiFP3gIeMtVa9rZy31JPgT2uJ+kfo
gV7sdTPEjPWZd7OshGxWpT6QfVDj/T9T7L6tAoHBAI3WBf2DFvxNL2KXT2QHAZ9t
k3imC4f7U+wSE6zILaDZyzygA4RUbwG0gv8/TJVn2P/Eynf76DuWHGlaiLWnCbSz
Az2DHBQBBaku409zDQym3j1ugMRjzzSQWzJg0SIyBH3hTmnYcn3+Uqcp/lEBvGW6
O+rsXFt3pukqJmIV8HzLGGaLm62BHUeZf3dyWm+i3p/hQAL7Xvu04QW70xuGqdr5
afV7p5eaeQIJXyGQJ0eylV/90+qxjMKiB1XYg6WYvwKBwQCL/ddpgOdHJGN8uRom
e7Zq0Csi3hGheMKlKbN3vcxT5U7MdyHtTZZOJbTvxKNNUNYH/8uD+PqDGNneb29G
BfGzvI3EASyLIcGZF3OhKwZd0jUrWk2y7Vhob91jwp2+t73vdMbkKyI4mHOuXvGv
fg95si9oO7EBT+Oqvhccd2J+F1IVXncccYnF4u5ZGWt5lLewN/pVr7MjjykeaHqN
t+rfnQam2psA6fL4zS2zTmZPzR2tnY8Y1GBTi0Ko1OKd1HMCgcAb5cB/7/AQlhP9
yQa04PLH9ygQkKKptZp7dy5WcWRx0K/hAHRoi2aw1wZqfm7VBNu2SLcs90kCCCxp
6C5sfJi6b8NpNbIPC+sc9wsFr7pGo9SFzQ78UlcWYK2Gu2FxlMjonhka5hvo4zvg
WxlpXKEkaFt3gLd92m/dMqBrHfafH7VwOJY2zT3WIpjwuk0ZzmRg5p0pG/svVQEH
NZmwRwlopysbR69B/n1nefJ84UO50fLh5s5Zr3gBRwbWNZyzhXk=
-----END RSA PRIVATE KEY-----

View File

@ -0,0 +1,917 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include <string>
#include <vector>
#include <iterator>
#include <typeinfo>
#include <functional>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <initializer_list>
#include <tuple>
#include <memory>
#include <atomic>
#include <mutex>
#include <condition_variable>
#include <map>
#include "../Enclave.h"
#include "Enclave_t.h"
// Feature name : Lambda functions
// Feature description : It is used to create a function object that can capture variables in scope.
// Demo description : Shows lambda capture options and a some basic usages.
void ecall_lambdas_demo()
{
// Lambdas capture options:
int local_var = 0;
[] { return true; }; // captures nothing
[&] { return ++local_var; }; // captures all variable by reference
[&local_var] { return ++local_var; }; // captures local_var by reference
[&, local_var] { return local_var; }; // captures all by reference except local_var
[=] { return local_var; }; // captures all variable by value
[local_var] { return local_var; }; // captures local_var by value
[=, &local_var] { return ++local_var; }; // captures all variable by value except local_var
// Sample usages for lamdbas:
std::vector< int> v { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
printf("[Lambdas] Initial array using lambdas: { ");
// Print the elements in an array using lambdas
std::for_each(std::begin(v), std::end(v), [](int elem) { printf("%d ", elem); }); //capture specification
printf("}.\n");
// Find the first odd number using lambda as an unary predicate when calling find_if.
auto first_odd_element = std::find_if(std::begin(v), std::end(v), [=](int elem) { return elem % 2 == 1; });
if (first_odd_element != std::end(v))
printf("[Lambdas] First odd element in the array is %d. \n", *first_odd_element);
else
printf("[Lambdas] No odd element found in the array.\n");
// Count the even numbers using a lambda function as an unary predicate when calling count_if.
long long number_of_even_elements = std::count_if(std::begin(v), std::end(v), [=](int val) { return val % 2 == 0; });
printf("[Lambdas] Number of even elements in the array is %lld.\n", number_of_even_elements);
// Sort the elements of an array using lambdas
std::sort(std::begin(v), std::end(v), [](int e1, int e2) {return e2 < e1; });
// Print the elements in an array using lambdas
printf("[Lambdas] Array after sort: { ");
std::for_each(std::begin(v), std::end(v), [](int elem) { printf("%d ", elem); });
printf("}. \n");
printf("\n"); // end of demo
}
// Feature name : auto
// Feature description : It is used for type deduction
// Demo description : Shows basic usages of auto specifier with different types.
// Helper function for ecall_auto_demo:
void sample_func_auto_demo()
{
printf("[auto] Function sample_func_auto_demo is called. \n");
}
void ecall_auto_demo()
{
double local_var = 0.0;
auto a = 7; // Type of variable a is deduced to be int
printf("[auto] Type of a is int. typeid = %s.\n", typeid(a).name());
const auto b1 = local_var, *b2 = &local_var; // auto can be used with modifiers like const or &.
printf("[auto] Type of b1 is const double. typeid = %s.\n", typeid(b1).name());
printf("[auto] Type of b2 is const double*. typeid = %s.\n", typeid(b2).name());
(void)b1;
(void)b2;
auto c = 0, *d = &a; // multiple variable initialization if the deduced type does match
printf("[auto] Type of c is int. typeid = %s.\n", typeid(c).name());
printf("[auto] Type of d is int*. typeid = %s.\n", typeid(d).name());
(void)c;
(void)d;
auto lambda = [] {}; // can be used to define lambdas
printf("[auto] Type of lambda is [] {}. typeid = %s.\n", typeid(lambda).name());
(void)lambda;
auto func = sample_func_auto_demo; // can be used to deduce type of function
printf("[auto] Type of func is void(__cdecl*)(void). typeid = %s.\n", typeid(func).name());
func();
printf("\n"); // end of demo
}
// Feature name : decltype
// Feature description : It is used for type deduction
// Demo description : Shows basic usages of decltype specifier with different types.
void ecall_decltype_demo()
{
int a = 0 ;
decltype(a) b = 0; // create an element of the same type as another element
printf("[decltype] Type of b is int. typeid = %s.\n", typeid(b).name());
double c = 0;
decltype(a + c) sum = a + c; // deduce type of a sum of elements of different types and create an element of that type.
// most usefull in templates.
printf("[decltype] Type of sum is double. typeid = %s.\n", typeid(sum).name());
(void)sum;
(void)b;
printf("\n"); // end of demo
}
// Feature name : enum classes
// Feature description : A new type of enum that solves problems found in old enum like :
// unscoping of enum values and the possibility to compare them with int
// Demo description : Shows basic usages of enum classes.
void ecall_strongly_typed_enum_demo()
{
// In enum class the underlying type can be set. In the case bellow it is char.
enum class DaysOfWeek : char { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY };
// initialization of variable of type DaysOfWeek
DaysOfWeek random_day = DaysOfWeek::MONDAY;
(void)random_day;
// In is not mandatory to specify the underlying type.
enum class Weekend { SATURDAY, SUNDAY };
// The two enum classes above: days_of_week and weekend ilustrate that it is now possible to have two enum classes with the same values in them.
// end of demo
}
// Feature name : Range based for loops
// Feature description : Easy to read way of accessing elements in an container.
// Demo description : Shows basic usage of range based for loop with c array and vector.
void ecall_range_based_for_loops_demo()
{
char array_of_letters[] = { 'a','b','c','d' };
std::vector<char> vector_of_letters = { 'a','b','c','d' };
printf("[range_based_for_loops] Using range based for loops to print the content of an array: { ");
for (auto elem : array_of_letters)
printf("%c ", elem);
printf("}. \n");
printf("[range_based_for_loops] Using range based for loops to print the content of an vector: { ");
for (auto elem : vector_of_letters)
printf("%c ", elem);
printf("}.\n");
printf("\n"); // end of demo
}
// Feature name : static_assert
// Feature description : It is used to make assertions at compile time.
// Demo description : Shows basic usage of static_assert with compile time operation.
void ecall_static_assert_demo()
{
static_assert(sizeof(int) < sizeof(double), "Error : sizeof(int) < sizeof(double) ");
const int a = 0;
static_assert(a == 0, "Error: value of a is not 0");
// end of demo
}
// Feature name : New virtual function controls : override, final, default, and delete
// Feature description : - delete : a deleted function cannot be inherited
// - final : a final function cannot be overrided in the derived class
// - default : intruction to the compiler to generate a default function
// - override : ensures that a virtual function from derived class overrides a function from base
// Demo description : Shows basic usage of new virtual function control.
/* Helper class for ecall_virtual_function_control_demo.*/
class Base
{
public:
virtual void f_cannot_be_inherited() final {};
Base(const Base &) = delete;
Base() = default;
virtual void f_must_be_overrided() {};
};
/* Helper class for ecall_virtual_function_control_demo.*/
class Derived : Base
{
public:
/* The code bellow in this comment does not compile.
The function cannot be override because it is declared with keyword final in base
virtual double f_cannot_be_inherited() {};
*/
/*The keyword override assures that the function overrides a base class member*/
virtual void f_must_be_overrided() override {};
};
void ecall_virtual_function_control_demo()
{
// The default constructor will be called generated by the compiler with explicit keyword default
Base a;
// Trying to use the copy contructor will generate code that does not compile because it is deleted
// Base b = a;
// end of demo
}
// Feature name : Delegating constructors
// Feature description : A class constructors may have common code which can be delegated to a constructor to avoid code repetion
// Demo description : Shows basic usage of delegating constructors
// Helper class for ecall_delegating_constructors
class DemoDelegatingConstructors
{
int a, b, c;
public:
DemoDelegatingConstructors(int param_a, int param_b, int param_c)
{
this->a = param_a;
this->b = param_b;
this->c = param_c;
/*common initialization*/
switch (c)
{
case 1:
printf("[delegating constructors] Called from DemoDelegatingConstructors(int a, int b). \n");
break;
case 2:
printf("[delegating constructors] Called from DemoDelegatingConstructors(int a). \n");
break;
default:
printf("[delegating constructors] Called from DemoDelegatingConstructors(int a, int b, int c).\n");
break;
}
}
DemoDelegatingConstructors(int param_a, int param_b) : DemoDelegatingConstructors(param_a, param_b, 1) {}
DemoDelegatingConstructors(int param_a) : DemoDelegatingConstructors(param_a, 0, 2) {}
};
void ecall_delegating_constructors_demo()
{
DemoDelegatingConstructors a(1, 2, 3);
DemoDelegatingConstructors b(1, 2);
DemoDelegatingConstructors c(1);
printf("\n"); // end of demo
}
// Feature name : std::function
// Feature description : It is used to store and invoke a callable
// Demo description : Shows basic usage of std::function
// Helper class for ecall_std_function_demo:
void sample_std_function1()
{
printf("[std_function] calling sample_std_function1\n");
}
void ecall_std_function_demo()
{
// Example with functions
std::function<void()> funct = sample_std_function1;
funct();
//Example with lambda
std::function<void()> funct_lambda = [] { printf("[std_function] calling a lambda function\n"); };
funct_lambda();
printf("\n"); // end of demo
}
// Feature name : std::all_of, std::any_of, std::none_of
// Feature description : New C++11 algorithms
// Demo description : Shows basic usage of the std::all_of, std::any_of, std::none_of.
void ecall_cxx11_algorithms_demo()
{
std::vector<int> v = { 0, 1, 2, 3, 4, 5 };
bool are_all_of = all_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
printf("[cxx11_algorithms] All elements in { 0 1 2 3 4 5 } are even is %s. \n", are_all_of ? "true" : "false");
bool are_any_of = any_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
printf("[cxx11_algorithms] Some elements in { 0 1 2 3 4 5 } are even is %s. \n", are_any_of ? "true" : "false");
bool are_none_of = none_of(begin(v), end(v), [](int e) { return e % 2 == 0; });
printf("[cxx11_algorithms] Some elements in { 0 1 2 3 4 5 } are even is %s. \n", are_none_of ? "true" : "false");
printf("\n"); // end of demo
}
// Feature name : variadic templates
// Feature description : Templates that can have multiple arguments
// Demo description : Shows basic usage of variadic templates
// Helper template for ecall_variadic_templates_demo:
template<typename T>
T sum(T elem)
{
return elem;
}
template<typename T, typename... Args>
T sum(T elem1, T elem2, Args... args)
{
return elem1 + elem2 + sum(args...);
}
void ecall_variadic_templates_demo()
{
int computed_sum = sum(1, 2, 3, 4, 5);
printf("[variadic_templates] The sum of paramters (1, 2, 3, 4, 5) is %d. \n", computed_sum);
printf("\n"); // end of demo
}
// Feature name : Substitution failure is not an error (SFINAE)
// Feature description : Describes the case where a substitution error in templates does not cause errors
// Demo description : Shows basic usage of SFINAE
/*first candidate for substitution*/
template <typename T> void f(typename T::A*) { printf("[sfinae] First candidate for substitution is matched.\n"); };
/*second candidate for substitution*/
template <typename T> void f(T) { printf("[sfinae] Second candidate for substitution is matched.\n"); }
void ecall_SFINAE_demo()
{
f<int>(0x0); // even if the first canditate substition will fail, the second one will pass
printf("\n"); // end of demo
}
//Feature name : Initializer lists
//Feature description : An object of type std::initializer_list<T> is a lightweight proxy object that provides access to an array of objects of type const T.
//Demo description : Demonstrates the usage of initializer list in the constructor of an object in enclave.
class Number
{
public:
Number(const std::initializer_list<int> &v) {
for (auto i : v) {
elements.push_back(i);
}
}
void print_elements() {
printf("[initializer_list] The elements of the vector are:");
for (auto item : elements) {
printf(" %d", item);
}
printf(".\n");
}
private:
std::vector<int> elements;
};
void ecall_initializer_list_demo()
{
printf("[initializer_list] Using initializer list in the constructor. \n");
Number m = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
m.print_elements();
printf("\n"); //end of demo
}
// Feature name : Rvalue references and move semantics;
// Feature description : They are used for memory usage optimazation by eliminating copy operations
// Demo description : Shows basic usage of rvalue, move constructor, and move operator
// Helper class for ecall_rvalue_demo
class DemoBuffer
{
public:
unsigned int size = 100;
char *buffer;
DemoBuffer(int param_size)
{
this->size = param_size;
buffer = new char[size];
printf("[rvalue] Called constructor : DemoBuffer(int size).\n");
}
// A typical copy constructor needs to alocate memory for a new copy
// Copying an big array is an expensive operation
DemoBuffer(const DemoBuffer & rhs)
{
this->size = rhs.size;
buffer = new char[rhs.size];
memcpy(buffer, rhs.buffer, size);
printf("[rvalue] Called copy constructor : DemoBuffer(const DemoBuffer & rhs).\n");
}
// A typical move constructor can reuse the memory pointed by the buffer
DemoBuffer(DemoBuffer && rhs)
{
buffer = rhs.buffer;
size = rhs.size;
// reset state of rhs
rhs.buffer = NULL;
rhs.size = 0;
printf("[rvalue] Called move constructor : DemoBuffer(DemoBuffer && rhs).\n");
}
~DemoBuffer()
{
delete buffer;
}
};
// Helper class for ecall_rvalue_demo
DemoBuffer foobar(int a)
{
DemoBuffer x(100);
DemoBuffer y(100);
if (a > 0)
return x;
else
return y;
}
void ecall_rvalue_demo()
{
// This will call the constructor
printf("[rvalue] DemoBuffer a(100).\n");
DemoBuffer a(100);
printf("[rvalue] DemoBuffer foobar(100). \n");
// Initializing variable d using a temporary object will result in a call to move constructor
// This is usefull because it reduces the memory cost of the operation.
DemoBuffer d(foobar(100));
// This will call the copy constructor. State of a will not change.
printf("[rvalue] DemoBuffer b(a).\n");
DemoBuffer b(a);
printf("[rvalue] DemoBuffer c(std::move(a)).\n");
// explicitly cast a to an rvalue so that c will be created using move constructor.
// State of a is going to be reseted.
DemoBuffer c(std::move(a));
printf("\n"); // end of demo
}
// Feature name : Nullptr
// Feature description : Resolves the issues of converting NULL to integral types
// Demo description : Shows basic usage of nullptr
// overload candidate 1
void nullptr_overload_candidate(int i) {
(void)i;
printf("[nullptr] called void nullptr_overload_candidate(int i).\n");
}
// overload candidate 2
void nullptr_overload_candidate(int* ptr) {
(void)ptr;
printf("[nullptr] called void nullptr_overload_candidate(int* ptr).\n");
}
template<class F, class A>
void Fwd(F f, A a)
{
f(a);
}
void g(int* i)
{
(void)i;
printf("[nullptr] Function %s called\n", __FUNCTION__);
}
// Feature name :
// Feature description :
// Demo description :
void ecall_nullptr_demo()
{
// NULL can be converted to integral types() like int and will call overload candidate 1
nullptr_overload_candidate(NULL);
// nullptr can't be converted to integral types() like int and will call overload candidate 2
nullptr_overload_candidate(nullptr);
g(NULL); // Fine
g(0); // Fine
Fwd(g, nullptr); // Fine
//Fwd(g, NULL); // ERROR: No function g(int)
printf("\n"); // end of demo
}
// Feature name : Scoped enums
// Feature description :
// Demo description :
enum class Color { orange, brown, green = 30, blue, red };
void ecall_enum_class_demo()
{
int n = 0;
Color color1 = Color::brown;
switch (color1)
{
case Color::orange: printf("[enum class] orange"); break;
case Color::brown: printf("[enum class] brown"); break;
case Color::green: printf("[enum class] green"); break;
case Color::blue: printf("[enum class] blue"); break;
case Color::red: printf("[enum class] red"); break;
}
// n = color1; // Not allowed: no scoped enum to int conversion
n = static_cast<int>(color1); // OK, n = 1
printf(" - int = %d\n", n);
Color color2 = Color::red;
switch (color2)
{
case Color::orange: printf("[enum class] orange"); break;
case Color::brown: printf("[enum class] brown"); break;
case Color::green: printf("[enum class] green"); break;
case Color::blue: printf("[enum class] blue"); break;
case Color::red: printf("[enum class] red"); break;
}
n = static_cast<int>(color2); // OK, n = 32
printf(" - int = %d\n", n);
Color color3 = Color::green;
switch (color3)
{
case Color::orange: printf("[enum class] orange"); break;
case Color::brown: printf("[enum class] brown"); break;
case Color::green: printf("[enum class] green"); break;
case Color::blue: printf("[enum class] blue"); break;
case Color::red: printf("[enum class] red"); break;
}
n = static_cast<int>(color3); // OK, n = 30
printf(" - int = %d\n", n);
printf("\n");
}
// Feature name : new container classes
// Feature description : unordered_set, unordered_map, unordered_multiset, and unordered_multimap
// Demo description : Shows basic usage of new container classes
void ecall_new_container_classes_demo()
{
// unordered_set
// container used for fast acces that groups elements in buckets based on their hash
std::unordered_set<int> set_of_numbers = { 0, 1, 2, 3, 4, 5 };
const int searchVal = 3;
std::unordered_set<int>::const_iterator got = set_of_numbers.find(searchVal);
if (got == set_of_numbers.end())
printf("[new_container_classes] unordered_set { 0, 1, 2, 3, 4, 5} has value 3.\n");
else
printf("[new_container_classes] unordered_set { 0, 1, 2, 3, 4, 5} it does not have value 3.\n");
// unordered_multiset
// container used for fast acces that groups non unique elements in buckets based on their hash
std::unordered_multiset<int> multiset_of_numbers = { 0, 1, 2, 3, 3, 3 };
printf("[new_container_classes] multiset_set { 0, 1, 2, 3, 3, 3} has %d elements with value %d.\n",
(int)multiset_of_numbers.count(searchVal), searchVal);
// unordered_map
std::unordered_map<std::string, int> grades{ { "A", 10 },{ "B", 8 },{ "C", 7 },{ "D", 5 },{ "E", 3 } };
printf("[new_container_classes] unordered_map elements: {");
for (auto pair : grades) {
printf("[%s %d] ", pair.first.c_str(), pair.second);
}
printf("}.\n");
// unordered_multimap
std::unordered_multimap<std::string, int> multimap_grades{ { "A", 10 },{ "B", 8 },{ "B", 7 },{ "E", 5 },{ "E", 3 },{ "E",1 } };
printf("[new_container_classes] unordered_multimap elements: {");
for (auto pair : multimap_grades) {
printf("[%s %d] ", pair.first.c_str(), pair.second);
}
printf("}.\n");
printf("\n"); // end of demo
}
// Feature name : Tuple
// Feature description : Objects that pack elements of multiple types which can be accessed by index
// Demo description : Shows basic usage of tuple: creation and access
void ecall_tuple_demo()
{
// Create tuple using std::make_tuple
char array_of_letters[4] = {'A','B','C','D'};
std::vector<char> vector_of_letters = { 'A','B','C','D' };
std::map<char, char> map_of_letters = { {'B','b' } };
// Creating a tuple using a tuple constructor
std::tuple<int, std::string> tuple_sample_with_constructor(42, "Sample tuple");
(void)tuple_sample_with_constructor;
// Creating a tuple using std::make_tuple
auto tuple_sample = std::make_tuple("<First element of TupleSample>", 1, 7.9, vector_of_letters, array_of_letters, map_of_letters);
// Access the elements in tupleSample using std::get<index>
printf("[tuple] show first element in TupleSample: %s. \n", std::get<0>(tuple_sample));
printf("[tuple] show second element in TupleSample: %d. \n", std::get<1>(tuple_sample));
printf("[tuple] show third element in TupleSample: %f. \n", std::get<2>(tuple_sample));
// Getting vector from a tuple
std::vector<char> temp_vector = std::get<3>(tuple_sample);
(void)temp_vector;
// Getting array from a tuple
int first_elem_of_array = std::get<4>(tuple_sample)[0];
(void)first_elem_of_array;
// Getting map from a tuple
std::map<char, char> temp_map = std::get<5>(tuple_sample);
(void)temp_map;
printf("\n"); // end of demo
}
// Feature name : new smart pointer
// Feature description : shared_ptr and unique_ptr
// Demo decription : Shows basic usage of smart pointers
// Helper class for ecall_shared_ptr_demo
class DemoSmartPtr
{
std::string smartPointerType;
public:
DemoSmartPtr(std::string param_smartPointerType)
{
printf("[smart_ptr] In construct of object demo_smart_ptr using %s. \n", param_smartPointerType.c_str());
this->smartPointerType = param_smartPointerType;
}
~DemoSmartPtr()
{
printf("[smart_ptr] In deconstructor of object demo_smart_ptr using %s. \n", smartPointerType.c_str());
}
};
void ecall_shared_ptr_demo()
{
// std::shared_ptr is smart pointer that takes ownership of an object using a pointer
// The object is freed when the last smart_pointer does not point to it.
// Creating a shared pointer using std::make_shared
auto shared_ptr = std::make_shared<DemoSmartPtr>("smart_ptr."); // The constructor of DemoSmartPtr will be called here
printf("[smart_ptr] shared_ptr reference count = %ld. \n", shared_ptr.use_count());
auto shared_ptr2 = shared_ptr;
printf("[smart_ptr] shared_ptr reference count = %ld incresead after creating another shared pointer.\n", shared_ptr.use_count());
shared_ptr2.reset();
printf("[smart_ptr] shared_ptr reference count = %ld decresead after calling releasing ownership. \n", shared_ptr.use_count());
// std::unique_ptr is smart pointer that takes ownership of an object using a pointer
// it is different from smart_ptr in the sense that only one unique_ptr can take ownership
std::unique_ptr<DemoSmartPtr> unique_ptr(new DemoSmartPtr("unique_ptr"));
// When going out of scope both shared_ptr and unique_ptr release the objects they own
// end of demo
}
//Feature name : atomic
//Feature description: The atomic library provides components for fine-grained atomic operations allowing for lockless concurrent programming.
// Each atomic operation is indivisible with regards to any other atomic operation that involves the same object.
// Atomic objects are free of data races.
//Demo description : Demonstrates the usage of atomic types, objects and functions in enclave.
void ecall_atomic_demo()
{
printf("[atomic] Atomic types, objects and functions demo.\n");
printf("[atomic_store] Defining an atomic_char object with an initial value of 5.\n");
std::atomic_char atc(5);
printf("[atomic_store] The current value stored in the atomic object is: %d\n", atc.load());
printf("[atomic_store] Replacing the value of the atomic object with a non-atomic value of 3.\n");
std::atomic_store<char>(&atc, 3);
printf("[atomic_store] The new value of the atomic object is: %d.\n", atc.load());
printf("\n");
printf("[atomic_store_explicit] Defining an atomic_short object with an initial value of 5.\n");
std::atomic_short ats(5);
printf("[atomic_store_explicit] The current value stored in the atomic object is: %d.\n", ats.load());
printf("[atomic_store_explicit] Replacing the value of the atomic object with a non-atomic value of 3.\n");
std::atomic_store_explicit<short>(&ats, 3, std::memory_order_seq_cst);
printf("[atomic_store] The new value of the atomic object is: %d.\n", ats.load());
printf("\n");
printf("[atomic_load] Defining an atomic_int object with an initial value of 4.\n");
std::atomic_int ati1(4);
printf("[atomic_load] Obtaining the value of the atomic object and saving it in a int variable.\n");
int val = std::atomic_load(&ati1);
printf("[atomic_load] The obtained value is %d.\n", val);
printf("\n");
printf("[atomic_load_explicit] Defining an atomic_int object with an initial value of 2.\n");
std::atomic_int ati2(2);
printf("[atomic_load_explicit] Obtaining the value of the atomic object and saving it in a int variable.\n");
int val1 = std::atomic_load_explicit(&ati2, std::memory_order_seq_cst);
printf("[atomic_load_explicit] The obtained value is %d.\n", val1);
printf("\n");
printf("[atomic_fetch_add] Defining an atomic_int object with an initial value of 7.\n");
std::atomic_int ati(7);
printf("[atomic_fetch_add] The current value stored in the atomic object is: %d.\n", ati.load());
printf("[atomic_fetch_add] Adding a non-atomic value of 8 to the atomic object.\n");
std::atomic_fetch_add(&ati, 8);
printf("[atomic_fetch_add] The new value of the atomic object is: %d.\n", ati.load());
printf("\n");
printf("[atomic_fetch_add_explicit] Defining an atomic_uint object with an initial value of 7.\n");
std::atomic_uint atui(7);
printf("[atomic_fetch_add_explicit] The current value stored in the atomic object is: %u.\n", atui.load());
printf("[atomic_fetch_add_explicit] Adding a non-atomic value of 8 to the atomic object.\n");
std::atomic_fetch_add_explicit<unsigned int>(&atui, 8, std::memory_order_seq_cst);
printf("[atomic_fetch_add_explicit] The new value of the atomic object is: %u.\n", atui.load());
printf("\n");
printf("[atomic_fetch_sub] Defining an atomic_long object with an initial value of 20.\n");
std::atomic_long atl(20);
printf("[atomic_fetch_sub] The current value stored in the atomic object is: %ld.\n", atl.load());
printf("[atomic_fetch_sub] Substracting a non-atomic value of 8 from the value of the atomic object.\n");
std::atomic_fetch_sub<long>(&atl, 8);
printf("[atomic_fetch_sub] The new value of the atomic object is: %ld.\n", atl.load());
printf("\n");
printf("[atomic_fetch_sub_explicit] Defining an atomic_llong object with an initial value of 20.\n");
std::atomic_llong atll(20);
printf("[atomic_fetch_sub_explicit] The current value stored in the atomic object is: %lld.\n", atll.load());
printf("[atomic_fetch_sub_explicit] Substracting a non-atomic value of 8 from the value of the atomic object.\n");
std::atomic_fetch_sub_explicit<long long>(&atll, 8, std::memory_order_seq_cst);
printf("[atomic_fetch_sub_explicit] The new value of the atomic object is: %lld.\n", atll.load());
printf("\n"); // end of demo
}
//Feature name : mutex
//Feature description : The mutex class is a synchronization primitive that can be used to protect shared data
// from being simultaneously accessed by multiple threads.
//Demo description : Demonstrates mutex protection when incrementing values in multiple threads.
//Structure used in mutex demo to show the behavior without using a mutex
struct CounterWithoutMutex {
int value;
CounterWithoutMutex() : value(0) {}
void increment() {
++value;
}
};
CounterWithoutMutex counter_without_protection;
//E-call used by mutex demo to perform the incrementation using a counter without mutex protection
void ecall_mutex_demo_no_protection()
{
for (int i = 0; i < 100000; ++i) {
counter_without_protection.increment();
}
}
//E-call used by mutex demo to get the final value of the counter from enclave
void ecall_print_final_value_no_protection()
{
printf("[mutex] Incrementing values in three threads without mutex protection, using a 100000 times loop. \n[mutex]Expected value is 300000. The final value is %d.\n", counter_without_protection.value);
}
//Structure used in mutex demo
struct CounterProtectedByMutex {
std::mutex mutex;
int value;
CounterProtectedByMutex() : value(0) {}
void increment() {
//locking the mutex to avoid simultaneous incrementation in different threads
mutex.lock();
++value;
//unlocking the mutex
mutex.unlock();
}
};
CounterProtectedByMutex counter_with_protection;
//E-call used by mutex demo to perform the actual incrementation
void ecall_mutex_demo()
{
for (int i = 0; i < 100000; ++i) {
counter_with_protection.increment();
}
}
//E-call used by mutex demo to get the final value of the counter from enclave
void ecall_print_final_value_mutex_demo()
{
printf("[mutex] Mutex protection when incrementing a value in 3 threads, using a 100000 times loop. \n[mutex]Expected value is 300000. The final value is %d.\n", counter_with_protection.value);
}
//Feature name : condition_variable
//Feature description: The condition_variable class is a synchronization primitive that can be used to block a thread,
// or multiple threads at the same time, until another thread both modifies a shared variable (the condition),
// and notifies the condition_variable.
//Demo description : Demonstrates condition_variable usage in a two threads environment. One thread is used for loading the data and
// the other processes the loaded data. The thread for processing the data waits untill the data is loaded in the
// other thread and gets notified when loading is completed.
//This class is used by condition variable demo
class DemoConditionVariable
{
std::mutex mtx;
std::condition_variable cond_var;
bool data_loaded;
public:
DemoConditionVariable()
{
data_loaded = false;
}
void load_data()
{
//Simulating loading of the data
printf("[condition_variable] Loading Data...\n");
{
// Locking the data structure
std::lock_guard<std::mutex> guard(mtx);
// Setting the flag to true to signal load data completion
data_loaded = true;
}
// Notify to unblock the waiting thread
cond_var.notify_one();
}
bool is_data_loaded()
{
return data_loaded;
}
void main_task()
{
printf("\n");
printf("[condition_variable] Running condition variable demo.\n");
// Acquire the lock
std::unique_lock<std::mutex> lck(mtx);
printf("[condition_variable] Waiting for the data to be loaded in the other thread.\n");
cond_var.wait(lck, std::bind(&DemoConditionVariable::is_data_loaded, this));
printf("[condition_variable] Processing the loaded data.\n");
printf("[condition_variable] Done.\n");
}
};
DemoConditionVariable app;
//E-call used by condition_variable demo - processing thread
void ecall_condition_variable_run()
{
app.main_task();
}
//E-call used by condifion_variable demo - loader thread
void ecall_condition_variable_load()
{
app.load_data();
}

View File

@ -0,0 +1,70 @@
/*
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/* Libcxx.edl - EDL sample for trusted C++ library. */
enclave {
/*
* A subset of the C++03 standard is supported.
*/
trusted {
public void ecall_lambdas_demo(void);
public void ecall_auto_demo(void);
public void ecall_decltype_demo(void);
public void ecall_strongly_typed_enum_demo(void);
public void ecall_range_based_for_loops_demo(void);
public void ecall_static_assert_demo(void);
public void ecall_virtual_function_control_demo(void);
public void ecall_delegating_constructors_demo(void);
public void ecall_std_function_demo(void);
public void ecall_cxx11_algorithms_demo(void);
public void ecall_variadic_templates_demo(void);
public void ecall_SFINAE_demo(void);
public void ecall_initializer_list_demo(void);
public void ecall_rvalue_demo(void);
public void ecall_nullptr_demo(void);
public void ecall_enum_class_demo(void);
public void ecall_new_container_classes_demo(void);
public void ecall_tuple_demo(void);
public void ecall_shared_ptr_demo(void);
public void ecall_atomic_demo(void);
public void ecall_mutex_demo(void);
public void ecall_print_final_value_mutex_demo(void);
public void ecall_mutex_demo_no_protection(void);
public void ecall_print_final_value_no_protection(void);
public void ecall_condition_variable_run(void);
public void ecall_condition_variable_load(void);
};
};

View File

@ -0,0 +1,252 @@
#
# Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
######## SGX SDK Settings ########
SGX_SDK ?= /opt/intel/sgxsdk
SGX_MODE ?= HW
SGX_ARCH ?= x64
SGX_DEBUG ?= 1
ifeq ($(shell getconf LONG_BIT), 32)
SGX_ARCH := x86
else ifeq ($(findstring -m32, $(CXXFLAGS)), -m32)
SGX_ARCH := x86
endif
ifeq ($(SGX_ARCH), x86)
SGX_COMMON_CFLAGS := -m32
SGX_LIBRARY_PATH := $(SGX_SDK)/lib
SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x86/sgx_sign
SGX_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r
else
SGX_COMMON_CFLAGS := -m64
SGX_LIBRARY_PATH := $(SGX_SDK)/lib64
SGX_ENCLAVE_SIGNER := $(SGX_SDK)/bin/x64/sgx_sign
SGX_EDGER8R := $(SGX_SDK)/bin/x64/sgx_edger8r
endif
ifeq ($(SGX_DEBUG), 1)
ifeq ($(SGX_PRERELEASE), 1)
$(error Cannot set SGX_DEBUG and SGX_PRERELEASE at the same time!!)
endif
endif
ifeq ($(SGX_DEBUG), 1)
SGX_COMMON_CFLAGS += -O0 -g
else
SGX_COMMON_CFLAGS += -O2
endif
######## App Settings ########
ifneq ($(SGX_MODE), HW)
Urts_Library_Name := sgx_urts_sim
else
Urts_Library_Name := sgx_urts
endif
App_Cpp_Files := App/App.cpp $(wildcard App/TrustedLibrary/*.cpp)
App_Include_Paths := -IInclude -IApp -I$(SGX_SDK)/include
App_C_Flags := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes $(App_Include_Paths)
# Three configuration modes - Debug, prerelease, release
# Debug - Macro DEBUG enabled.
# Prerelease - Macro NDEBUG and EDEBUG enabled.
# Release - Macro NDEBUG enabled.
ifeq ($(SGX_DEBUG), 1)
App_C_Flags += -DDEBUG -UNDEBUG -UEDEBUG
else ifeq ($(SGX_PRERELEASE), 1)
App_C_Flags += -DNDEBUG -DEDEBUG -UDEBUG
else
App_C_Flags += -DNDEBUG -UEDEBUG -UDEBUG
endif
App_Cpp_Flags := $(App_C_Flags) -std=c++11
App_Link_Flags := $(SGX_COMMON_CFLAGS) -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread
ifneq ($(SGX_MODE), HW)
App_Link_Flags += -lsgx_uae_service_sim
else
App_Link_Flags += -lsgx_uae_service
endif
App_Cpp_Objects := $(App_Cpp_Files:.cpp=.o)
App_Name := app
######## Enclave Settings ########
Enclave_Version_Script := Enclave/Enclave_debug.lds
ifeq ($(SGX_MODE), HW)
ifneq ($(SGX_DEBUG), 1)
ifneq ($(SGX_PRERELEASE), 1)
# Choose to use 'Enclave.lds' for HW release mode
Enclave_Version_Script = Enclave/Enclave.lds
endif
endif
endif
ifneq ($(SGX_MODE), HW)
Trts_Library_Name := sgx_trts_sim
Service_Library_Name := sgx_tservice_sim
else
Trts_Library_Name := sgx_trts
Service_Library_Name := sgx_tservice
endif
Crypto_Library_Name := sgx_tcrypto
Enclave_Cpp_Files := Enclave/Enclave.cpp $(wildcard Enclave/TrustedLibrary/*.cpp)
Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/libcxx -I$(SGX_SDK)/include/tlibc
Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -fstack-protector $(Enclave_Include_Paths)
Enclave_Cpp_Flags := $(Enclave_C_Flags) -nostdinc++ -std=c++11
# To generate a proper enclave, it is recommended to follow below guideline to link the trusted libraries:
# 1. Link sgx_trts with the `--whole-archive' and `--no-whole-archive' options,
# so that the whole content of trts is included in the enclave.
# 2. For other libraries, you just need to pull the required symbols.
# Use `--start-group' and `--end-group' to link these libraries.
# Do NOT move the libraries linked with `--start-group' and `--end-group' within `--whole-archive' and `--no-whole-archive' options.
# Otherwise, you may get some undesirable errors.
Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefaultlibs -nostartfiles -L$(SGX_LIBRARY_PATH) \
-Wl,--whole-archive -l$(Trts_Library_Name) -Wl,--no-whole-archive \
-Wl,--start-group -lsgx_tstdc -lsgx_tcxx -l$(Crypto_Library_Name) -l$(Service_Library_Name) -Wl,--end-group \
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
-Wl,--defsym,__ImageBase=0 \
-Wl,--version-script=$(Enclave_Version_Script)
Enclave_Cpp_Objects := $(Enclave_Cpp_Files:.cpp=.o)
Enclave_Name := enclave.so
Signed_Enclave_Name := enclave.signed.so
Enclave_Config_File := Enclave/Enclave.config.xml
ifeq ($(SGX_MODE), HW)
ifeq ($(SGX_DEBUG), 1)
Build_Mode = HW_DEBUG
else ifeq ($(SGX_PRERELEASE), 1)
Build_Mode = HW_PRERELEASE
else
Build_Mode = HW_RELEASE
endif
else
ifeq ($(SGX_DEBUG), 1)
Build_Mode = SIM_DEBUG
else ifeq ($(SGX_PRERELEASE), 1)
Build_Mode = SIM_PRERELEASE
else
Build_Mode = SIM_RELEASE
endif
endif
.PHONY: all run
ifeq ($(Build_Mode), HW_RELEASE)
all: .config_$(Build_Mode)_$(SGX_ARCH) $(App_Name) $(Enclave_Name)
@echo "The project has been built in release hardware mode."
@echo "Please sign the $(Enclave_Name) first with your signing key before you run the $(App_Name) to launch and access the enclave."
@echo "To sign the enclave use the command:"
@echo " $(SGX_ENCLAVE_SIGNER) sign -key <your key> -enclave $(Enclave_Name) -out <$(Signed_Enclave_Name)> -config $(Enclave_Config_File)"
@echo "You can also sign the enclave using an external signing tool."
@echo "To build the project in simulation mode set SGX_MODE=SIM. To build the project in prerelease mode set SGX_PRERELEASE=1 and SGX_MODE=HW."
else
all: .config_$(Build_Mode)_$(SGX_ARCH) $(App_Name) $(Signed_Enclave_Name)
ifeq ($(Build_Mode), HW_DEBUG)
@echo "The project has been built in debug hardware mode."
else ifeq ($(Build_Mode), SIM_DEBUG)
@echo "The project has been built in debug simulation mode."
else ifeq ($(Build_Mode), HW_PRERELEASE)
@echo "The project has been built in pre-release hardware mode."
else ifeq ($(Build_Mode), SIM_PRERELEASE)
@echo "The project has been built in pre-release simulation mode."
else
@echo "The project has been built in release simulation mode."
endif
endif
run: all
ifneq ($(Build_Mode), HW_RELEASE)
@$(CURDIR)/$(App_Name)
@echo "RUN => $(App_Name) [$(SGX_MODE)|$(SGX_ARCH), OK]"
endif
######## App Objects ########
App/Enclave_u.c: $(SGX_EDGER8R) Enclave/Enclave.edl
@cd App && $(SGX_EDGER8R) --untrusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
@echo "GEN => $@"
App/Enclave_u.o: App/Enclave_u.c
@$(CC) $(App_C_Flags) -c $< -o $@
@echo "CC <= $<"
App/%.o: App/%.cpp
@$(CXX) $(App_Cpp_Flags) -c $< -o $@
@echo "CXX <= $<"
$(App_Name): App/Enclave_u.o $(App_Cpp_Objects)
@$(CXX) $^ -o $@ $(App_Link_Flags)
@echo "LINK => $@"
.config_$(Build_Mode)_$(SGX_ARCH):
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.*
@touch .config_$(Build_Mode)_$(SGX_ARCH)
######## Enclave Objects ########
Enclave/Enclave_t.c: $(SGX_EDGER8R) Enclave/Enclave.edl
@cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
@echo "GEN => $@"
Enclave/Enclave_t.o: Enclave/Enclave_t.c
@$(CC) $(Enclave_C_Flags) -c $< -o $@
@echo "CC <= $<"
Enclave/%.o: Enclave/%.cpp
@$(CXX) $(Enclave_Cpp_Flags) -c $< -o $@
@echo "CXX <= $<"
$(Enclave_Name): Enclave/Enclave_t.o $(Enclave_Cpp_Objects)
@$(CXX) $^ -o $@ $(Enclave_Link_Flags)
@echo "LINK => $@"
$(Signed_Enclave_Name): $(Enclave_Name)
@$(SGX_ENCLAVE_SIGNER) sign -key Enclave/Enclave_private.pem -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File)
@echo "SIGN => $@"
.PHONY: clean
clean:
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_Cpp_Objects) App/Enclave_u.* $(Enclave_Cpp_Objects) Enclave/Enclave_t.*

View File

@ -0,0 +1,44 @@
-----------------------
Purpose of Cxx11SGXDemo
-----------------------
The project demonstrates serveral C++11 features inside the Enclave:
- lambda expressions;
- rvalue references and move semantics;
- automatic type deduction with auto and decltype;
- nullptr type;
- strongly typed enum classes;
- Range-based for statements;
- static_assert keyword for compile-time assertion;
- initializer lists and uniform initialization syntax;
- New virtual function controls: override, final, default, and delete;
- delegating constructors;
- new container classes (unordered_set, unordered_map, unordered_multiset, and unordered_multimap);
- tuple class;
- function object wrapper;
- atomic, mutexes, condition_variables;
- new smart pointer classes: shared_ptr, unique_ptr;
- new c++ algorithms: all_of, any_of, none_of;
- variadic templates;
- SFINAE;
---------------------------------------------
How to Build/Execute the C++11 sample program
---------------------------------------------
1. Install Intel(R) Software Guard Extensions (Intel(R) SGX) SDK for Linux* OS
2. Build the project with the prepared Makefile:
a. Hardware Mode, Debug build:
$ make
b. Hardware Mode, Pre-release build:
$ make SGX_PRERELEASE=1 SGX_DEBUG=0
c. Hardware Mode, Release build:
$ make SGX_DEBUG=0
d. Simulation Mode, Debug build:
$ make SGX_MODE=SIM
e. Simulation Mode, Pre-release build:
$ make SGX_MODE=SIM SGX_PRERELEASE=1 SGX_DEBUG=0
f. Simulation Mode, Release build:
$ make SGX_MODE=SIM SGX_DEBUG=0
3. Execute the binary directly:
$ ./app
4. Remember to "make clean" before switching build mode

View File

@ -2,7 +2,7 @@
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.intel.sgx.configuration.Sim.Debug">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug Sim Mode">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@ -17,49 +17,16 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="SGX Debug Sim Mode" parent="com.intel.sgx.configuration.Sim.Debug">
<folderInfo id="com.intel.sgx.configuration.Sim.Debug.292452237" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Debug.1618485184" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1039454044" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.1591862020" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
<tool id="com.intel.sgx.compiler.1853780321" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1427419865" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug" parent="com.intel.sgx.configuration.Sim.Debug">
<folderInfo id="com.intel.sgx.configuration.Sim.Debug.935873960" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Debug.2132595457" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1678491512" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder2.229166714" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder2"/>
<tool id="com.intel.sgx.compiler.81269967" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1694375039" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.1817588305" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="SGX Debug HW Mode">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="SGX Debug HW Mode" parent="com.intel.sgx.configuration.HW.Debug">
<folderInfo id="com.intel.sgx.configuration.HW.Debug.971320034" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Debug.1761600540" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.131147161" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.1502087524" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
<tool id="com.intel.sgx.compiler.1085280084" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.57165741" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
</option>
<inputType id="com.intel.sgx.inputType.79844751" superClass="com.intel.sgx.inputType"/>
<inputType id="com.intel.sgx.inputType.742388855" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
@ -68,7 +35,7 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.Sim.Release">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release Sim Mode">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.Sim.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Simulation">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@ -83,16 +50,49 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="SGX Release Sim Mode" parent="com.intel.sgx.configuration.Sim.Release">
<folderInfo id="com.intel.sgx.configuration.Sim.Release.151408355" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Release.1055083183" name="SGX GCC" superClass="com.intel.sgx.toolChain.Sim.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.471419902" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1151273037" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
<tool id="com.intel.sgx.compiler.1302347316" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1645761127" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation" parent="com.intel.sgx.configuration.Sim.Release">
<folderInfo id="com.intel.sgx.configuration.Sim.Release.428839196" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.Sim.Release.709775329" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.Sim.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1866379479" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=SIM -f Makefile" command="make" id="com.intel.sgx.builder3.1000705250" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder3"/>
<tool id="com.intel.sgx.compiler.301453474" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1312096753" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.640775034" superClass="com.intel.sgx.inputType"/>
<inputType id="com.intel.sgx.inputType.596141238" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Debug">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Debug" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.autotools.core.ErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug" parent="com.intel.sgx.configuration.HW.Debug">
<folderInfo id="com.intel.sgx.configuration.HW.Debug.562917509" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Debug.2046051538" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Debug">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.999277922" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder1.577701014" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder1"/>
<tool id="com.intel.sgx.compiler.1898704176" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1026657138" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.393162412" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
@ -101,7 +101,7 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Prerelease">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="SGX Pre-release Release HW Mode">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Prerelease" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Prerelease">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@ -116,16 +116,16 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="SGX Pre-release Release HW Mode" parent="com.intel.sgx.configuration.HW.Prerelease">
<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.1418650208" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.1668578385" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Prerelease">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.977258758" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.1888300852" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
<tool id="com.intel.sgx.compiler.2113538546" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.904888562" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease" parent="com.intel.sgx.configuration.HW.Prerelease">
<folderInfo id="com.intel.sgx.configuration.HW.Prerelease.2074448686" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Prerelease.2016152654" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Prerelease">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.1520324017" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_PRERELEASE=1 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder5.293910513" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder5"/>
<tool id="com.intel.sgx.compiler.845441552" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.199398937" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.283498732" superClass="com.intel.sgx.inputType"/>
<inputType id="com.intel.sgx.inputType.1555926498" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
@ -134,7 +134,7 @@
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.intel.sgx.configuration.HW.Release">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="SGX Release HW Mode">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.intel.sgx.configuration.HW.Release" moduleId="org.eclipse.cdt.core.settings" name="Intel(R) SGX Hardware Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
@ -149,16 +149,16 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="SGX Release HW Mode" parent="com.intel.sgx.configuration.HW.Release">
<folderInfo id="com.intel.sgx.configuration.HW.Release.1657582763" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Release.465410401" name="SGX GCC" superClass="com.intel.sgx.toolChain.HW.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.828352216" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.714105790" keepEnvironmentInBuildfile="false" name="Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
<tool id="com.intel.sgx.compiler.595797282" name="SGX GCC Compiler" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.1385078253" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/intel/sgxsdk/include"/>
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release" parent="com.intel.sgx.configuration.HW.Release">
<folderInfo id="com.intel.sgx.configuration.HW.Release.1347223665" name="/" resourcePath="">
<toolChain id="com.intel.sgx.toolChain.HW.Release.1050674831" name="Intel(R) SGX" superClass="com.intel.sgx.toolChain.HW.Release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.intel.sgx.targetEnclave.987781695" isAbstract="false" superClass="com.intel.sgx.targetEnclave"/>
<builder arguments="SGX_DEBUG=0 SGX_MODE=HW -f Makefile" command="make" id="com.intel.sgx.builder6.484951388" keepEnvironmentInBuildfile="false" name="Intel(R) Software Guard Extensions Linux Builder" superClass="com.intel.sgx.builder6"/>
<tool id="com.intel.sgx.compiler.945246695" name="Intel(R) SGX" superClass="com.intel.sgx.compiler">
<option id="com.intel.sgx.option.includePath.119487102" superClass="com.intel.sgx.option.includePath" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${SGX_SDK}/include&quot;"/>
</option>
<inputType id="com.intel.sgx.inputType.463677873" superClass="com.intel.sgx.inputType"/>
<inputType id="com.intel.sgx.inputType.593431891" superClass="com.intel.sgx.inputType"/>
</tool>
</toolChain>
</folderInfo>
@ -168,50 +168,47 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="LocalAttestation.null.1312290154" name="LocalAttestation"/>
<project id="LocalAttestation.cdt.managedbuild.target.gnu.exe.872917958" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="SGX Debug HW Mode">
<configuration configurationName="Intel(R) SGX Hardware Debug">
<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
</configuration>
<configuration configurationName="SGX Debug Sim Mode">
<configuration configurationName="Intel(R) SGX Simulation Debug">
<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
</configuration>
<configuration configurationName="Debug">
<configuration configurationName="Intel(R) SGX Hardware Prerelease">
<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
</configuration>
<configuration configurationName="Release">
<configuration configurationName="Intel(R) SGX Simulation">
<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
</configuration>
<configuration configurationName="SGX Release HW Mode">
<configuration configurationName="Intel(R) SGX Hardware Release">
<resource resourceType="PROJECT" workspacePath="/LocalAttestation"/>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.680828348;cdt.managedbuild.config.gnu.exe.release.680828348.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2137539087;cdt.managedbuild.tool.gnu.c.compiler.input.762444756">
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1347223665;com.intel.sgx.compiler.945246695;com.intel.sgx.inputType.593431891">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.935873960;com.intel.sgx.compiler.81269967;com.intel.sgx.inputType.742388855">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.428839196;com.intel.sgx.compiler.301453474;com.intel.sgx.inputType.596141238">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1609650460;cdt.managedbuild.config.gnu.exe.debug.1609650460.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1644119147;cdt.managedbuild.tool.gnu.c.compiler.input.938348551">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.SGXtoolChain.977521771;com.intel.sgx.SGXtoolChain.977521771.100429378;com.intel.sgx.compiler.787445976;com.intel.sgx.inputType.1814458059">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Release;com.intel.sgx.configuration.Sim.Release.151408355;com.intel.sgx.compiler.1302347316;com.intel.sgx.inputType.640775034">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1377487595;cdt.managedbuild.config.gnu.exe.debug.1377487595.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1972419354;cdt.managedbuild.tool.gnu.c.compiler.input.1480710981">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1394873887;cdt.managedbuild.config.gnu.exe.release.1394873887.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.2035356548;cdt.managedbuild.tool.gnu.c.compiler.input.793813290">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Release;com.intel.sgx.configuration.HW.Release.1657582763;com.intel.sgx.compiler.595797282;com.intel.sgx.inputType.463677873">
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.562917509;com.intel.sgx.compiler.1898704176;com.intel.sgx.inputType.393162412">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.Sim.Debug;com.intel.sgx.configuration.Sim.Debug.292452237;com.intel.sgx.compiler.1853780321;com.intel.sgx.inputType.1817588305">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Debug;com.intel.sgx.configuration.HW.Debug.971320034;com.intel.sgx.compiler.1085280084;com.intel.sgx.inputType.79844751">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.1418650208;com.intel.sgx.compiler.2113538546;com.intel.sgx.inputType.283498732">
<scannerConfigBuildInfo instanceId="com.intel.sgx.configuration.HW.Prerelease;com.intel.sgx.configuration.HW.Prerelease.2074448686;com.intel.sgx.compiler.845441552;com.intel.sgx.inputType.1555926498">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.intel.sgx.SGXPerProjectProfile"/>
</scannerConfigBuildInfo>
</storageModule>

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="com.intel.sgx.configuration.Sim.Debug" name="Intel(R) SGX Simulation Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.Sim.Release" name="Intel(R) SGX Simulation">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Debug" name="Intel(R) SGX Hardware Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Prerelease" name="Intel(R) SGX Hardware Prerelease">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.intel.sgx.configuration.HW.Release" name="Intel(R) SGX Hardware Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider" name="CDT User Setting Entries" prefer-non-shared="true" store-entries-with-project="true">
<resource project-relative-path="">
<entry kind="includePath" name="${SGX_SDK}/include">
<flag value="LOCAL"/>
</entry>
</resource>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,11 +1,12 @@
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -0,0 +1,10 @@
Enclave1.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
local:
*;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,11 +1,12 @@
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -0,0 +1,10 @@
Enclave2.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
local:
*;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,11 +1,12 @@
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>
<EnclaveConfiguration>
<ProdID>0</ProdID>
<ISVSVN>0</ISVSVN>
<StackMaxSize>0x40000</StackMaxSize>
<HeapMaxSize>0x100000</HeapMaxSize>
<TCSNum>1</TCSNum>
<TCSPolicy>1</TCSPolicy>
<!-- Recommend changing 'DisableDebug' to 1 to make the enclave undebuggable for enclave release -->
<DisableDebug>0</DisableDebug>
<MiscSelect>0</MiscSelect>
<MiscMask>0xFFFFFFFF</MiscMask>
</EnclaveConfiguration>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -0,0 +1,10 @@
Enclave3.so
{
global:
g_global_data_sim;
g_global_data;
enclave_entry;
g_peak_heap_used;
local:
*;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2011-2016 Intel Corporation. All rights reserved.
* Copyright (C) 2011-2017 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

Some files were not shown because too many files have changed in this diff Show More