diff --git a/License.txt b/License.txt index e63a2001..26e070ee 100644 --- a/License.txt +++ b/License.txt @@ -30,12 +30,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================= -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_pce.signed.so is licensed under 3-Clause BSD License. @@ -976,83 +970,8 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -16. Eclipse Plug-in -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: -i) changes to the Program, and -ii) additions to the Program; -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -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. - - - - -17. TCMALLOC +16. TCMALLOC TCMALLOC is part of Google Perf Tools, which is distributed under the terms of the BSD license. diff --git a/Linux_SGXEclipsePlugin/build.sh b/Linux_SGXEclipsePlugin/build.sh deleted file mode 100755 index e4bd19a9..00000000 --- a/Linux_SGXEclipsePlugin/build.sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/bash -export PATH=/home/jenkins/jdk/bin/:$PATH - - -# Get the Eclipse launcher and build script to use -set -x -set -e - -TRUNK_HOME=$(cd $(pwd)/../../ ; pwd) -#gives you the posibility to overwrite eclipse, if you do not use URL -[ -n "${ECLIPSE_HOME}" ] || { echo "using default ECLIPSE_HOME=${TRUNK_HOME}/eclipse"; ECLIPSE_HOME=${TRUNK_HOME}/eclipse; } - - -BUILD_RELEASE_ID_PREFIX=Linux_SGX_1.5 - -if [ "$RELEASE_ID" != "${RELEASE_ID%$BUILD_RELEASE_ID_PREFIX*}" ]; then - echo "$BUILD_RELEASE_ID_PREFIX IS in $RELEASE_ID, so it is an triggered build. Change the RELEASE_ID to an accepted form." - temp=${RELEASE_ID#$BUILD_RELEASE_ID_PREFIX} - RELEASE_ID=v`echo ${temp} | tr -d _ | tr -d -` -else - echo "$BUILD_RELEASE_ID_PREFIX is NOT in $RELEASE_ID. Keeping the user specified RELEASE_ID." -fi - -function main() { - validate-jenkins-parameters - cleanupPreBuild - checkEnvironment - buildPlugin - archivePlugin -} - -function validate-jenkins-parameters { - validate-parameter "DELETE_CURRENT_ECLIPSE" "$DELETE_CURRENT_ECLIPSE" - [[ "ECLIPSE_DOWNLOAD_URL" != "" ]] && - echo "[WARNING] ECLIPSE_DOWNLOAD_URL is not set; assume eclipse archive is already downloaded" -} - -function validate-parameter { - local NAME="$1" - local VALUE="$2" - [[ ! -z "$VALUE" ]] || { - echo "Mandatory Jenkins parameter '\$$NAME' not set !" - exit 1 - } -} - -function cleanupPreBuild() { - ./clean.sh - - [[ "false" == "${DELETE_CURRENT_ECLIPSE}" ]] || { - forceRemoveEclipse - } -} - -function forceRemoveEclipse() { - pushd ${TRUNK_HOME} - rm -fr eclipse - popd -} - -function checkEnvironment() { - if [ ! -d "${ECLIPSE_HOME}" ]; then - echo "Eclipse does not exist" - echo "Downloading eclipse" - - getEclipse - fi - - if [ -z "$RELEASE_ID" ]; then - echo "Mandatory variable RELEASE_ID not defined; exiting" - exit - fi -} - -function getEclipse() { - local eclipseArchiveURL="${ECLIPSE_DOWNLOAD_URL}" - - pushd $TRUNK_HOME - cleanupEclipseArchive - downloadEclipse "${eclipseArchiveURL}" - unzipEclipse - installPDE - cleanupEclipseArchive - popd -} - -function cleanupEclipseArchive() { - find . -maxdepth 1 -mindepth 1 -name "*eclipse*.zip*" | xargs rm -f -} - -function downloadEclipse() { - local URL="$1" - if [[ "$1" != "" ]] ; then - echo " wget --no-proxy "$1"" - wget --no-proxy "$1" - else - echo "skip downloaded empty url" - fi - -} - -function unzipEclipse() { - pwd - rm -fr eclipse - local eclipseArchiveName="$(find . -maxdepth 1 -mindepth 1 -name "*eclipse*.zip*")" - unzip "${eclipseArchiveName}" - - [[ -d eclipse ]] || { - echo "Eclipse directory does not exist!" - exit - } - -# local eclipseFolderName=${eclipseArchiveName%.zip} -# local eclipseArchiveName="eclipse" -# mv "${eclipseFolderName}" eclipse -} - -function installPDE() { -echo "~~~~>" -pwd -${ECLIPSE_HOME}/eclipse -nosplash \ - -application org.eclipse.equinox.p2.director \ - -repository http://download.eclipse.org/eclipse/updates/4.4 \ - -destination ${ECLIPSE_HOME} \ - -installIU org.eclipse.pde.source.feature.group \ - -installIU org.eclipse.pde.feature.group -} - -function preBuild() { - local BUILDDIR="$1" - local BUILDDIRWORK="$2" - - local SITEFILE="$BUILDDIRWORK/sites/site.xml" - local FEATUREDIR="$BUILDDIRWORK/features" - local FEATUREFILE="feature.xml" - local PLUGINDIR="$BUILDDIRWORK/plugins" - local PLUGINFILE="META-INF/MANIFEST.MF" - - local ROOTDIR=$(dirname "$0")"/.." - local VERSION=$(awk '/STRFILEVER/ {print $3}' ${ROOTDIR}/common/inc/internal/se_version.h|sed 's/^\"\(.*\)\"$/\1/') - VERSION=$(echo "$VERSION" | awk -F'.' '{for(i=1; i<=NF&&i<=3; i++) if(i==1){version=$i} else{version=version"."$i}}; END{print version}') - - if [[ "$VERSION" =~ ^[0-9]{1,}(.[0-9]{1,}){2}$ ]]; then - rm -fr "$BUILDDIRWORK" - cp -fr "$BUILDDIR" "$BUILDDIRWORK" - - #site.xml - sed -i "s#[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{0,2\}\.qualifier#$VERSION\.qualifier#g" "$SITEFILE" - - #feature - for DIR in $(ls "$FEATUREDIR"); do - sed -i "s#[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{0,2\}\.qualifier#$VERSION\.qualifier#g" "$FEATUREDIR/$DIR/$FEATUREFILE" - done - - #plugin - for DIR in $(ls "$PLUGINDIR"); do - sed -i "s#[0-9]\{1,\}\(\.[0-9]\{1,\}\)\{0,2\}\.qualifier#$VERSION\.qualifier#g" "$PLUGINDIR/$DIR/$PLUGINFILE" - done - fi -} - -function postBuild() { - local BUILDDIR="$1" - local BUILDDIRWORK="$2" - local UPDATESITEDIR="updatesite" - - if [[ -d "$BUILDDIRWORK" ]] && [[ -d "$BUILDDIRWORK/$UPDATESITEDIR" ]]; then - rm -fr "$BUILDDIR/$UPDATESITEDIR" - cp -fr "$BUILDDIRWORK/$UPDATESITEDIR" "$BUILDDIR/$UPDATESITEDIR" - rm -fr "$BUILDDIRWORK" - fi -} - -function buildPlugin() { - pwd - - echo "PWD=`pwd`" - echo "ECLIPSE_HOME=$ECLIPSE_HOME" - - #BASELOCATION="$PWD/target_platform" - BASELOCATION="$ECLIPSE_HOME" - BUILDVERSION="$RELEASE_ID" - BUILDDIR="$PWD/build_directory" - BUILDDIRWORK="$PWD/.build_directory" - BUILDCONFIG="$PWD/build_config" - LAUNCHER=`findFirst "$ECLIPSE_HOME"/plugins/org.eclipse.equinox.launcher_*.jar` - BUILDFILE=`findFirst "$ECLIPSE_HOME"/plugins/org.eclipse.pde.build_*/scripts/build.xml` - - # make sure we found valid files - if [ ! -f "$LAUNCHER" ]; then - echo "Installation Error: Eclipse plugin org.eclipse.equinox.launcher...jar not detected. " \ - "Found '$LAUNCHER'. Aborting." - exit 1 - fi - if [ ! -f "$BUILDFILE" ]; then - echo "Installation Error: Eclipse build file org.eclipse.pde.build_.../scripts/build.xml " \ - "not detected. Found '$BUILDFILE'. Aborting." - exit 1 - fi - - preBuild "$BUILDDIR" "$BUILDDIRWORK" - - # - # -- Print configuration used and actually execute the build -- - # - echo "Eclipse configuration found:" - echo " Eclipse Home: $ECLIPSE_HOME" - echo " Launcher: $LAUNCHER" - echo " Build File: $BUILDFILE" - echo " Build Config: $BUILDCONFIG" - echo " Base Location: $BASELOCATION" - echo " Build Directory: $BUILDDIRWORK" - echo " Build Version: $BUILDVERSION" - echo " Java: " $(which java) - java -version - -# CURRENT_DIR=$(pwd) -# ${ECLIPSE_HOME}/eclipse -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/${CURRENT_DIR}/build_directory/updatesite/sgx-eclipse-plugin -artifactRepository file:/${CURRENT_DIR}/build_directory/updatesite/featuresAndBundles -source ${CURRENT_DIR}/build_directory/ -config gtk.linux.x86 -compress -publishArtifacts -# cp ./build_directory/updatesite/featuresAndBundles/artifacts.jar ./build_directory/updatesite/sgx-eclipse-plugin/ - - java \ - -jar $LAUNCHER \ - -application org.eclipse.ant.core.antRunner \ - -buildfile $BUILDFILE \ - -DbuildDirectory=$BUILDDIRWORK \ - -DbaseLocation=$BASELOCATION \ - -Dbuilder=$BUILDCONFIG \ - -DforceContextQualifier=$BUILDVERSION \ - -v -v -v -v - - postBuild "$BUILDDIR" "$BUILDDIRWORK" -} - -function findFirst() { - echo "enter Find First, $@" 1>&2 - for i in "$@"; do - if [ -f "$i" ]; then - echo "found $i" 1>&2 - echo "$i" - return - fi - done -} - -function archivePlugin() { - pushd build_directory/updatesite/sgx-eclipse-plugin - zip -r Intel-sgx-eclipse-plugin.zip * - popd -} - -main diff --git a/Linux_SGXEclipsePlugin/build_config/allElements.xml b/Linux_SGXEclipsePlugin/build_config/allElements.xml deleted file mode 100644 index 0bb50165..00000000 --- a/Linux_SGXEclipsePlugin/build_config/allElements.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_config/build.properties b/Linux_SGXEclipsePlugin/build_config/build.properties deleted file mode 100644 index beda7eaf..00000000 --- a/Linux_SGXEclipsePlugin/build_config/build.properties +++ /dev/null @@ -1,307 +0,0 @@ - -############################################################################### -# Copyright (c) 2003, 2011 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -# Compuware Corporation - Sebastien Angers -# - Enabled additional mirror slicingOptions in Headless PDE Build -# - Enabled 'raw' attribute for mirror step in Headless PDE Build -# - https://bugs.eclipse.org/338878 -############################################################################### -##################### -# Parameters describing how and where to execute the build. -# Typical users need only update the following properties: -# baseLocation - where things you are building against are installed -# bootclasspath - The base jars to compile against (typicaly rt.jar) -# configs - the list of {os, ws, arch} configurations to build. -# -# Of course any of the settings here can be overridden by spec'ing -# them on the command line (e.g., -DbaseLocation=d:/eclipse - -#The type of the top level element we are building, generally "feature" -topLevelElementType = feature -#The id of the top level element we are building -# the following feature will not be include in the final archive -topLevelElementId = com.intel.sgx.build.driver - -############# PRODUCT/PACKAGING CONTROL ############# -#product=/plugin or feature id/path/to/.product -#product=com.intel.sgx.feature -runPackager=false - -#Set the name of the archive that will result from the product build. -#archiveNamePrefix= - -# The prefix that will be used in the generated archive. -archivePrefix=sgx-eclipse-plugin - -# The location underwhich all of the build output will be collected. -collectingFolder=${archivePrefix} - -# The list of {os, ws, arch} configurations to build. This -# value is a '&' separated list of ',' separate triples. For example, -# configs=win32,win32,x86 & linux,motif,x86 -# By default the value is *,*,* -configs = *, *, * -#configs=win32, win32, x86 & \ -# win32,win32,x86_64 & \ -# win32,win32,wpf & \ -# linux, gtk, ppc & \ -# linux, gtk, x86 & \ -# linux, gtk, x86_64 & \ -# linux, motif, x86 & \ -# solaris, motif, sparc & \ -# solaris, gtk, sparc & \ -# aix, motif, ppc & \ -# hpux, motif, ia64_32 & \ -# macosx, carbon, ppc & \ -# macosx, carbon, x86 & \ -# macosx, cocoa, ppc & \ -# macosx, cocoa, x86 & \ -# macosx, cocoa, x86_64 - -# By default PDE creates one archive (result) per entry listed in the configs property. -# Setting this value to true will cause PDE to only create one output containing all -# artifacts for all the platforms listed in the configs property. -# To control the output format for the group, add a "group, group, group - " entry to the -# archivesFormat. -#groupConfigurations=true - -#The format of the archive. By default a zip is created using antZip. -#The list can only contain the configuration for which the desired format is different than zip. -#archivesFormat=win32, win32, x86 - antZip& \ -# linux, gtk, ppc - antZip &\ -# linux, gtk, x86 - antZip& \ -# linux, gtk, x86_64 - antZip& \ -# linux, motif, x86 - antZip& \ -# solaris, motif, sparc - antZip& \ -# solaris, gtk, sparc - antZip& \ -# aix, motif, ppc - antZip& \ -# hpux, motif, PA_RISC - antZip& \ -# macosx, carbon, ppc - antZip - -#Allow cycles involving at most one bundle that needs to be compiled with the rest being binary bundles. -allowBinaryCycles = true - -#Sort bundles depenedencies across all features instead of just within a given feature. -#flattenDependencies = true - -#Parallel compilation, requires flattenedDependencies=true -#parallelCompilation=true -#parallelThreadCount= -#parallelThreadsPerProcessor= - -#Set to true if you want the output to be ready for an update jar (no site.xml generated) -outputUpdateJars = true - -#Set to true for Jnlp generation -#codebase should be a URL that will be used as the root of all relative URLs in the output. -#generateJnlp=false -#jnlp.codebase= -#jnlp.j2se= -#jnlp.locale= -#jnlp.generateOfflineAllowed=true or false generate attribute in the generated features -#jnlp.configs=${configs} #uncomment to filter the content of the generated jnlp files based on the configuration being built - -#Set to true if you want to sign jars -#signJars=false -#sign.alias= -#sign.keystore= -#sign.storepass= -#sign.keypass= - -#Arguments to send to the zip executable -zipargs= - -#Arguments to send to the tar executable -tarargs= - -#individualSourceBundles=true - -#Control the creation of a file containing the version included in each configuration - on by default -#generateVersionsLists=false - -############ REPO MIRROR OPTIONS CONTROL ############ -# Default values for the slicingOptions and raw attribute of the p2.mirror Ant target used to generate the p2 repo (buildRepo) -# Note that the default values used by PDE/Build are different from the default values for p2.mirror's slicingOptions and raw attribute -# See http://help.eclipse.org/topic//org.eclipse.platform.doc.isv/guide/p2_repositorytasks.htm for the details -# of each setting. -#p2.mirror.slicing.filter= -#p2.mirror.slicing.followOnlyFilteredRequirements=false -#p2.mirror.slicing.followStrict=false -#p2.mirror.slicing.includeFeatures=true -#p2.mirror.slicing.includeNonGreedy=false -#p2.mirror.slicing.includeOptional=true -#p2.mirror.slicing.platformFilter= -#p2.mirror.slicing.latestVersionOnly=false - -#p2.mirror.raw=false - -############## SOURCE BUNDLE CONTROL ################ -# Set this property to have source bundles created and output into build repository. -# This does NOT put them in the build output (e.g., product) itself. -# Valid values are: not set, built, all. -# built = only source for bundles that are actually built/compiled in this run are output -# all = all available source is collected and output -#sourceBundleMode=all - -# When outputting autogenerated source bundles a feature is created to contain all the automatic -# source bundles. Typically this feature is not needed and can be ignored. As such, it is given a default -# name and version. These properties can be used to override the defaults. -# sourceBundleTemplateFeature - can specify an existing feature which will be augmented to form the generated source feature -# sourceBundleFeatureId - will be the id of generated source feature which contains all the generated source bundles, default value -# is sourceBundleTemplateFeature + ".source" if sourceBundleTemplateFeature is specified -#sourceBundleTemplateFeature= -#sourceBundleFeatureId= -#sourceBundleFeatureVersion= - -############## BUILD NAMING CONTROL ################ -# The directory into which the build elements are fetched and where -# the build takes place. -#buildDirectory= - -# Type of build. Used in naming the build output. Typically this value is -# one of I, N, M, S, ... -buildType=build - -# ID of the build. Used in naming the build output. -buildId=${forceContextQualifier} - -# Label for the build. Used in naming the build output -buildLabel=${buildId} - -# Timestamp for the build. Used in naming the build output -timestamp=007 - -#The value to be used for the qualifier of a plugin or feature when you want to override the value computed by pde. -#The value will only be applied to plugin or features indicating build.properties, qualifier = context -#forceContextQualifier= - -#Enable / disable the generation of a suffix for the features that use .qualifier. -#The generated suffix is computed according to the content of the feature -#generateFeatureVersionSuffix=true - -############# BASE CONTROL ############# -# Settings for the base Eclipse components and Java class libraries -# against which you are building. -# Base location for anything the build needs to compile against. For example, -# in most RCP app or a plug-in, the baseLocation should be the location of a previously -# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack. - -base= -#baseLocation= - -#Folder containing repositories whose content is needed to compile against -#repoBaseLocation=${base}/repos -#Folder where the content of the repositories from ${repoBaseLocation} will be made available as a form suitable to be compiled against -#transformedRepoLocation=${base}/transformedRepos - -#Os/Ws/Arch/nl of the eclipse specified by baseLocation -baseos=win32 -basews=win32 -basearch=x86 - -#this property indicates whether you want the set of plug-ins and features to be considered during the build to be limited to the ones reachable from the features / plugins being built -filteredDependencyCheck=false - -#this property indicates whether the resolution should be done in development mode (i.e. ignore multiple bundles with singletons) -resolution.devMode=false - -#pluginPath is a list of locations in which to find plugins and features. This list is separated by the platform file separator (; or :) -#a location is one of: -#- the location of the jar or folder that is the plugin or feature : /path/to/foo.jar or /path/to/foo -#- a directory that contains a /plugins or /features subdirectory -#- the location of a feature.xml, or for 2.1 style plugins, the plugin.xml or fragment.xml -#pluginPath= - -skipBase=true -eclipseURL= -eclipseBuildId= -eclipseBaseURL=${eclipseURL}/eclipse-platform-${eclipseBuildId}-win32.zip - - -############# MAP FILE CONTROL ################ -# This section defines CVS tags to use when fetching the map files from the repository. -# If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml - -skipMaps=true -mapsRepo=:pserver:anonymous@example.com/path/to/repo -mapsRoot=path/to/maps -mapsCheckoutTag=HEAD - -#tagMaps=true -mapsTagTag=v${buildId} - - -############ REPOSITORY CONTROL ############### -# This section defines properties parameterizing the repositories where plugins, fragments -# bundles and features are being obtained from. - -# The tags to use when fetching elements to build. -# By default thebuilder will use whatever is in the maps. -# This value takes the form of a comma separated list of repository identifier (like used in the map files) and the -# overriding value -# For example fetchTag=CVS=HEAD, SVN=v20050101 -# fetchTag=HEAD -skipFetch=true - - -############# JAVA COMPILER OPTIONS ############## -# The location of the Java jars to compile against. Typically the rt.jar for your JDK/JRE -#bootclasspath=${java.home}/lib/rt.jar - -# specific JRE locations to compile against. These values are used to compile bundles specifying a -# Bundle-RequiredExecutionEnvironment. Uncomment and set values for environments that you support -#CDC-1.0/Foundation-1.0= /path/to/rt.jar -#CDC-1.1/Foundation-1.1= -#OSGi/Minimum-1.0= -#OSGi/Minimum-1.1= -#JRE-1.1= -#J2SE-1.2= -#J2SE-1.3= -#J2SE-1.4= -#J2SE-1.5= -#JavaSE-1.6= -#PersonalJava-1.1= -#PersonalJava-1.2= -#CDC-1.0/PersonalBasis-1.0= -#CDC-1.0/PersonalJava-1.0= -#CDC-1.1/PersonalBasis-1.1= -#CDC-1.1/PersonalJava-1.1= - -# Specify the output format of the compiler log when eclipse jdt is used -logExtension=.log - -# Whether or not to include debug info in the output jars -javacDebugInfo=false - -# Whether or not to fail the build if there are compiler errors -javacFailOnError=true - -# Enable or disable verbose mode of the compiler -javacVerbose=true - -# Extra arguments for the compiler. These are specific to the java compiler being used. -#compilerArg= - -# Default value for the version of the source code. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacSource in build.properties -javacSource=1.6 - -# Default value for the version of the byte code targeted. This value is used when compiling plug-ins that do not set the Bundle-RequiredExecutionEnvironment or set javacTarget in build.properties. -javacTarget=1.6 - -################### CUSTOM PROPERTIES ####################################### -# repository location for update site -# comment out - this is passed in from command line -updateSiteSource=${buildDirectory}/sites -# where to place update site build -#updateSiteRoot=${user.home}/www/no_crawl/ -updateSiteRoot=${buildDirectory}/updatesite -updateSiteFolder=${archivePrefix} -updateSiteDestination=${updateSiteRoot}/${updateSiteFolder} - diff --git a/Linux_SGXEclipsePlugin/build_config/buildUpdateSite.xml b/Linux_SGXEclipsePlugin/build_config/buildUpdateSite.xml deleted file mode 100644 index 968a22e1..00000000 --- a/Linux_SGXEclipsePlugin/build_config/buildUpdateSite.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_config/customAssembly.xml b/Linux_SGXEclipsePlugin/build_config/customAssembly.xml deleted file mode 100644 index ebe2861d..00000000 --- a/Linux_SGXEclipsePlugin/build_config/customAssembly.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_config/customTargets.xml b/Linux_SGXEclipsePlugin/build_config/customTargets.xml deleted file mode 100644 index 24d4c339..00000000 --- a/Linux_SGXEclipsePlugin/build_config/customTargets.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/.project b/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/.project deleted file mode 100644 index 5027fb15..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - com.intel.sgx.feature - - - - - - org.eclipse.pde.FeatureBuilder - - - - - - org.eclipse.pde.FeatureNature - - diff --git a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/build.properties b/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/build.properties deleted file mode 100644 index 53fa32b9..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/build.properties +++ /dev/null @@ -1,15 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - -bin.includes = feature.xml,\ - build.properties -generate.plugin@com.intel.sgx.source = com.intel.sgx.feature diff --git a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/feature.xml b/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/feature.xml deleted file mode 100644 index 8cdc2628..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/features/com.intel.sgx.feature/feature.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - The Intel(R) Software Guard Extensions Plug-in enables Independent Service -Vendors in developing Linux applications -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 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 Intel(R) SGX Nature. -Once development is complete, the developer can build the Enclave -and the Linux project using the Intel(R) SGX SDK for Linux with Release/Debug Configurations in Simulation/Hardware -mode and Hardware Prerelease mode. - - - - All rights reserved with Intel Corporation and its Licensors. - - - - Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and -b) in the case of each subsequent Contributor: -i) changes to the Program, and -ii) additions to the Program; -where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. - -2. GRANT OF RIGHTS - -a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. -b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. -c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program. -d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: - -a) it complies with the terms and conditions of this Agreement; and -b) its license agreement: -i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; -ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; -iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and -iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. -When the Program is made available in source code form: - -a) it must be made available under this Agreement; and -b) a copy of this Agreement must be included with each copy of the Program. -Contributors may not remove or alter any copyright notices contained within the Program. - -Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. - -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. - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.classpath b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.classpath deleted file mode 100644 index 28bf972d..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.classpath +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.project b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.project deleted file mode 100644 index 51125391..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/.project +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - com.intel.sgx.userguide - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/META-INF/MANIFEST.MF b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/META-INF/MANIFEST.MF deleted file mode 100644 index 0345f814..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/META-INF/MANIFEST.MF +++ /dev/null @@ -1,11 +0,0 @@ -License: Eclipse Public License Version 1.0 ("EPL") -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -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 -Bundle-Vendor: INTEL -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime -Bundle-ActivationPolicy: lazy diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/build.properties b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/build.properties deleted file mode 100644 index caa62d28..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - html/,\ - *.xml diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/A_Generated_Trusted_Library.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/A_Generated_Trusted_Library.png deleted file mode 100644 index 0f7841f8..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/A_Generated_Trusted_Library.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_Intel_SGX_Enclave_Dialog.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_Intel_SGX_Enclave_Dialog.png deleted file mode 100644 index 615efec7..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_Intel_SGX_Enclave_Dialog.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_SGX_Static_Trusted_Library_Dialog.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_SGX_Static_Trusted_Library_Dialog.png deleted file mode 100644 index ef31085c..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_New_SGX_Static_Trusted_Library_Dialog.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_Repository_Dialog.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_Repository_Dialog.png deleted file mode 100644 index 39e38291..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_Repository_Dialog.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Nature.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Nature.png deleted file mode 100644 index baa7992f..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Nature.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Untrusted_Module.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Untrusted_Module.png deleted file mode 100644 index 6c3625da..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Add_SGX_Untrusted_Module.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configurations_Specific_to_Intel_SGX_Technology.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configurations_Specific_to_Intel_SGX_Technology.png deleted file mode 100644 index e25f9b72..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configurations_Specific_to_Intel_SGX_Technology.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configure_SGX_Hardware_Release_Mode.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configure_SGX_Hardware_Release_Mode.png deleted file mode 100644 index 7e9cb59b..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Configure_SGX_Hardware_Release_Mode.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Copying_the_Untrusted_Module_to_a_Project.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Copying_the_Untrusted_Module_to_a_Project.png deleted file mode 100644 index 50d8073d..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Copying_the_Untrusted_Module_to_a_Project.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Customization_of_SGX_build_command.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Customization_of_SGX_build_command.png deleted file mode 100644 index 178f41be..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Customization_of_SGX_build_command.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Down_Arrow_Button.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Down_Arrow_Button.png deleted file mode 100644 index f85f93b4..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Down_Arrow_Button.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Enclave_Configuration_Settings.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Enclave_Configuration_Settings.png deleted file mode 100644 index d6900b59..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Enclave_Configuration_Settings.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog.png deleted file mode 100644 index 0d71612f..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog_with_Pre_configurations.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog_with_Pre_configurations.png deleted file mode 100644 index 12e5d665..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generate_Signed_Enclave_Dialog_with_Pre_configurations.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Sample_Untrusted_Application.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Sample_Untrusted_Application.png deleted file mode 100644 index 66c9e992..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Sample_Untrusted_Application.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Skeleton_for_an_Enclave.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Skeleton_for_an_Enclave.png deleted file mode 100644 index ae332e03..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generated_Skeleton_for_an_Enclave.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generating_Hash_Completion_Dialog.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generating_Hash_Completion_Dialog.png deleted file mode 100644 index 785bf796..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Generating_Hash_Completion_Dialog.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Import_or_Re_Generate_Enclave_Signing_Key.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Import_or_Re_Generate_Enclave_Signing_Key.png deleted file mode 100644 index a173f013..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Import_or_Re_Generate_Enclave_Signing_Key.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Configurations.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Configurations.png deleted file mode 100644 index d703ed50..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Configurations.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Tools.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Tools.png deleted file mode 100644 index a5ba0260..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Intel_SGX_Tools.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Makefile_for_Intel_SGX.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Makefile_for_Intel_SGX.png deleted file mode 100644 index 4bca62c6..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Makefile_for_Intel_SGX.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/New_Project.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/New_Project.png deleted file mode 100644 index 251c5c7e..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/New_Project.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Explorer.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Explorer.png deleted file mode 100644 index ea030759..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Explorer.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Menu.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Menu.png deleted file mode 100644 index 700cf5d6..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Project_Menu.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/SGX_Preference_Page.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/SGX_Preference_Page.png deleted file mode 100644 index 53d2437a..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/SGX_Preference_Page.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Sample_Application.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Sample_Application.png deleted file mode 100644 index 334a9fcf..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Sample_Application.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Select_Configuration_File.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Select_Configuration_File.png deleted file mode 100644 index c3b39b50..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Select_Configuration_File.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Location_of_the_Plugin_zip_Archive.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Location_of_the_Plugin_zip_Archive.png deleted file mode 100644 index 15aef08a..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Location_of_the_Plugin_zip_Archive.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Result_of_Running_Samples_Generated_for_Enclaves.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Result_of_Running_Samples_Generated_for_Enclaves.png deleted file mode 100644 index 146c0edf..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/The_Result_of_Running_Samples_Generated_for_Enclaves.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_StepSigne_Enclave_Generate_Hash.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_StepSigne_Enclave_Generate_Hash.png deleted file mode 100644 index 76207c84..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_StepSigne_Enclave_Generate_Hash.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_Step_Sign_Enclave_Menu.png b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_Step_Sign_Enclave_Menu.png deleted file mode 100644 index f45f0dd9..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Images/Two_Step_Sign_Enclave_Menu.png and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Stylesheets/intel_css_styles.css b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Stylesheets/intel_css_styles.css deleted file mode 100644 index df84eb4c..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/Resources/Stylesheets/intel_css_styles.css +++ /dev/null @@ -1,470 +0,0 @@ -/*************************************************************************/ -/* Copyright (c) 2018 Intel Corporation. */ -/* */ -/* All rights reserved. This program and the accompanying materials */ -/* are made available under the terms of the Eclipse Public License v1.0 */ -/* which accompanies this distribution, and is available at */ -/* http://www.eclipse.org/legal/epl-v10.html */ -/* */ -/* Contributors: */ -/* Intel Corporation - initial implementation and documentation */ -/*************************************************************************/ -/**/ - -/*begin-old-version{{*/ - -body -{ - color: #333333; - background-color: #ffffff; - font-family: "Intel Clear", Verdana, Arial, sans-serif; - margin-left: 30px; - margin-right: 30px; - margin-bottom: 7%; - color: #333333; - background-color: #ffffff; - font-family: "Intel Clear", Verdana, Arial, sans-serif; - margin-left: 30px; - margin-right: 30px; - margin-bottom: 7%; - font-size: 12pt; -} - -.RevUpdate -{ - background-color: #FFFF99; - font-weight: normal; - line-height: 100%; - background-color: #FFFF99; - font-weight: normal; - line-height: 100%; -} - -.NonStdFortran -{ - color: #007F00; - color: #007F00; -} - -body.OH_VSIP_body -{ - margin-left: 30px; - margin-left: 30px; -} - -DIV.OH_outerContent -{ - border: 0px none #FFFFFF; - border: 0px none #ffffff; -} - -h1 -{ - color: #0071c5; - font-size: 15pt; - font-weight: normal; - padding-bottom: 1px; - margin-left: 0pt; - margin-bottom: 0px; - color: #0071c5; - font-size: 15pt; - font-weight: normal; - padding-bottom: 1px; - margin-left: 0pt; - margin-bottom: 0px; -} - -h1.firsttitle -{ - font-weight: normal; - border-bottom: 0 none; - margin-left: 0; - font-size: 18pt; - border-bottom: 1px solid #0071c5; - line-height: 100%; - padding-bottom: 10px; - margin-bottom: 20px; - margin-top: 20px; - font-weight: normal; - border-bottom: 0 none; - margin-left: 0; - font-size: 18pt; - border-bottom: 1px solid #0071c5; - line-height: 100%; - padding-bottom: 10px; - margin-bottom: 20px; - margin-top: 20px; -} - -h2 -{ - color: #0071c5; - margin-top: 15pt; - margin-bottom: 5pt; - font-size: 12pt; - color: #0071c5; - margin-top: 15pt; - margin-bottom: 5pt; - font-size: 12pt; -} - -h3 -{ - color: #333333; - font-weight: bold; - margin-top: 15pt; - margin-bottom: 5pt; - font-size: 11pt; - color: #333333; - font-weight: bold; - margin-top: 15pt; - margin-bottom: 5pt; - font-size: 11pt; -} - -h4 -{ - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; -} - -h5 -{ - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; -} - -h6 -{ - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; - color: #0071c5; - margin-top: 10pt; - margin-bottom: 5pt; - padding-left: 0px; - font-size: 10pt; -} - -.relinfo -{ - padding-left: 30px; - padding-left: 30px; -} - -.tablecap -{ - color: #0071c5; -} - -caption -{ - font-weight: bold; - text-align: left; - font-weight: bold; - text-align: left; - font-size: 12pt; -} - -.figcap -{ - margin-left: 24px; - font-size: 10pt; - font-weight: bold; - text-align: center; - margin-left: 24px; - font-size: 10pt; - font-weight: bold; - text-align: center; -} - -.sectiontitle -{ - padding-left: 0px; - padding-left: 0px; -} - -.linklist -{ - padding-left: 0px; - padding-left: 0px; -} - -h1.topictitle1 -{ - color: #0071c5; - font-size: 18pt; - margin-left: 0pt; - margin-bottom: 15px; - color: #0071c5; - font-size: 18pt; - margin-left: 0pt; - margin-bottom: 15px; -} - -#header_text -{ - color: #0071C5; - text-align: right; - color: #0071C5; - text-align: right; -} - -.titlepage -{ - margin-right: 15%; - margin-right: 15%; -} - -.familylinks -{ - margin-top: 1em; - margin-top: 1em; -} - -a.start -{ - font-size: 18pt; - text-decoration: underline; - font-size: 18pt; - text-decoration: underline; -} - -a.underlined -{ - text-decoration: underline; - text-decoration: underline; -} - -.shortdesc -{ - font-size: inherit; - padding-left: inherit; - line-height: 16pt; - margin-top: 0px; - margin-bottom: 0.5em; - font-size: inherit; - padding-left: inherit; - line-height: 16pt; - margin-top: 0px; - margin-bottom: 0.5em; -} - -.shortdesc-it -{ - font-style: italic; - font-style: italic; -} - -p -{ - margin-left: 0px; - line-height: 120%; - margin-top: 0; - margin-bottom: 10px; - margin-left: 0px; - line-height: 120%; - margin-top: 0; - margin-bottom: 10px; - font-size: 12pt; -} - -.p -{ - font-size: inherit; - margin-left: 0px; - line-height: 170%; - margin-top: 0; - margin-bottom: 5pt; - padding-left: 0pt; - font-size: inherit; - margin-left: 0px; - line-height: 170%; - margin-top: 0; - margin-bottom: 5pt; - padding-left: 0pt; -} - -table -{ - margin-bottom: 5pt; - border-collapse: collapse; - margin-left: 0px; - margin-top: 0.3em; - font-size: 10pt; - margin-bottom: 5pt; - border-collapse: collapse; - margin-left: 0px; - margin-top: 0.3em; - font-size: 10pt; -} - -tr -{ - vertical-align: top; - vertical-align: top; -} - -DIV.Note -{ - margin-top: 20pt; - margin-bottom: 20pt; - margin-right: 0.46cm; - padding-left: 5px; - border-top-style: solid; - border-top-width: 1px; - border-bottom-style: solid; - border-bottom-width: 1px; - font-size: 10pt; -} - -p.NoteTipHead -{ - font-weight: bold; - font-style: italic; - margin-top: 9pt; - margin-bottom: 3pt; - line-height: 15pt; - margin-left: 0.202cm; - font-family: "Verdana", "sans-serif"; - text-transform: uppercase; - text-align: justify; - font-size: 12pt; -} - -MadCap|xref -{ - color: #0860a8; - mc-format: '{paratext}'; - text-decoration: none; - font-size: 12pt; -} - -div.NoteCont -{ - border-bottom-style: solid; - border-bottom-width: 1px; - border-top-style: solid; - border-top-width: 1px; - font-size: 10pt; -} - -p.figcap -{ - text-align: left; - font-size: 12pt; -} - -th -{ - text-align: left; - font-size: 12pt; -} - -ul -{ - font-size: 12pt; -} - -ol -{ - font-size: 12pt; -} - -li -{ - font-size: 12pt; -} - -b -{ - font-size: 12pt; -} - -code -{ - font-size: 12pt; -} - -a:link -{ - color: #0071c5; - text-decoration: none; - color: #0071c5; - text-decoration: none; -} - -a:visited -{ - color: #0071c5; - text-decoration: none; - color: #0071c5; - text-decoration: none; -} - -a:hover -{ - color: #00aeef; - text-decoration: underline; - color: #00aeef; - text-decoration: underline; -} - -a:active -{ - color: #0071c5; - text-decoration: underline; - color: #0071c5; - text-decoration: underline; -} - -a.start:visited -{ - color: #0071c5; - text-decoration: underline; - color: #0071c5; - text-decoration: underline; -} - -a.start:active -{ - color: #0071c5; - text-decoration: underline; - color: #0071c5; - text-decoration: underline; -} - -a.underlined:visited -{ - color: #0071c5; - text-decoration: underline; - color: #0071c5; - text-decoration: underline; -} - -a.underlined:active -{ - color: #0071c5; - text-decoration: underline; - color: #0071c5; - text-decoration: underline; -} - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/content.html b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/content.html deleted file mode 100644 index 47c712c7..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/html/content.html +++ /dev/null @@ -1,557 +0,0 @@ - - - - - - - - - -
-

Introduction

-

This Developer Guide is intended for use by Independent Service Vendors who wish to harden their Linux* applications using Intel(R) SGX Technology, code named Intel(R) Software Guard Extensions. The guide describes the procedure for installation of Intel(R) SGX Plugin for Eclipse* IDE and development of Intel(R) SGX components using the plugin. The Intel(R) SGX Plugin for Eclipse leverages on the Intel(R) Software Guard Extensions SDK, which is a collection of APIs, libraries and tools that enable you to develop, build and debug Intel(R) SGX applications in C/C++.

-

To learn more about the Intel(R) Software Guard Extensions SDK, see the Intel(R) Software Guard Extensions SDK for Linux* OS Developer Reference.

 
-
-

Introducing Intel(R) Software Guard Extensions

-

Intel(R) Software Guard Extensions is a new Intel technology, whose objective is to enable a high level of protection of secrets. It operates by allocating hardware-protected memory where code and data reside. The protected memory area within an application process is called an enclave. Data within the enclave memory can only be accessed by code that resides within that enclave. Enclave code can be invoked by special instructions.

-

An enclave can be built and loaded as a shared object.

-

Throughout this document, Intel(R) SGX refers to Intel(R) Software Guard Extensions.

-

An Intel(R) SGX application design is different from the design of non- Intel(R) SGX application as it specifies dividing the application into two logical parts:

-
    -
  • Trusted part. The code that accesses the secret resides here and it is called an enclave. More than one enclave can exist in an application.
  • -
  • Untrusted part. This includes the rest of the modules in the application, that is outside in an enclave.
  • -
-

The trusted components and untrusted components are developed as separate modules.

-

The trusted part or the enclave is implemented in C or C++. It is supplied as a collection of functions and data packaged in the form of a dynamically loaded library, a DLL in Windows* OS and a shared object in Linux* OS. It may be supplied either as a pre-built signed library or as a signed shared library built during compilation of the untrusted component.

-

Enclave functions within an enclave library are wrapped by auto-generated proxy and bridge functions that simplify the mechanism of using the Intel(R) SGX technology by developers.

-

The role of these functions is to handle the following tasks:

-
    -
  • Call an enclave function from untrusted code, also called an ECALL (enclave call).
  • -
  • Call an untrusted function from within an enclave, also called an OCALL (outside call).
  • -
  • Handle interrupts.
  • -
  • Handle exceptions.
  • -
-

The proxy and bridge functions are generated by the sgx_edger8r tool provided by Intel(R) SGX SDK. It reads an edl file (Enclave Descriptor Language) which describes the functions that form the trusted and untrusted component boundaries within the application.

-

After the enclave is built, a signed version of it is created using the tool sgx_sign also provided by Intel(R) SGX SDK. It is this signed version may be loaded and executed in the encrypted memory.

-

Enclaves may have some specific properties which are added as meta-information during the signing process. The meta-information is stored in one configuration xml file per enclave. See more details about meta-information in Intel(R) Software Guard Extensions SDK for Linux* OS Developer Reference.

-
-
-

Introducing Intel(R) Software Guard Extensions Eclipse* Plug-in

-

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 Adding Intel(R) SGX Nature to a Project for details.

-

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 sgx 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.

-

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 sgx_edger8r tool to generate the proxies and bridges, compile these source, generate a shared object and finally, to sign the enclave with the sgx_sign tool. This provide a starting point you may build upon.

-
-
-

Getting Started with Intel(R) Software Guard Extensions Eclipse* Plug-in

-

This section contains steps to set up your Intel(R) Software Guard Extensions Eclipse* Plug-in on a Linux* system, including necessary softwares, steps to install the product, and steps to configure your preferred product directory.

-

• Pre-requisites

-

• Installing Intel(R) Software Guard Extensions Eclipse* Plug-in

-

• Configuring Intel(R) Software Guard Extensions Eclipse* Plug-in

 
-
-

Pre-requisites

-

To use Intel(R) Software Guard Extensions Eclipse Plug-in, install the following softwares:

-
    -
  • Eclipse* Oxygen 3 with CDT IDE for C/C++ Developers (version 4.7.3). To use this version, install Java* Development Kit (JDK) or Java* Runtime Environment (JRE) version 1.8 or above.
  • -
  • gcc/g++ tools
  • -
  • Openssl*
  • -
  • Intel(R) SGX SDK for Linux* OS
  • -
-
-
-

Installing Intel(R) Software Guard Extensions Eclipse* Plug-in

-

Install Intel(R) Software Guard Extensions Eclipse* Plug-in as a regular Eclipse Plugin:

-
    -
  1. Download the zip archive of Intel(R) Software Guard Extensions Eclipse Plug-in from Intel Site
  2. -
  3. -

    Go to Help menu -> Install New Software. Click the Add button for the Work with field to open the Add Repository dialog as shown in the following graphic:

    -

    - -

    -

    Add Repository Dialog

    -
  4. -
  5. -

    Enter Intel(R) SGX Archive in the Name field . Click the Archive... button and select the location of the downloaded archive as shown in the following graphic:

    -

    - -

    -

    The Location of the Plugin zip Archive

    -
  6. -
  7. Press OK to add the archive as a repository.
  8. -
  9. In the Install dialog, select the Intel(R) Software Guard Extensions Plugin check-box and proceed with the usual steps.
  10. -
-
-
-

Configuring Intel(R) Software Guard Extensions Eclipse* Plug-in

-

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:

-
    -
  1. -

    Go to Window menu ->Preferences. Enter Intel(R) SGX in the filter text field to quickly locate the Intel(R) SGX Preferences page.

    -

    - -

    -

    Intel(R) SGX Preference Page

    -
  2. -
  3. Enter the path for Intel(R) SGX SDK for Linux OS in the Intel(R) SGX SDK Directory field.
  4. -
-
-
-

Command Reference

-

This topic provides the command reference for the following scenarios of using Intel(R) Software Guard Extensions Eclipse* Plug-in:

-
    -
  • Adding Intel(R) SGX nature to a project
  • -
  • Adding an Intel(R) SGX enclave
  • -
  • Adding an Intel(R) SGX trusted library
  • -
  • Adding an Intel(R) SGX untrusted module
  • -
  • Updating Intel(R) SGX enclave signing key
  • -
  • Updating enclave configuration files
  • -
  • Two steps sign enclave
  • -
-

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 Intel(R) Software Guard Extensions Tools:

 

Project Explorer

 
-
-

Adding Intel(R) SGX Nature to a Project

-

The nature 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 Intel(R) SGX nature 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.

-

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 Adding Intel(R) SGX Nature to a non-SGX project and Creating a New C/C++ Project with Intel(R) SGX Nature for how to complete these tasks.

-
-
-

Adding Intel(R) SGX Nature to a non-SGX project

-

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:

-
    -
  1. Right-click on the project root
  2. -
  3. -

    Select Intel(R) Software Guard Extensions Tools → Add Intel(R) SGX Nature

    -

    - -

    -

    Add Intel(R) SGX Nature

    -
  4. -
-

After you add the Intel(R) SGX nature to your project, you should see:

-
    -
  • -

    A subdirectory sgx in the project which contains a Makefile file.

    -

    - -

    -

    Makefile for Intel(R) SGX

    -
  • -
  • -

    The Intel(R) SGX tools as shown in the following graphic:

    -

    - -

    -

    Intel(R) SGX Tools

    -
  • -
  • -

    New configurations specific to Intel(R) SGX technology. You may see the configurations for the project by clicking to the down arrow of button usually found at the top of the Eclipse window:

    -

    - -

    -

    Configurations Specific to Intel(R) SGX Technology

    -
  • -
-
-
-

Creating a New C/C++ Project with Intel(R) SGX Nature

-

You can create a new project with Intel(R) SGX nature. To create such a project, follow these steps:

-
    -
  1. -

    Open a standard Eclipse new project: File menu → Project... . 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 New Project dialog.

    -

    - -

    -

    New Project

    -

    This category has 2 sub-categories, C project and C++ project. These sub-categories are similar to the sub-categories C Project and C++ Project of standard C/C++ category.

    -
  2. -
  3. Select one of the 2 sub-categories, C project or C++ project, and click Next.
  4. -
  5. Complete creating the project using the regular process of creating a standard C or C++ project.
  6. -
-
-

NOTE:

-

Projects created following the subcategories under C/C++ with Intel(R) SGX Enabled 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 Add Intel(R) SGX nature from it, as described in precedent paragraph.

-
-
-
-

Adding an Intel(R) SGX Enclave

-

After you add the Intel(R) SGX nature to a project, you can start creating a minimal but complete skeleton for a new enclave:

-
    -
  1. Right-click on the project root in Project Explorer.
  2. -
  3. -

    Open the dialog Add New Intel(R) SGX Enclave by selecting Intel(R) Software Guard Extensions Tools → Add Intel(R) SGX Enclave from the contextual menu.

    -

    - -

    -

    Add New Intel(R) SGX Enclave Dialog

    -
  4. -
  5. -

    Choose a name for the enclave in Enclave name 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.

    -
      -
    • -

      If you do not select the Generate sample untrusted application checkbox, the plugin generates only a trusted file and a Makefile fragment to build and compile the trusted part. See the following graphic. All the code for the enclave, including build Makefile, is put in a directory <root>/sgx/enclave_<name> . C/C++ code for the enclave proper are in <root>/sgx/enclave_<name>/trusted.

      -

      - -

      -

      Generated Skeleton for an Enclave. The option to Generate Sample was not Used

      -
    • -
    • -

      If you select Generate sample untrusted application checkbox, a simple ready to work sample application is generated, including untrusted stubs and implementation for a sample OCALL and ECALL.

      -

      - -

      -

      Generated Sample Untrusted Application

      -
    • -
    -
  6. -
-
-

NOTE:

-

If you select the Generate sample untrusted application 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 Index → Freshen All Files.

-
-
-
-

Adding an Intel(R) SGX Trusted Library

-

Trusted Static Libraries helps enclave author have libraries of shared code to be reused by enclaves, in exactly the same manner as usual static libxxx.a 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.

-

To add a new Intel(R) SGX Trusted Library:

-
    -
  1. -

    Open Add New Intel(R) SGX Static Trusted Library dialog by right-click on the root of the project and select the appropriate command from Intel(R) Software Guard Extensions Tools menu:

    -

    - -

    -

    Add New Intel(R) SGX Static Trusted Library Dialog

    -
  2. -
  3. -

    Choose a name for the library and click OK. A skeleton for a trusted library is generated in directory <root>/sgx/trustedlib_<name>:

    -

    - -

    -

    A Generated Trusted Library

    -
  4. -
-
-
-

Adding an Intel(R) SGX Untrusted Module

-

Add an untrusted module to generate the untrusted stubs so you use an enclave, provided you have access to its .edl file. The enclave might have been built in the current project or in a different project.

-

To use trusted functionality of an enclave for which its *.edl is known, use the command Add Intel(R) SGX Untrusted Module:

-
    -
  1. -

    Open dialog Add Intel(R) SGX Untrusted Module by right-click-ing the project root in Package Explorer and chose the command from Intel(R) Software Guard Extensions Tools.

    -

    - -

    -

    Add Intel(R) SGX Untrusted Module

    -
  2. -
  3. -

    Use the Browse button to navigate the file system using a file dialog, and click OK. The untrusted module is copied to <root>/sgx/untrusted_<edl file name>. The selected *.edl is copied to the project.

    -

    - -

    -

    Copying the Untrusted Module to a Project

    -
  4. -
-
-
-

Updating Intel(R) SGX Enclave Signing Key

-

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 Update Intel(R) SGX Enclave Signing Key to complete this task.

-
    -
  1. Choose Update Intel(R) SGX Enclave Signing Key by right-click on the project in Project Explorer -> Intel(R) Software Guard Extensions Tools menu. The Import or (Re)Generate Enclave Signing Key dialog appears.
  2. -
  3. In the Import or (Re)Generate Enclave Signing Key dialog, click Select to open a file dialog to select the output key.
  4. -
  5. -

    Click Import Key to update a selected signing key by copying another existing key or click Generate Key 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 Enclave Signing Key.

    -

    - -

    -

    Import or (Re)Generate Enclave Signing Key

    -
  6. -
  7. Click OK to update the enclave signing key.
  8. -
-

Under the hood, a new key is generated using openssl*, which needs to be installed on the machine:

-

openssl genrsa -out ../../../encl1_private.pem.key.pem -3 3072 -

-

-
-
-

Updating Enclave Configuration Files

-

A configuration file is an important part in the definition of an enclave. Intel(R) SGX SDK signer tool requires such *.xml configuration file as necessary input.

-

To update this configuration file, use the Update Config command:

-
    -
  1. -

    Right-click on the root project, Intel(R) Software Guard Extensions Tools->Select Config File.

    -

    - -

    -

    Select Configuration File

    -
  2. -
  3. -

    Click OK or double-click the selected configuration file to open the Enclave Configuration Settings dialog.

    -

    - -

    -

    Enclave Configuration Settings

    -

    For details on the meaning of the fields, see Intel(R) Software Guard Extensions Developer Guide.

    -
  4. -
-
-
-

Two Steps Sign Enclave

-

To help you develop enclaves, Intel(R) Software Guard Extensions Eclipse Plug-in generates all required structure including:

-
    -
  • c/c++ files and header files
  • -
  • .edl file
  • -
  • *.config.xml file
  • -
  • a sample Makefile
  • -
  • a sample signing key
  • -
-

While these structure might be appropriate for development and debugging, you need a 2-step process to integrate your own signing schema for generating production enclaves.

-
    -
  1. Generate hash: the signer tool generates signing material from the unsigned compiled enclave and from the configuration file for the enclave. The signed material comes as an opaque sequence of bytes which are put in a file with extension .hex. This file is used with the external signing facility. You come back with a signature for the .hex file plus the public key of your signing facility, and proceed to Step 2.
  2. -
  3. Generate signed enclaves : the signer tool generates the final signed enclave.
  4. -
-

To complete this task, provide the following input parameters:

-
    -
  • The unsigned enclave
  • -
  • The configuration file
  • -
  • The output file produced when you generate hash (the .hex file)
  • -
  • The files produced by the external signing facility: the signature of the .hex file and public key for it
  • -
  • The plugin checks if the input parameters are consistent:
  • -
  • The .hex file matches the unsigned enclave and the configuration file,
  • -
  • The signed material is verified with the public key
  • -
-

If the parameters are consistent, the production signed enclave is produced.

-
-

NOTE:

-

If you generate signed enclave right after generating hash, you can only enter the parameters specific for generating signed enclave.

-
-

To use the two-step signing function, activate the configuration Intel(R) SGX Hardware Release mode. 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.

-

- -

-

Configure Intel(R) SGX Hardware Release Mode

-

When you configure the plugin in the Intel(R) SGX Hardware Release Mode, you can see the Generate Hash and Generate Signed Enclave options through Intel(R) Software Guard Extensions Tools->Two Step Sign Enclave.

-

- -

-

Two Step Sign Enclave Menu

-
-
-

Generate Hash

-

Generating hash is the first step in the 2-Steps signing process.To generate hash, use the following steps:

-
    -
  1. -

    Right-click on project root, go to Intel(R) Software Guard Extensions Tools menu → Two Step Enclave Sign → Generate Hash

    -

    - -

    -

    Two Step Enclave Sign - Generate Hash

    -
  2. -
  3. In the Generate Hash dialog, enter the required inputs to the corresponding fields:
    • Enter the path to the compiled enclave to be signed in the Enclave Path field. Click Select Enclave to open a file dialog to select the enclave.
    • In the Hash File Location 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 .hex extension added. To change the path, click Select File Path to open a file dialog to select the file path.
    • In the Configuration File path field, enter the path of the configuration file for the generated hash. Click Select Config to open a dialog to select from all enclave configuration files in the project (similar with the one of the command Update Config).
  4. -
  5. -

    Click OK 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:

    -

    - -

    -

    Generating Hash Completion Dialog

    -
  6. -
-

You complete the first step, generating hash, in the two step signing enclave. The *.hex file may be signed with the external facility, which generates a signature for it and a public verification key.

-

If you click OK, the Generate Signed Enclave 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 *.hex file. To generated the final signed enclave ready for production immediately, click OK.

-

- -

-

Generate Signed Enclave Dialog with Pre-configurations

-

If you click Cancel in the Generate Signed Enclave dialog, you can continue the signing process later using the Generate Signed Enclave command.

-
-
-

Generate Signed Enclaves

-

Generating signed enclave is the second step in the 2-Steps signing process. You should have the following files to complete this step:

-
    -
  • The .hex file generated with Generate Hash command
  • -
  • The files produced from the external signing facility
  • -
  • The signature of the .hex file
  • -
  • The public verification key
  • -
-

To generate signed enclaves, use the following steps:

-
    -
  1. -

    Right-click on the project root, and go to Intel(R) Software Guard Extensions Tools menu → Two Step Sign Enclave → Generate Signed Enclave.

    -

    - -

    -

    Generate Signed Enclave Dialog

    -
  2. -
  3. Enter the inputs to all the fields and click OK.
  4. -
-
-
-

Building and Running Intel(R) SGX Code

-

This section describes the following topics about building and running Intel(R) SGX code:

-
    -
  • Intel(R) SGX build configurations
  • -
  • Running samples generated for enclaves
  • -
 
-
-

Intel(R) SGX Build Configurations

-

There are usually two types of builds that a regular non-SGX project defines:

-
    -
  • Debug
  • -
  • Release
  • -
-

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.

-

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.

-

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 Prerelease.

-

So there are five Intel(R) SGX related configurations when Intel(R) SGX Nature is added to a project:

-

- -

-

Intel(R) SGX Configurations

-

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):

-

Intel(R) SGX Configurations

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Configuration NameSimulation?Debug?Signing Schema
Intel(R) SGX Hardware DebugHardwareDebugSingle Step
Intel(R) SGX Hardware Pre-releaseHardwareNon-debugSingle Step
Intel(R) SGX Hardware ReleaseHardwareNon-debugTwo Step
Intel(R) SGX SimulationSimulationNon-debugSingle Step
Intel(R) SGX SimulationDebug SimulationDebugSingle step
-

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 sgx/Makefile.

-

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.

-

When Intel(R) SGX configurations are selected, by default only code under <root>/sgx directory get built.

-

You can customize Intel(R) SGX configurations as any other Eclipse build configurations from the project properties dialog. For example:

-
    -
  1. Right-click in Project Explorer Properties → C/C++ Build
  2. -
  3. Uncheck the Use default build command checkbox.
  4. -
-

Then you can customize and integrate Intel(R) SGX build process. You can use Makefile instead of sgx/Makefile in the example shown in the following figure:

-

- -

-

Customization of Intel(R) SGX Build Command

-

The build process is done using standard Eclipse interface for build, by example from the main Project menu:

-

- -

-

Project Menu

-
-
-

Running Samples Generated for Enclaves

-

Intel(R) Software Guard Extensions Eclipse* Plugin provides an option to generate a sample application together with the enclave code when the enclave is created. After the project is build, the sample application is built also and ready to run. You can see the sample application named sample in the enclave directory in Project Explorer. You can run this sample as a local C/C++ application as shown in the following figure:

-

- -

-

Sample Application

-

See the result of the execution in Eclipse console window as shown below:

-

- -

-

The Result of Running Samples Generated for Enclaves

-
- - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/plugin.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/plugin.xml deleted file mode 100644 index 72bccc33..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/plugin.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/src/com/intel/sgx/userguide/Activator.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/src/com/intel/sgx/userguide/Activator.java deleted file mode 100644 index 17b08462..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/src/com/intel/sgx/userguide/Activator.java +++ /dev/null @@ -1,73 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - -package com.intel.sgx.userguide; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "com.intel.sgx.userguide"; //$NON-NLS-1$ - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * Returns an image descriptor for the image file at the given - * plug-in relative path - * - * @param path the path - * @return the image descriptor - */ - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/toc.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/toc.xml deleted file mode 100644 index e906b73c..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx.userguide/toc.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.classpath b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.classpath deleted file mode 100644 index 57d8f4e3..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.classpath +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.project b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.project deleted file mode 100644 index c4a51afe..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.project +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - com.intel.sgx - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.settings/org.eclipse.jdt.core.prefs b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index a698e596..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,12 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/META-INF/MANIFEST.MF b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/META-INF/MANIFEST.MF deleted file mode 100644 index f06f84d7..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -License: Eclipse Public License Version 1.0 ("EPL") -bundle-ManifestVersion: 2 -Bundle-Name: %Bundle-Name -Bundle-SymbolicName: com.intel.sgx;singleton:=true -Bundle-Version: 1.0.1.qualifier -Bundle-Activator: com.intel.sgx.Activator -Bundle-Vendor: %Bundle-Vendor -Require-Bundle: org.eclipse.cdt.core;bundle-version="5.11.0", - org.eclipse.core.runtime;bundle-version="3.11.1", - org.eclipse.ui;bundle-version="3.107.0", - org.eclipse.cdt.managedbuilder.ui;bundle-version="8.2.2", - org.eclipse.cdt.managedbuilder.core;bundle-version="8.3.0", - org.eclipse.core.resources;bundle-version="3.10.1", - org.eclipse.cdt.ui;bundle-version="5.11.0", - org.eclipse.core.expressions;bundle-version="3.5.0", - org.eclipse.ui.ide;bundle-version="3.11.0" -Bundle-ActivationPolicy: lazy -Export-Package: com.intel.sgx, - com.intel.sgx.build, - com.intel.sgx.dialogs, - com.intel.sgx.discovery, - com.intel.sgx.handlers, - com.intel.sgx.natures, - com.intel.sgx.preferences, - com.intel.sgx.templates -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/OSGI-INF/l10n/bundle.properties b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 46262c06..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,15 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - - -Bundle-Vendor = Intel Corporation -Bundle-Name = Intel(R) SGX Linux Eclipse Plugin \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/build.properties b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/build.properties deleted file mode 100644 index bef8a62d..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/build.properties +++ /dev/null @@ -1,24 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - - -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - templates/,\ - discovery/,\ - build.properties,\ - OSGI-INF/,\ - OSGI-INF/l10n/bundle.properties -jre.compilation.profile = JavaSE-1.8 diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.c b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.c deleted file mode 100644 index 139597f9..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.c +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.cpp deleted file mode 100644 index 139597f9..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/discovery/test.cpp +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/plugin.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/plugin.xml deleted file mode 100644 index fb34102d..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/plugin.xml +++ /dev/null @@ -1,786 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - An C project, with Intel(R) SGX Commands and Configurations - - - - - - An C++ project, with Intel(R) SGX Commands and Configurations - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Activator.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Activator.java deleted file mode 100644 index 33f07e96..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Activator.java +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - -package com.intel.sgx; - -import java.net.URL; - -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - public static final String PLUGIN_ID = "com.intel.sgx";//$NON-NLS-1$ - - private static Activator plugin; - - public Activator() { - } - - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - public static Activator getDefault() { - return plugin; - } - - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } - - public static void log(Exception e) { - plugin.getLog().log(newStatus(e)); - } - - public static IStatus newStatus(Exception e) { - return new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e); - } - - public static URL findFile(Path path) { - return FileLocator.find(plugin.getBundle(), path, null); - } - - public static Bundle getBundle(String id){ - for(Bundle bundle : plugin.getBundle().getBundleContext().getBundles()){ - if(bundle.getSymbolicName().equals(id)) - return bundle; - } - return null; - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/CConfigurationDataProvider2.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/CConfigurationDataProvider2.java deleted file mode 100644 index ba898174..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/CConfigurationDataProvider2.java +++ /dev/null @@ -1,46 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx; - -import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; -import org.eclipse.cdt.core.settings.model.extension.CConfigurationDataProvider; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -public class CConfigurationDataProvider2 extends CConfigurationDataProvider { - - public CConfigurationDataProvider2() { - } - - @Override - public CConfigurationData loadConfiguration(ICConfigurationDescription des, - IProgressMonitor monitor) throws CoreException { - return null; - } - - @Override - public CConfigurationData createConfiguration( - ICConfigurationDescription des, - ICConfigurationDescription baseDescription, - CConfigurationData baseData, boolean clone, IProgressMonitor monitor) - throws CoreException { - return null; - } - - @Override - public void removeConfiguration(ICConfigurationDescription des, - CConfigurationData data, IProgressMonitor monitor) { - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Messages.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Messages.java deleted file mode 100644 index 75437ca5..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/Messages.java +++ /dev/null @@ -1,37 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - - private static final String BUNDLE_NAME = "com.intel.sgx.messages";//$NON-NLS-1$ - - /* - * TODO - These Strings can be used all through the package to control what messages are displayed. - * Todo here is to identify any message that needs to be made configurable. - */ - public static String CreateNativeFolders_No_folders; - public static String CreateNativeFolders_Missing_project_name; - public static String CreateNativeFolders_Project_does_not_exist; - - static{ - //Bundle initialization. - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages(){ - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/SdkPathVariableProvider.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/SdkPathVariableProvider.java deleted file mode 100644 index 70811c9a..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/SdkPathVariableProvider.java +++ /dev/null @@ -1,70 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx; -import java.io.File; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.variableresolvers.PathVariableResolver; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.preference.IPreferenceStore; - -import com.intel.sgx.preferences.PreferenceConstants; -import com.intel.sgx.preferences.SGXPreferencePage; - -public class SdkPathVariableProvider extends PathVariableResolver { - - public SdkPathVariableProvider() { - super(); - } - - @Override - public String[] getVariableNames(String variable, IResource resource) { - String variableNames[] = {"SGX_SDK_DIR_PATH"}; - return (variableNames); - } - - @Override - public String getValue(String variable, IResource resource) { - if(variable.equals("SGX_SDK_DIR_PATH")) { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - String SDKPath = store.getString(PreferenceConstants.SDK_PATH); - IPath SDKCanonicalPath= new Path(SDKPath); - return(SDKCanonicalPath.append("Include").toOSString()); - } - return null; - } - - public static String getSGXSdkLocation() { - return Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH); - } - - public static boolean isSGXSdkLocationValid() { - String location = getSGXSdkLocation(); - if (location.length() == 0) - return false; - - return isValidSGXSdkLocation(location); - } - - public static boolean isValidSGXSdkLocation(String location) { - File dir = new File(location); - if (!dir.isDirectory()) - return false; - - return new PreferenceConstants.SGXSDK64Descriptor(dir).getSignerPath().canExecute() - || new PreferenceConstants.SGXSDK32Descriptor(dir).getSignerPath().canExecute(); - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/build/SGXSDKCommandLauncher.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/build/SGXSDKCommandLauncher.java deleted file mode 100644 index 19431a27..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/build/SGXSDKCommandLauncher.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -/** - * This class follows the same solution provided in the NDK_PLUGIN for NDKCommandLauncher. - */ -package com.intel.sgx.build; - -import org.eclipse.cdt.core.CommandLauncher; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -import com.intel.sgx.SdkPathVariableProvider; -/** - * This launches the sgx-ndk-build. - */ -public class SGXSDKCommandLauncher extends CommandLauncher { - - @Override - public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory, - IProgressMonitor monitor) - throws CoreException { - - return super.execute(commandPath, args, env, changeToDirectory, monitor); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddEnclaveFileDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddEnclaveFileDialog.java deleted file mode 100644 index db169670..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddEnclaveFileDialog.java +++ /dev/null @@ -1,126 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import javax.swing.JOptionPane; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.AddEnclave; - -public class AddEnclaveFileDialog extends SGXDialogBase { - - private Text fileNameField; - private AddEnclave addHandler; - private boolean generateApp = true; - - public AddEnclaveFileDialog(Shell shell, AddEnclave addHandler) { - super(shell); - this.addHandler = addHandler; - this.shell = shell; - // setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - public boolean generateApp() - { - return generateApp; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - final Group container = new Group(composite, SWT.NONE); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - - addLabel(container, "Enter the name of the Enclave. Make sure the name is unique within the hosting application."); - - final Label fileNameLabel = new Label(container, SWT.NONE); - fileNameLabel.setText("Enclave name:"); - fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false)); - - fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER); - GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL); - textGridData1.minimumWidth = 400; - textGridData1.grabExcessHorizontalSpace = true; - fileNameField.setLayoutData(textGridData1); - - Button generateUntrustedApp = new Button(container, SWT.CHECK); - generateUntrustedApp.setText("Generate sample untrusted application?"); - generateUntrustedApp.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false, 3, 1)); - generateUntrustedApp.setSelection(true); - - generateUntrustedApp.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(SelectionEvent event) { - Button btn = (Button) event.getSource(); - generateApp = btn.getSelection(); - } - }); - - container.layout(); - composite.layout(); - return composite; - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Add New Intel(R) SGX Enclave Dialog"); - newShell.layout(); - } - - @Override - protected - void okPressed() { - addHandler.edlFilename = fileNameField.getText(); - if(!fileNameField.getText().isEmpty() - ){ - if(Character.isDigit(fileNameField.getText().charAt(0))) - { - JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error", - JOptionPane.ERROR_MESSAGE); - } - else - super.okPressed(); - } - } - - @Override - protected Point getInitialSize(){ - return new Point(675,200); - } - - public String getFileName() { - return fileNameField.getText(); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddTrustedStaticLibFileDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddTrustedStaticLibFileDialog.java deleted file mode 100644 index 197909d9..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddTrustedStaticLibFileDialog.java +++ /dev/null @@ -1,109 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import javax.swing.JOptionPane; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.AddTrustedStaticLib; - -public class AddTrustedStaticLibFileDialog extends SGXDialogBase { - - private Text fileNameField; - private AddTrustedStaticLib addHandler; - private boolean generateApp = false; - - public AddTrustedStaticLibFileDialog(Shell shell, AddTrustedStaticLib addHandler) { - super(shell); - this.addHandler = addHandler; - this.shell = shell; - // setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - public boolean generateApp() - { - return generateApp; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - final Group container = new Group(composite, SWT.NONE); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - - addLabel(container, "Enter the name of the Static Trusted Library."); - addLabel(container, "Make sure the name is unique within the hosting application."); - - final Label fileNameLabel = new Label(container, SWT.NONE); - fileNameLabel.setText("Static Trusted Library Name:"); - fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false)); - - fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER); - GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL); - textGridData1.minimumWidth = 400; - textGridData1.grabExcessHorizontalSpace = true; - fileNameField.setLayoutData(textGridData1); - - composite.layout(); - - return composite; - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Add New Intel(R) SGX Static Trusted Library Dialog"); - } - - @Override - protected - void okPressed(){ - addHandler.edlFilename = fileNameField.getText(); - if(!fileNameField.getText().isEmpty() - ){ - if(Character.isDigit(fileNameField.getText().charAt(0))) - { - JOptionPane.showMessageDialog(null, "Enclave names starting with digits are not allowed.", "Error", - JOptionPane.ERROR_MESSAGE); - } - else - super.okPressed(); - } - } - - @Override - protected Point getInitialSize(){ - return new Point(675,200); - } - - public String getFileName() { - return fileNameField.getText(); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddUntrustedModuleDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddUntrustedModuleDialog.java deleted file mode 100644 index 9e85366c..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/AddUntrustedModuleDialog.java +++ /dev/null @@ -1,138 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import java.io.File; - -import javax.swing.JOptionPane; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.AddUntrustedModule; - -public class AddUntrustedModuleDialog extends Dialog { - - private Text fileNameField,makeFilePathField; - private Shell shell; - private AddUntrustedModule addHandler; - private boolean generateApp = false; - - public AddUntrustedModuleDialog(Shell shell, AddUntrustedModule addHandler) { - super(shell); - this.addHandler = addHandler; - this.shell = shell; - //setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - public boolean generateApp() - { - return generateApp; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - final Group container = new Group(composite, SWT.NONE); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - - final Label messageLabel = new Label(container, SWT.NONE); - messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel.setText("Enter the path to the Enclave Descriptor file (*.edl) of the enclave to host."); - - - final Label fileNameLabel = new Label(container, SWT.NONE); - fileNameLabel.setText("Filename:"); - fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false)); - - - fileNameField = new Text(container,SWT.SINGLE | SWT.BORDER); - GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL); - textGridData1.minimumWidth = 400; - textGridData1.grabExcessHorizontalSpace = true; - fileNameField.setLayoutData(textGridData1); - - final Button browseButton = new Button(container, SWT.PUSH); - browseButton.setText("Browse"); - GridData buttonGridData1 = new GridData(GridData.END); - buttonGridData1.horizontalAlignment = SWT.RIGHT; - buttonGridData1.horizontalSpan = 1; - buttonGridData1.minimumWidth = 120; - browseButton.setLayoutData(buttonGridData1); - browseButton.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = null; - shell = new Shell(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterExtensions(new String [] {"*.edl"}); - dialog.setFilterPath(""); - result = dialog.open(); - fileNameField.setText(result); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - return composite; - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Add Intel(R) SGX Untrusted Module."); - } - - @Override - protected - void okPressed(){ - addHandler.edlFilename = fileNameField.getText(); - if(!fileNameField.getText().isEmpty()) - if((new File(fileNameField.getText())).isFile()) - super.okPressed(); - else - JOptionPane.showMessageDialog(null, "EDL file does not exist.", "Error", - JOptionPane.ERROR_MESSAGE); - } - - @Override - protected Point getInitialSize(){ - return new Point(675,200); - } - - public String getFileName() { - return fileNameField.getText(); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/EnclaveConfigDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/EnclaveConfigDialog.java deleted file mode 100644 index 0663fb6e..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/EnclaveConfigDialog.java +++ /dev/null @@ -1,392 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.jface.preference.JFacePreferences; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.EnclaveConfigHandler; - -public class EnclaveConfigDialog extends SGXDialogBase { - - @SuppressWarnings("unused") - private Shell shell; - private EnclaveConfigHandler enclaveConfig; - private Label statusLabel; - private Text prodID; - private Text isvSvn; - private Text stackMinSize; - private Text stackMaxSize; - private Text heapMinSize; - private Text heapInitSize; - private Text heapMaxSize; - private Text tcsNum; - private Text tcsMaxNum; - private Text tcsPool; - private Combo tcsPolicy; - private Button disableDebug; - - public EnclaveConfigDialog(Shell parentshell,EnclaveConfigHandler enclaveConfigHandler) { - super(parentshell); - this.shell = parentshell; - this.enclaveConfig = enclaveConfigHandler; - setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - @Override - protected Control createDialogArea(Composite parent) { - - Composite container = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(3,false); - container.setLayout(gridLayout); - - final Group groupLabel1 = new Group(container, SWT.None); - groupLabel1.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - groupLabel1.setLayoutData(innergrid1); - - Label warningLabel = new Label(groupLabel1,SWT.BEGINNING | SWT.WRAP); - warningLabel.setText("Note: Use this Menu to change the Enclave settings."); - - statusLabel = new Label(container,SWT.BEGINNING | SWT.WRAP); - GridData statusGrid = new GridData(GridData.FILL_HORIZONTAL); - statusGrid.horizontalSpan = 3; - statusLabel.setLayoutData(statusGrid); - statusLabel.setText(""); - statusLabel.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR)); - - final Group groupLabel2 = new Group(container, SWT.None); - groupLabel2.setLayout(new GridLayout(3,false)); - groupLabel2.setText("Modify the Enclave Settings here..."); - GridData innergrid = new GridData(GridData.FILL_HORIZONTAL); - innergrid.horizontalSpan = 3; - groupLabel2.setLayoutData(innergrid); - - final Label messageLabel0 = new Label(groupLabel2, SWT.NONE); - messageLabel0.setText("Product ID:"); - messageLabel0.setLayoutData(new GridData(GridData.BEGINNING)); - - prodID = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 2; - gridData.widthHint = 400; - prodID.setLayoutData(gridData); - prodID.setText(enclaveConfig.prodId); - prodID.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - statusLabel.setText(""); - enclaveConfig.prodId = prodID.getText(); - } - }); - - final Label messageLabel1 = new Label(groupLabel2, SWT.NONE); - messageLabel1.setText("ISV SVN:"); - messageLabel1.setLayoutData(new GridData(GridData.BEGINNING)); - - isvSvn = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - isvSvn.setLayoutData(gridData); - isvSvn.setText(enclaveConfig.isvSvn); - isvSvn.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - statusLabel.setText(""); - enclaveConfig.isvSvn = isvSvn.getText(); - } - }); - - final Label messageLabel2 = new Label(groupLabel2, SWT.NONE); - messageLabel2.setText("Minimum Stack Size:"); - messageLabel2.setLayoutData(new GridData(GridData.BEGINNING)); - - stackMinSize = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - stackMinSize.setLayoutData(gridData); - stackMinSize.setText(enclaveConfig.stackMinSize); - stackMinSize.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - enclaveConfig.stackMinSize = stackMinSize.getText(); - - if(!(stackMinSize.getText().matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Minimum Stack Size value must be Page Aligned."); - } - else - { - checkPageAlign(stackMinSize); - } - } - }); - - final Label messageLabel3 = new Label(groupLabel2, SWT.NONE); - messageLabel3.setText("Maximum Stack Size:"); - messageLabel3.setLayoutData(new GridData(GridData.BEGINNING)); - - stackMaxSize = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - stackMaxSize.setLayoutData(gridData); - stackMaxSize.setText(enclaveConfig.stackMaxSize); - stackMaxSize.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - enclaveConfig.stackMaxSize = stackMaxSize.getText(); - - if(!(stackMaxSize.getText().matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Maximum Stack Size value must be Page Aligned."); - } - else - { - checkPageAlign(stackMaxSize); - } - } - }); - - final Label messageLabel4 = new Label(groupLabel2, SWT.NONE); - messageLabel4.setText("Minimum Heap Size:"); - messageLabel4.setLayoutData(new GridData(GridData.BEGINNING)); - - heapMinSize = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - heapMinSize.setLayoutData(gridData); - heapMinSize.setText(enclaveConfig.heapMinSize); - heapMinSize.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - enclaveConfig.heapMinSize = heapMinSize.getText(); - - if(!(heapMinSize.getText().matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Minimum Heap Size value must be Page Aligned."); - } - else - { - checkPageAlign(heapMinSize); - } - } - }); - - final Label messageLabel5 = new Label(groupLabel2, SWT.NONE); - messageLabel5.setText("Initial Heap Size:"); - messageLabel5.setLayoutData(new GridData(GridData.BEGINNING)); - - heapInitSize = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - heapInitSize.setLayoutData(gridData); - heapInitSize.setText(enclaveConfig.heapInitSize); - heapInitSize.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - enclaveConfig.heapInitSize = heapInitSize.getText(); - - if(!(heapInitSize.getText().matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Initial Heap Size value must be Page Aligned."); - } - else - { - checkPageAlign(heapInitSize); - } - } - }); - - final Label messageLabel6 = new Label(groupLabel2, SWT.NONE); - messageLabel6.setText("Maximum Heap Size:"); - messageLabel6.setLayoutData(new GridData(GridData.BEGINNING)); - - heapMaxSize = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - heapMaxSize.setLayoutData(gridData); - heapMaxSize.setText(enclaveConfig.heapMaxSize); - heapMaxSize.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - enclaveConfig.heapMaxSize = heapMaxSize.getText(); - - if(!(heapMaxSize.getText().matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Maximum Heap Size value must be Page Aligned."); - } - else - { - checkPageAlign(heapMaxSize); - } - } - }); - - final Label messageLabel7 = new Label(groupLabel2, SWT.NONE); - messageLabel7.setText("TCS Number:"); - messageLabel7.setLayoutData(new GridData(GridData.BEGINNING)); - - tcsNum = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - tcsNum.setLayoutData(gridData); - tcsNum.setText(enclaveConfig.tcsNum); - tcsNum.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - statusLabel.setText(""); - enclaveConfig.tcsNum = tcsNum.getText(); - } - }); - - final Label messageLabel8 = new Label(groupLabel2, SWT.NONE); - messageLabel8.setText("Maximum TCS Number:"); - messageLabel8.setLayoutData(new GridData(GridData.BEGINNING)); - - tcsMaxNum = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - tcsMaxNum.setLayoutData(gridData); - tcsMaxNum.setText(enclaveConfig.tcsMaxNum); - tcsMaxNum.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - statusLabel.setText(""); - enclaveConfig.tcsMaxNum = tcsMaxNum.getText(); - } - }); - - final Label messageLabel9 = new Label(groupLabel2, SWT.NONE); - messageLabel9.setText("TCS Pool:"); - messageLabel9.setLayoutData(new GridData(GridData.BEGINNING)); - - tcsPool = new Text(groupLabel2, SWT.SINGLE | SWT.BORDER); - tcsPool.setLayoutData(gridData); - tcsPool.setText(enclaveConfig.tcsPool); - tcsPool.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent modifyEvent) { - statusLabel.setText(""); - enclaveConfig.tcsPool = tcsPool.getText(); - } - }); - - final Label messageLabel10 = new Label(groupLabel2, SWT.NONE); - messageLabel10.setText("TCS Policy:"); - messageLabel10.setLayoutData(new GridData(GridData.BEGINNING)); - - final String[] items = {"Unbound","Bound"}; - tcsPolicy = new Combo(groupLabel2, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); - tcsPolicy.setItems(items); - String item = items[Integer.parseInt(enclaveConfig.tcsPolicy)]; - int index = tcsPolicy.indexOf(item); - tcsPolicy.select(index < 0 ? 0 : index); - tcsPolicy.setLayoutData(gridData); - tcsPolicy.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e){ - statusLabel.setText(""); - enclaveConfig.tcsPolicy = (tcsPolicy.getSelectionIndex() == 0 ? "0" : "1"); - } - }); - - - final Label messageLabel11 = new Label(groupLabel2, SWT.NONE); - messageLabel11.setText("Disable Debug:"); - messageLabel11.setLayoutData(new GridData(GridData.BEGINNING)); - - disableDebug = new Button(groupLabel2,SWT.CHECK); - GridData gridData1 = new GridData(GridData.FILL_HORIZONTAL); - disableDebug.setLayoutData(gridData1); - disableDebug.setSelection(enclaveConfig.disableDebug.equals("1")?true:false); - disableDebug.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e){ - statusLabel.setText(""); - enclaveConfig.disableDebug = disableDebug.getSelection()?"1":"0"; - } - }); - - if(statusLabel.getText() != null){ - statusLabel.setVisible(true); - } - else{ - statusLabel.setVisible(false); - } - - return container; - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Enclave Configuration Settings:"); - } - - @Override - protected Point getInitialSize(){ - return new Point(450,570); - } - - @Override - protected - void okPressed(){ - enclaveConfig.prodId = this.prodID.getText(); - enclaveConfig.isvSvn = this.isvSvn.getText(); - enclaveConfig.stackMinSize = this.stackMinSize.getText(); - enclaveConfig.stackMaxSize = this.stackMaxSize.getText(); - enclaveConfig.heapMinSize = this.heapMinSize.getText(); - enclaveConfig.heapInitSize = this.heapInitSize.getText(); - enclaveConfig.heapMaxSize = this.heapMaxSize.getText(); - enclaveConfig.tcsNum = this.tcsNum.getText(); - enclaveConfig.tcsMaxNum = this.tcsMaxNum.getText(); - enclaveConfig.tcsPool = this.tcsPool.getText(); - enclaveConfig.tcsPolicy = this.tcsPolicy.getSelectionIndex() == 0 ? "0" : "1"; - enclaveConfig.disableDebug = disableDebug.getSelection()?"1":"0"; - - - if((statusLabel.getText() == "") && (enclaveConfig.stackMinSize.matches("0x[0-9a-fA-F]{1,}000")) - && (enclaveConfig.stackMaxSize.matches("0x[0-9a-fA-F]{1,}000")) - && (enclaveConfig.heapMinSize.matches("0x[0-9a-fA-F]{1,}000")) - && (enclaveConfig.heapInitSize.matches("0x[0-9a-fA-F]{1,}000")) - && (enclaveConfig.heapMaxSize.matches("0x[0-9a-fA-F]{1,}000"))) - super.okPressed(); - } - - private void checkPageAlign(Text txtExcluded) { - if(txtExcluded != stackMinSize && !(enclaveConfig.stackMinSize.matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Minimum Stack Size value must be Page Aligned."); - } - else if(txtExcluded != stackMaxSize && !(enclaveConfig.stackMaxSize.matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Maximum Stack Size value must be Page Aligned."); - } - else if(txtExcluded != heapMinSize && !(enclaveConfig.heapMinSize.matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Minimum Heap Size value must be Page Aligned."); - } - else if(txtExcluded != heapInitSize && !(enclaveConfig.heapInitSize.matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Initial Heap Size value must be Page Aligned."); - } - else if(txtExcluded != heapMaxSize && !(enclaveConfig.heapMaxSize.matches("0x[0-9a-fA-F]{1,}000"))) - { - statusLabel.setText("Error: The Maximum Heap Size value must be Page Aligned."); - } - else - { - statusLabel.setText(""); - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/RemoveEnclaveFileDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/RemoveEnclaveFileDialog.java deleted file mode 100644 index 6bcc8d4e..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/RemoveEnclaveFileDialog.java +++ /dev/null @@ -1,122 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.DirectoryDialog; -//import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.RemoveEnclave; - -public class RemoveEnclaveFileDialog extends Dialog{ - - private Text fileNameField; - private Shell shell; - private RemoveEnclave removeHandler; - - public RemoveEnclaveFileDialog(Shell shell, RemoveEnclave removeHandler) { - super(shell); - this.removeHandler = removeHandler; - this.shell = shell; - setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - final Group container = new Group(composite, SWT.None); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - container.setText("Path to Enclave directory:"); - - final Label messageLabel = new Label(container, SWT.NONE); - messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel.setText("Enter the name of the Enclave Or Navigate to the Enclave folder to be removed from the host."); - - final Label fileNameLabel = new Label(container, SWT.NONE); - fileNameLabel.setLayoutData(new GridData(GridData.BEGINNING,GridData.CENTER, false, false)); - fileNameLabel.setText("Enclave Name:"); - - fileNameField = new Text(container, SWT.SINGLE | SWT.BORDER); - GridData textGridData1 = new GridData(GridData.FILL_HORIZONTAL); - textGridData1.minimumWidth = 400; - textGridData1.grabExcessHorizontalSpace = true; - fileNameField.setLayoutData(textGridData1); - - final Button browseButton = new Button(container, SWT.PUSH); - browseButton.setText("Browse"); - GridData buttonGridData1 = new GridData(GridData.END); - buttonGridData1.horizontalAlignment = SWT.RIGHT; - buttonGridData1.horizontalSpan = 1; - buttonGridData1.minimumWidth = 120; - browseButton.setLayoutData(buttonGridData1); - browseButton.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = fileNameField.getText(); - - DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN); - dialog.setMessage("Select the Enclave Directory to remove."); - dialog.setFilterPath(""); - result = dialog.open(); - fileNameField.setText(result); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - - return container; - } - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Remove an Imported Enclave"); - } - - @Override - protected void okPressed(){ - removeHandler.edlFilename = fileNameField.getText(); - if(!fileNameField.getText().isEmpty()) - super.okPressed(); - } - - @Override - protected Point getInitialSize(){ - return new Point(675,205); - } - - public String getFileName() { - return fileNameField.getText(); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/SGXDialogBase.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/SGXDialogBase.java deleted file mode 100644 index 08d2f3bb..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/SGXDialogBase.java +++ /dev/null @@ -1,222 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import java.io.InputStream; -import java.util.Scanner; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.IShellProvider; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog; - -import com.intel.sgx.Activator; - -public abstract class SGXDialogBase extends Dialog { - - protected Shell shell; - public Text configFileField; - public static FilteredResourcesSelectionDialog dialogForConfig(Shell shell) { - // final IContainer container = ResourcesPlugin.getWorkspace().getRoot(); - - final IContainer container = SGXDialogBase.getCurrentProject(); - - FilteredResourcesSelectionDialog d = new FilteredResourcesSelectionDialog( - shell, false, container, IResource.FILE) { - { - setInitialPattern("**"); - } - - @Override - protected IStatus validateItem(Object item) { - // return Status.OK_STATUS; - IFile f = (IFile) item; - if (f.getParent() instanceof IProject) { - return new Status(IStatus.ERROR, Activator.PLUGIN_ID, - "The selected resource has to be part of the source folder"); - } - - - return super.validateItem(item); - } - - protected ItemsFilter createFilter() { - return new ResourceFilter(container, true, IResource.FILE) { - - @Override - public boolean matchItem(Object item) { - return isConfigFile(item); - } - - private boolean isConfigFile(Object item) { - if (!(item.toString().endsWith(".xml") && super - .matchItem(item))) { - return false; - } - try { - IFile iFile = (IFile) item; - return streamContainsString(iFile.getContents(), - ""); - } catch (Throwable e) { - return false; - } - } - - }; - - } - - public boolean streamContainsString(InputStream is, - String searchString) { - Scanner streamScanner = new Scanner(is); - if (streamScanner.findWithinHorizon(searchString, 0) != null) { - return true; - } else { - return false; - } - } - - }; - return d; - } - - - - protected SelectionListener configFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - - FilteredResourcesSelectionDialog d = dialogForConfig(shell); - d.setTitle("Select Config File"); - if (d.open() == Dialog.OK) { - IFile target = (IFile) d.getResult()[0]; - configFileField.setText(target.getLocation().toOSString()); - } - ; - } - - @Override - public void widgetDefaultSelected(SelectionEvent arg0) { - // TODO Auto-generated method stub - - } - - }; - - public SGXDialogBase(Shell parentShell) { - super(parentShell); - } - - public SGXDialogBase(IShellProvider parentShell) { - super(parentShell); - } - - protected Text addGroup(Composite composite, String title, String subtitle, - String label, String selectButtonLabel, SelectionListener selectionListener) { - final Group container = new Group(composite, SWT.None); - container.setLayout(new GridLayout(3, false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - container.setText(title); - - final Label messageLabel = new Label(container, SWT.NONE); - messageLabel.setLayoutData(new GridData(GridData.BEGINNING, - GridData.CENTER, false, false, 3, 1)); - messageLabel.setText(subtitle); - - final Label messageLabel1 = new Label(container, SWT.NONE); - messageLabel1.setText(label); - messageLabel1.setLayoutData(new GridData(GridData.BEGINNING)); - - Text directoryNameField = new Text(container, SWT.SINGLE | SWT.BORDER); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 1; - gridData.widthHint = 400; - directoryNameField.setLayoutData(gridData); - - final Button selectButton = new Button(container, SWT.PUSH); - selectButton.setText(selectButtonLabel); - GridData buttonGridData = new GridData(GridData.END); - buttonGridData.horizontalAlignment = SWT.RIGHT; - buttonGridData.horizontalSpan = 1; - buttonGridData.minimumWidth = 120; - selectButton.setLayoutData(buttonGridData); - selectButton.addSelectionListener(selectionListener); - return directoryNameField; - } - - - public IPath getCurrentProjectPath() { - IProject project = getCurrentProject(); - - IPath path = null; - if (project != null) { - path = project.getLocation(); - } - return path; - } - - static public IProject getCurrentProject() { - IProject project = null; - - - IWorkbenchWindow window = PlatformUI.getWorkbench() - .getActiveWorkbenchWindow(); - if (window != null) { - IStructuredSelection selection = (IStructuredSelection) window - .getSelectionService().getSelection(); - Object firstElement = selection.getFirstElement(); - if (firstElement instanceof IAdaptable) { - project = (IProject) ((IAdaptable) firstElement) - .getAdapter(IProject.class); - } - } - return project; - } - - @Override - protected void configureShell(Shell newShell){ - super.configureShell(newShell); - } - - protected void addLabel(final Group container, String labelText) { - final Label messageLabel = new Label(container, SWT.NONE); - messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel.setText(labelText); - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignDialogBase.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignDialogBase.java deleted file mode 100644 index ab8aa72f..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignDialogBase.java +++ /dev/null @@ -1,174 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import java.io.File; -import java.util.Scanner; - -import javax.swing.JOptionPane; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public abstract class TwoStepSignDialogBase extends SGXDialogBase { - - public Text enclaveFileField; - public Text hashFileField; - public Text externalSignPublicKeyFileField; - public Text externalSignedHashFileField; - public Text outputSignedEnclaveFileField; - - public TwoStepSignDialogBase(Shell parentShell) { - super(parentShell); - setShellStyle(SWT.RESIZE | SWT.TITLE); - this.shell = TwoStepSignDialogBase.this.getParentShell(); - - } - - // for each field, a corresponding listener - protected SelectionListener enclaveFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = enclaveFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - - - - dialog.setFilterExtensions(new String[]{"*.so"} ); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - - if (result != null && !result.isEmpty()) { - dialog.setFilterPath(new File(result).getParent()); - } else { - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - } - - result = dialog.open(); - - enclaveFileField.setText(result); - - hashFileField.setText(result + ".hex"); - - if (outputSignedEnclaveFileField != null){ - String outputSignedEnclavePath = result; - if(outputSignedEnclavePath.endsWith(".so")) - { - outputSignedEnclavePath = - outputSignedEnclavePath.substring(0,outputSignedEnclavePath.length() - ".so".length()); - outputSignedEnclaveFileField.setText(outputSignedEnclavePath+".signed.so"); - } - - } - - - - } - - @Override - public void widgetDefaultSelected(SelectionEvent arg0) { - } - }; - - protected SelectionListener hashFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = hashFileField.getText(); - - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - - if (result != null && !result.isEmpty()) { - dialog.setFilterPath(new File(result).getParent()); - } else { - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - } - - result = dialog.open(); - - hashFileField.setText(result); - } - - @Override - public void widgetDefaultSelected(SelectionEvent arg0) { - } - - }; - - protected SelectionListener publicKeyLocationSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = externalSignPublicKeyFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterExtensions(new String [] {"*.pem", "*"}); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - result = dialog.open(); - externalSignPublicKeyFileField.setText(result); - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - protected SelectionListener externalSignedHashFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = externalSignedHashFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - result = dialog.open(); - externalSignedHashFileField.setText(result); - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - protected SelectionListener outputSignedEnclaveListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = outputSignedEnclaveFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - - - dialog.setFilterExtensions(new String[]{"*.so", } ); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - - if (result != null && !result.isEmpty()) { - dialog.setFilterPath(new File(result).getParent()); - } else { - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - } - - result = dialog.open(); - - outputSignedEnclaveFileField.setText(result); - - } - - @Override - public void widgetDefaultSelected(SelectionEvent arg0) { - } - }; - - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - } - - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog1.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog1.java deleted file mode 100644 index c8d1b8fe..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog1.java +++ /dev/null @@ -1,72 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import com.intel.sgx.handlers.TwoStepSignHandlerBase; - -public class TwoStepSignStep1Dialog1 extends TwoStepSignDialogBase { - - final private TwoStepSignHandlerBase handler; - - public TwoStepSignStep1Dialog1(Shell parentShell, TwoStepSignHandlerBase handler) { - super(parentShell); - this.handler = handler; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1, false); - composite.setLayout(gridLayout); - - enclaveFileField = addGroup(composite, "Unsigned Enclave Path:", - "Select Enclave for which to generate the Hash.", - "Enclave Path:", "Select Enclave", enclaveFileSelectionListener); - - hashFileField = addGroup(composite, "Generate Hash:", - "Select Location to Output Hash File.", "Hash File Location:", - "Select File Path", hashFileSelectionListener); - - configFileField = addGroup(composite, "Configuration File:", - "Select Input Configuration XML File. ", - "Configuration File:", "Select Config", - configFileSelectionListener); - - composite.pack(true); - return composite; - } - - @Override - protected void okPressed() { - handler.enclaveFile = enclaveFileField.getText(); - handler.hashFile = hashFileField.getText(); - handler.configFile = configFileField.getText(); - - super.okPressed(); - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Two Step Enclave Sign - Generate Hash"); - } - - - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog2.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog2.java deleted file mode 100644 index 0fe37126..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog2.java +++ /dev/null @@ -1,89 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -public class TwoStepSignStep1Dialog2 extends TwoStepSignDialogBase { - - final private String hashFile; - - public TwoStepSignStep1Dialog2(Shell parentShell, String hashFile) { - super(parentShell); - this.hashFile = hashFile; - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - addGroup1(composite); - addGroup3(composite); - - - return composite; - } - - private void addGroup1(Composite composite) { - final Group container = new Group(composite, SWT.None); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - container.setText("Hash File:"); - - final Label messageLabel = new Label(container, SWT.NONE); - messageLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel.setText("Hash File Generated at Location:"); - - final Label messageLabel1 = new Label(container, SWT.NONE); - messageLabel1.setText(hashFile); - - messageLabel1.setLayoutData(new GridData(GridData.BEGINNING)); - } - - private void addGroup3(Composite composite) { - final Group container3 = new Group(composite, SWT.None); - container3.setLayout(new GridLayout(3,false)); - GridData innergrid3 = new GridData(GridData.FILL_HORIZONTAL); - innergrid3.horizontalSpan = 3; - container3.setLayoutData(innergrid3); - container3.setText("Generate Signed Enclave (Step-2):"); - - final Label messageLabel4 = new Label(container3, SWT.NONE); - messageLabel4.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel4.setText("To Generate Signed Enclave Now: Click OK"); - - final Label messageLabel5 = new Label(container3, SWT.NONE); - messageLabel5.setLayoutData(new GridData(GridData.CENTER, GridData.END, false, false, 3, 1)); - messageLabel5.setText("To Generate Signed Enclave Later: Click Cancel"); - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Two Step Enclave Sign - Generate Hash"); - } - - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog3.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog3.java deleted file mode 100644 index ec7a0017..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep1Dialog3.java +++ /dev/null @@ -1,105 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; - -import com.intel.sgx.handlers.TwoStepSignHandlerBase; - -public class TwoStepSignStep1Dialog3 extends TwoStepSignDialogBase { - - final private TwoStepSignHandlerBase handler; - - public TwoStepSignStep1Dialog3(Shell parentShell, TwoStepSignHandlerBase handler) { - super(parentShell); - this.handler = handler; - } - - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1, false); - composite.setLayout(gridLayout); - - addInfoGroup(composite); - - externalSignPublicKeyFileField = addGroup(composite, "Public Key:", - "Select the Public Key file obtained from signing facility", - "Public Key:", "Select", publicKeyLocationSelectionListener); - - externalSignedHashFileField = addGroup(composite, "Signature:", - "Select the Signature file obtained from signing facility.", - "Signature:", - "Select", externalSignedHashFileSelectionListener); - - - outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:", - "Select where to save the output Signed Enclave.", - "Signed Enclave:", - "Select", outputSignedEnclaveListener); - - return composite; - } - - protected void addInfoGroup(Composite composite) { - final Group container = new Group(composite, SWT.None); - container.setLayout(new GridLayout(3,false)); - GridData innergrid1 = new GridData(GridData.FILL_HORIZONTAL); - innergrid1.horizontalSpan = 3; - container.setLayoutData(innergrid1); - container.setText("Hash and Enclave:"); - - - addInfoKeyValue(container, "Enclave File:", handler.enclaveFile); - addInfoKeyValue(container, "Config File:", handler.configFile); - addInfoKeyValue(container, "Hash File:", handler.hashFile); - } - - private void addInfoKeyValue(final Group container, String key, - String value) { - final Label messageLabel2 = new Label(container, SWT.NONE); - messageLabel2.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel2.setText(key); - - final Label messageLabel3 = new Label(container, SWT.NONE); - messageLabel3.setText(value); - messageLabel3.setLayoutData(new GridData(GridData.BEGINNING)); - } - - @Override - protected void okPressed() { - handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText(); - handler.externallySignedHashFile = externalSignedHashFileField.getText(); - handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText(); - super.okPressed(); - } - - - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Two Step Enclave Sign - Generate Signed Enclave"); - } - - - - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep2Dialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep2Dialog.java deleted file mode 100644 index 98a1e912..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/TwoStepSignStep2Dialog.java +++ /dev/null @@ -1,92 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; - -import com.intel.sgx.handlers.TwoStepSignHandlerBase; -import com.intel.sgx.handlers.TwoStepSignStep2; - -public class TwoStepSignStep2Dialog extends TwoStepSignDialogBase{ - - final private TwoStepSignHandlerBase handler; - - - public TwoStepSignStep2Dialog(Shell parentShell, TwoStepSignHandlerBase handler) { - super(parentShell); - this.handler = handler; - } - - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - - - enclaveFileField= addGroup(composite, "Enclave:", - "Select the unsigned enclave file", - "Unsigned Enclave File:", "Select", enclaveFileSelectionListener); - - configFileField = addGroup(composite, "Configuration File:", - "Select Input Configuration XML File. ", - "Configuration File:", "Select Config", - configFileSelectionListener); - - hashFileField= addGroup(composite, "Hash:", - "Select the Hash file obtained from previous step", - "Hash File:", "Select", hashFileSelectionListener); - - externalSignPublicKeyFileField= addGroup(composite, "Public Key:", - "Select the Public Key file obtained from external signing facility", - "Public Key:", "Select", publicKeyLocationSelectionListener); - - externalSignedHashFileField = addGroup(composite, "Signature:", - "Select the Signature file obtained from signing facility.", - "Signature:", - "Select", externalSignedHashFileSelectionListener); - - outputSignedEnclaveFileField = addGroup(composite, "Signed Enclave:", - "Select where to save the output Signed Enclave.", - "Signed Enclave:", - "Select", outputSignedEnclaveListener); - - return composite; - } - - - @Override - protected void okPressed() { - handler.enclaveFile = enclaveFileField.getText(); - handler.hashFile = hashFileField.getText(); - handler.configFile = configFileField.getText(); - handler.externalSignPublicKeyFile = externalSignPublicKeyFileField.getText(); - handler.externallySignedHashFile = externalSignedHashFileField.getText(); - handler.outputSignedEnclaveFile = outputSignedEnclaveFileField.getText(); - - super.okPressed(); - } - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Two Step Enclave Sign - Generate Signed Enclave"); - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/UpdateSignKeyDialog.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/UpdateSignKeyDialog.java deleted file mode 100644 index e1a655c6..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/dialogs/UpdateSignKeyDialog.java +++ /dev/null @@ -1,191 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.dialogs; - -import java.io.File; - -import javax.swing.JOptionPane; - -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -import com.intel.sgx.handlers.UpdateSigningKey; - -public class UpdateSignKeyDialog extends SGXDialogBase { - - private Shell shell; - public Text sourceKeyFileField; - public Text destinationKeyFileField; - public static boolean regenerate = false; - - private final SelectionListener destinationKeyFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = destinationKeyFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - dialog.setFilterExtensions(new String [] {"*.pem", "*"}); - result = dialog.open(); - destinationKeyFileField.setText(result); - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - - private final SelectionListener sourceKeyFileSelectionListener = new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - String result = sourceKeyFileField.getText(); - FileDialog dialog = new FileDialog(shell, SWT.OPEN); - dialog.setFilterExtensions(new String [] {"*.pem", "*"}); - dialog.setFilterPath(getCurrentProjectPath().toOSString()); - result = dialog.open(); - sourceKeyFileField.setText(result); - } - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }; - final private UpdateSigningKey handler; - - public UpdateSignKeyDialog(Shell parentShell, UpdateSigningKey handler) { - super(parentShell); - this.shell = parentShell; - this.handler = handler; - setShellStyle(SWT.RESIZE | SWT.TITLE); - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - final GridLayout gridLayout = new GridLayout(1,false); - composite.setLayout(gridLayout); - - destinationKeyFileField = addGroup(composite, "Enclave Signing Key:", - "Select the Signing Key to be Updated or Generated.", - "Enclave Signing Key:", "Select", destinationKeyFileSelectionListener); - - sourceKeyFileField = addGroup(composite, "Import:", - "To import your own Signing Key use the Import Signing Key option.", - "Import Signing Key:", "Import Key", sourceKeyFileSelectionListener); - - addGroup2(composite); - - return composite; - } - - protected void addGroup2(Composite composite) { - final Group container2 = new Group(composite, SWT.None); - container2.setLayout(new GridLayout(3,false)); - GridData innergrid2 = new GridData(GridData.FILL_HORIZONTAL); - innergrid2.horizontalSpan = 3; - container2.setLayoutData(innergrid2); - container2.setText("Generate:"); - - final Label messageLabel3 = new Label(container2, SWT.NONE); - messageLabel3.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1)); - messageLabel3.setText("To Generate a new Signing Key use the Generate Signing Key option."); - - Label warningLabel2 = new Label(container2,SWT.FILL | SWT.WRAP); - warningLabel2.setText("Generate a new Signing Key:"); - warningLabel2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - Label dummy2 = new Label(container2,0); - dummy2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - final Button updateSigningKey = new Button(container2, SWT.PUSH); - updateSigningKey.setText("Generate Key"); - GridData buttonGridData2 = new GridData(GridData.END); - buttonGridData2.horizontalAlignment = SWT.RIGHT; - buttonGridData2.horizontalSpan = 1; - buttonGridData2.minimumWidth = 120; - updateSigningKey.setLayoutData(buttonGridData2); - updateSigningKey.addSelectionListener(new SelectionListener() { - @Override - public void widgetSelected(SelectionEvent event) { - if( !destinationKeyFileField.getText().isEmpty()) - { - regenerate = true; - UpdateSignKeyDialog.this.setReturnCode(InputDialog.OK); - okPressed(); - UpdateSignKeyDialog.this.close(); - } - else - JOptionPane.showMessageDialog(null, "Enclave Signing Key field is not provided.", "Error", - JOptionPane.ERROR_MESSAGE); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - } - }); - } - - - @Override - protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText("Import or (Re)Generate Enclave Signing Key"); - } - - @Override - protected void okPressed() { - - handler.sourceKeyFile = sourceKeyFileField.getText(); - handler.destinationKeyFile = destinationKeyFileField.getText(); - if((!sourceKeyFileField.getText().isEmpty() && !destinationKeyFileField.getText().isEmpty() && - (new File(sourceKeyFileField.getText())).isFile()) - || regenerate == true ) - { - System.out.println("regenerate = " + regenerate); - super.okPressed(); - } - else - { - if(sourceKeyFileField.getText().isEmpty() && destinationKeyFileField.getText().isEmpty()) - JOptionPane.showMessageDialog(null, "Enclave Signing Key and Import Singing Key are not provided.", "Error", - JOptionPane.ERROR_MESSAGE); - else - { - if(sourceKeyFileField.getText().isEmpty()) - JOptionPane.showMessageDialog(null, "Import Singing Key is not provided.", "Error", - JOptionPane.ERROR_MESSAGE); - else - if(!(new File(sourceKeyFileField.getText())).isFile()) - JOptionPane.showMessageDialog(null, "Invalid Import Singing Key.", "Error", - JOptionPane.ERROR_MESSAGE); - - if(destinationKeyFileField.getText().isEmpty()) - JOptionPane.showMessageDialog(null, "Enclave Signing Key is not provided.", "Error", - JOptionPane.ERROR_MESSAGE); - } - } - - } - - - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveredPathInfo.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveredPathInfo.java deleted file mode 100644 index d6291745..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveredPathInfo.java +++ /dev/null @@ -1,202 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.discovery; - -import java.util.List; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo; -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredScannerInfoSerializable; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -import com.intel.sgx.Activator; -/* - * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code. - */ -public class SGXSDKDiscoveredPathInfo implements IDiscoveredPathInfo { - - private final IProject mProject; - private long mLastUpdate = IFile.NULL_STAMP; - private IPath[] mIncludePaths; - private Map mSymbols; - private boolean mNeedReindexing = false; - private static final IPath LINUX_MK = new Path("sgx/Makefile"); - - //Keys for preferences - // public static final String LAST_UPDATE = "lastUpdate"; //$NON-NLS-1$ - - - public SGXSDKDiscoveredPathInfo(IProject project) { - this.mProject = project; - load(); - } - - @Override - public IProject getProject() { - return mProject; - } - - @Override - public IPath[] getIncludePaths() { - if (mNeedReindexing) { - CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(mProject)); - mNeedReindexing = false; - } - return mIncludePaths; - } - - void setIncludePaths(List pathStrings) { - mIncludePaths = new IPath[pathStrings.size()]; - int i = 0; - for (String path : pathStrings) - mIncludePaths[i++] = new Path(path); - mNeedReindexing = true; - } - - @Override - public Map getSymbols() { - if (mSymbols == null) - mSymbols = new HashMap(); - return mSymbols; - } - - void setSymbols(Map symbols) { - this.mSymbols = symbols; - } - - @Override - public IDiscoveredScannerInfoSerializable getSerializable() { - return null; - } - - public void update(IProgressMonitor monitor) throws CoreException { - if (!needUpdating()) - return; - - new SGXSDKDiscoveryUpdater(this).runUpdate(monitor); - - if (mIncludePaths != null && mSymbols != null) { - recordUpdate(); - save(); - } - } - - private boolean needUpdating() { - - - if (mLastUpdate == IFile.NULL_STAMP) { - return true; - } - - return mProject.getFile(LINUX_MK).getLocalTimeStamp() > mLastUpdate; - } - - private void recordUpdate() { - mLastUpdate = mProject.getFile(LINUX_MK).getLocalTimeStamp(); - } - - public void delete() { - mLastUpdate = IFile.NULL_STAMP; - } - - private File getInfoFile() { - File stateLoc = Activator.getDefault().getStateLocation().toFile(); - return new File(stateLoc, mProject.getName() + ".pathInfo"); //$NON-NLS-1$ - } - - private void save() { - try { - File infoFile = getInfoFile(); - infoFile.getParentFile().mkdirs(); - PrintStream out = new PrintStream(infoFile); - - out.print("t,"); //$NON-NLS-1$ - out.print(mLastUpdate); - out.println(); - - for (IPath include : mIncludePaths) { - out.print("i,"); //$NON-NLS-1$ - out.print(include.toPortableString()); - out.println(); - } - - for (Entry symbol : mSymbols.entrySet()) { - out.print("d,"); //$NON-NLS-1$ - out.print(symbol.getKey()); - out.print(","); //$NON-NLS-1$ - out.print(symbol.getValue()); - out.println(); - } - - out.close(); - } catch (IOException e) { - Activator.log(e); - } - - } - - private void load() { - try { - File infoFile = getInfoFile(); - if (!infoFile.exists()) - return; - - long timestamp = IFile.NULL_STAMP; - List includes = new ArrayList(); - Map defines = new HashMap(); - - BufferedReader reader = new BufferedReader(new FileReader(infoFile)); - for (String line = reader.readLine(); line != null; line = reader.readLine()) { - switch (line.charAt(0)) { - case 't': - timestamp = Long.valueOf(line.substring(2)); - break; - case 'i': - includes.add(Path.fromPortableString(line.substring(2))); - break; - case 'd': - int n = line.indexOf(',', 2); - if (n == -1) - defines.put(line.substring(2), ""); //$NON-NLS-1$ - else - defines.put(line.substring(2, n), line.substring(n + 1)); - break; - } - } - reader.close(); - - mLastUpdate = timestamp; - mIncludePaths = includes.toArray(new IPath[includes.size()]); - mSymbols = defines; - } catch (IOException e) { - Activator.log(e); - } - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveryUpdater.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveryUpdater.java deleted file mode 100644 index 67d74e9a..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKDiscoveryUpdater.java +++ /dev/null @@ -1,310 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.discovery; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.envvar.IEnvironmentVariable; -import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager; -import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.managedbuilder.core.IBuilder; -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -import com.intel.sgx.Activator; -import com.intel.sgx.build.SGXSDKCommandLauncher; - -/* - * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code. - */ -public class SGXSDKDiscoveryUpdater { - private final SGXSDKDiscoveredPathInfo mPathInfo; - private final IProject mProject; - - private boolean mCPlusPlus = false; - private String mCommand; - private List mArguments = new ArrayList(); - - public SGXSDKDiscoveryUpdater(SGXSDKDiscoveredPathInfo pathInfo) { - mPathInfo = pathInfo; - mProject = pathInfo.getProject(); - } - - public void runUpdate(IProgressMonitor monitor) throws CoreException { - try { - // Run make -nB to get the list of commands - IPath commandPath = new Path("make"); //$NON-NLS-1$ - String[] args = {"-f", "sgx/Makefile", "-n", "-B" }; //$NON-NLS-1$ - String[] env = calcEnvironment(); - File projectDir = new File(mProject.getLocationURI()); - IPath changeToDirectory = new Path(projectDir.getAbsolutePath()); - Process proc = new SGXSDKCommandLauncher().execute(commandPath, args, env,changeToDirectory, monitor); - if (proc == null) { - return; - } - - BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); - String line = reader.readLine(); - while (line != null) { - checkBuildLine(line); - line = reader.readLine(); - } - - if (mCommand == null) { - return; - } - - // Run the unique commands with special gcc options to extract the - // symbols and paths - // -E -P -v -dD - mArguments.add("-E"); //$NON-NLS-1$ - mArguments.add("-P"); //$NON-NLS-1$ - mArguments.add("-v"); //$NON-NLS-1$ - mArguments.add("-dD"); //$NON-NLS-1$ - - URL url = Activator.findFile(new Path("discovery/" + (mCPlusPlus ? "test.cpp" : "test.c"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - File testFile = new File(FileLocator.toFileURL(url).toURI()); - String testFileName = testFile.getAbsolutePath().replace('\\', '/'); - mArguments.add(testFileName); - - args = mArguments.toArray(new String[mArguments.size()]); - proc = new SGXSDKCommandLauncher().execute(new Path(mCommand), args, env,changeToDirectory, monitor); - - final InputStream errStream = proc.getErrorStream(); - new Thread() { - @Override - public void run() { - checkIncludes(errStream); - }; - }.start(); - - checkDefines(proc.getInputStream()); - } catch (IOException e) { - throw new CoreException(Activator.newStatus(e)); - } catch (URISyntaxException e) { - throw new CoreException(Activator.newStatus(e)); - } - } - - private String[] calcEnvironment() throws CoreException { - IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(mProject); - IBuilder builder = info.getDefaultConfiguration().getBuilder(); - HashMap envMap = new HashMap(); - if (builder.appendEnvironment()) { - ICConfigurationDescription cfgDes = ManagedBuildManager.getDescriptionForConfiguration(builder.getParent().getParent()); - IEnvironmentVariableManager mngr = CCorePlugin.getDefault().getBuildEnvironmentManager(); - IEnvironmentVariable[] vars = mngr.getVariables(cfgDes, true); - for (IEnvironmentVariable var : vars) { - envMap.put(var.getName(), var.getValue()); - } - } - // Add variables from build info - Map builderEnv = builder.getExpandedEnvironment(); - if (builderEnv != null) - envMap.putAll(builderEnv); - List strings = new ArrayList(envMap.size()); - for (Entry entry : envMap.entrySet()) { - StringBuffer buffer = new StringBuffer(entry.getKey()); - buffer.append('=').append(entry.getValue()); - strings.add(buffer.toString()); - } - return strings.toArray(new String[strings.size()]); - } - - private static class Line { - private final String line; - private int pos; - - public Line(String line) { - this.line = line; - } - - public Line(String line, int pos) { - this(line); - this.pos = pos; - } - - public String getToken() { - skipWhiteSpace(); - if (pos == line.length()) - return null; - - int start = pos; - boolean inQuote = false; - - while (true) { - char c = line.charAt(pos); - if (c == ' ') { - if (!inQuote) - return line.substring(start, pos); - } else if (c == '"') { - inQuote = !inQuote; - } - - if (++pos == line.length()) - return null; - } - - } - - private String getRemaining() { - if (pos == line.length()) - return null; - - skipWhiteSpace(); - String rc = line.substring(pos); - pos = line.length(); - return rc; - } - - private void skipWhiteSpace() { - while (true) { - if (pos == line.length()) - return; - char c = line.charAt(pos); - if (c == ' ') - pos++; - else - return; - } - } - } - - private void checkBuildLine(String text) { - Line line = new Line(text); - String cmd = line.getToken(); - if (cmd == null) { - return; - } else if (cmd.endsWith("g++")) { //$NON-NLS-1$ - if (mCommand == null || !mCPlusPlus) { - mCommand = cmd; - mCPlusPlus = true; - } - gatherOptions(line); - } else if (cmd.endsWith("gcc")) { //$NON-NLS-1$ - if (mCommand == null){ - mCommand = cmd; - } - gatherOptions(line); - } - - } - - private void gatherOptions(Line line) { - for (String option = line.getToken(); option != null; option = line.getToken()) { - if (option.startsWith("-")) { //$NON-NLS-1$ - // only look at options - if (option.equals("-I")) { //$NON-NLS-1$ - String dir = line.getToken(); - if (dir != null) - addArg(option + dir); - } else if (option.startsWith("-I")) { //$NON-NLS-1$ - addArg(option); - } else if (option.equals("-D")) { //$NON-NLS-1$ - String def = line.getToken(); - if (def != null) - addArg(option + def); - } else if (option.startsWith("-D")) { //$NON-NLS-1$ - addArg(option); - } else if (option.startsWith("-f")) { //$NON-NLS-1$ - addArg(option); - } else if (option.startsWith("-m")) { //$NON-NLS-1$ - addArg(option); - } else if (option.startsWith("--sysroot")) { //$NON-NLS-1$ - addArg(option); - } - } - } - } - - private void addArg(String arg) { - if (!mArguments.contains(arg)) - mArguments.add(arg); - } - - private void checkIncludes(InputStream in) { - try { - List includes = new ArrayList(); - boolean inIncludes1 = false; - boolean inIncludes2 = false; - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - String line = reader.readLine(); - while (line != null) { - if (!inIncludes1) { - if (line.equals("#include \"...\" search starts here:")) //$NON-NLS-1$ - inIncludes1 = true; - } else { - if (!inIncludes2) { - if (line.equals("#include <...> search starts here:")) //$NON-NLS-1$ - inIncludes2 = true; - else - includes.add(line.trim()); - } else { - if (line.equals("End of search list.")) { //$NON-NLS-1$ - mPathInfo.setIncludePaths(includes); - } else { - includes.add(line.trim()); - } - } - } - line = reader.readLine(); - } - } catch (IOException e) { - Activator.log(e); - } - } - - private void checkDefines(InputStream in) { - try { - Map defines = new HashMap(); - BufferedReader reader = new BufferedReader(new InputStreamReader(in)); - String line = reader.readLine(); - while (line != null) { - if (line.startsWith("#define")) { //$NON-NLS-1$ - Line l = new Line(line, 7); - String var = l.getToken(); - if (var == null) - continue; - String value = l.getRemaining(); - if (value == null) - value = ""; //$NON-NLS-1$ - defines.put(var, value); - } - line = reader.readLine(); - } - mPathInfo.setSymbols(defines); - } catch (IOException e) { - Activator.log(e); - } - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKScannerInfoCollector.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKScannerInfoCollector.java deleted file mode 100644 index 7a154e49..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/discovery/SGXSDKScannerInfoCollector.java +++ /dev/null @@ -1,103 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.discovery; - -import java.util.List; -import java.util.Map; - -import org.eclipse.cdt.make.core.scannerconfig.IDiscoveredPathManager.IDiscoveredPathInfo; -import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3; -import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollectorCleaner; -import org.eclipse.cdt.make.core.scannerconfig.InfoContext; -import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes; -import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; - -/* - * This code has been taken from the NDK plugin for Linux. If there is an update to this code there, then refactor this code. - */ -public class SGXSDKScannerInfoCollector implements IScannerInfoCollector3,IScannerInfoCollectorCleaner,IManagedScannerInfoCollector{ - - private SGXSDKDiscoveredPathInfo sgxPathInfo; - - @Override - public void setProject(IProject project) { - throw new Error("Not implemented"); - } - - @Override - public void updateScannerConfiguration(IProgressMonitor monitor) - throws CoreException { - sgxPathInfo.update(monitor); - } - - @Override - public IDiscoveredPathInfo createPathInfoObject() { - return sgxPathInfo; - } - - @Override - public void contributeToScannerConfig(Object resource, @SuppressWarnings("rawtypes") Map scannerInfo) { - throw new Error("Not implemented"); - } - - @SuppressWarnings("rawtypes") - @Override - public List getCollectedScannerInfo(Object resource, ScannerInfoTypes type) { - throw new Error("Not implemented"); - } - - @Override - public Map getDefinedSymbols() { - throw new Error("Not implemented"); - } - - @Override - public List getIncludePaths() { - throw new Error("Not implemented"); - } - - @Override - public void deleteAllPaths(IResource resource) { - throw new Error("Not implemented"); - } - - @Override - public void deleteAllSymbols(IResource resource) { - throw new Error("Not implemented"); - } - - @Override - public void deletePath(IResource resource, String path) { - throw new Error("Not implemented"); - } - - @Override - public void deleteSymbol(IResource resource, String symbol) { - throw new Error("Not implemented"); - } - - @Override - public void deleteAll(IResource resource) { - sgxPathInfo.delete(); - } - - @Override - public void setInfoContext(InfoContext context) { - sgxPathInfo = new SGXSDKDiscoveredPathInfo(context.getProject()); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddEnclave.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddEnclave.java deleted file mode 100644 index 60748804..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddEnclave.java +++ /dev/null @@ -1,213 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Map; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.AddEnclaveFileDialog; -import com.intel.sgx.preferences.PreferenceConstants; - -public class AddEnclave extends ModuleCreationBaseHandler implements IHandler { - - public String edlFilename = ""; - public String linuxMakePath = ""; - @Override - public void addHandlerListener(IHandlerListener handlerListener) { - } - - @Override - public void dispose() { - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - String edlBasename,linuxPath,enclaveBasename; - IProject project = null; - - // Display display = Display.getCurrent(); - // Shell shell = new Shell(display); - Shell shell = null; - AddEnclaveFileDialog dialog = new AddEnclaveFileDialog(shell, this); - if (dialog.open() != InputDialog.OK) { - return null; - } - - if((edlFilename.isEmpty())){ - System.err.println("No Enclave selected to Import."); - return null; - } - - edlBasename = edlFilename; - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if (selection instanceof IStructuredSelection) { - element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IResource) { - project = ((IResource) element).getProject(); - } - } - if (!project.exists()) { - System.err.println("Error: Project not found"); - return null; - } - - for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){ - } - - - - - IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename)); - - - if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){ - linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString(); - enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString(); - } - - else{ - linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString(); - enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString(); - } - - IProgressMonitor monitor = new NullProgressMonitor(); - TemplateCore template = null; - if(isCPProject(project)) - if(dialog.generateApp()) - { - template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++WithSample"); - } - else - { - template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveC++Minimal"); - } - else - if(dialog.generateApp()) - { - template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCWithSample"); - } - else - { - template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveCMinimal"); - } - - Map valueStore = template.getValueStore(); - valueStore.put("projectName", project.getName()); - valueStore.put("workspacePath", linuxPath); - valueStore.put("baseName", enclaveBasename); - valueStore.put("enclaveName",edlFilename); - valueStore.put("EnclaveName",capitalize(edlFilename)); - valueStore.put("ENCLAVENAME",edlFilename.toUpperCase()); - valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH)); - - IStatus[] statuses = template.executeTemplateProcesses(monitor, false); - for(IStatus e: statuses) - { - } - - ManagedBuildManager.saveBuildInfo(project, true); - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - - - return null; - } - - private String capitalize(final String line) { - return Character.toUpperCase(line.charAt(0)) + line.substring(1); - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener handlerListener) { - } - - public void setFilename(String filename) { - edlFilename = filename; - } - - - - - public static void copyFile(File source, File dest) throws IOException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (Exception e) { - Activator.log(e); - System.err.println("Error: " + e.toString()); - } finally { - try { - if (in != null) - in.close(); - } finally { - if (out != null) - out.close(); - } - } - } - } - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddSGXNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddSGXNature.java deleted file mode 100644 index 58504a2c..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddSGXNature.java +++ /dev/null @@ -1,163 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.util.Map; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -//import org.eclipse.core.resources.IWorkspaceRunnable; -//import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -//import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.intel.sgx.Activator; -import com.intel.sgx.natures.SGXNature; - -public class AddSGXNature implements IHandler { - - private IProject project; - - public AddSGXNature() { - project = null; - } - - @Override - public void addHandlerListener(IHandlerListener arg0) { - } - - @Override - public void dispose() { - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if (selection instanceof IStructuredSelection) { - element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IResource) { - project = ((IResource) element).getProject(); - } - } - if (!project.exists()) { - System.err.println("Error: Project not found"); - return null; - } else { - try { - TemplateCore template = TemplateEngine.getDefault().getTemplateById("AddSGXNature"); - - Map valueStore = template.getValueStore(); - valueStore.put("projectName",project.getName()); - valueStore.put("baseName",project.getName()); - - IProgressMonitor monitor = new NullProgressMonitor(); - template.executeTemplateProcesses(monitor, false); - - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - try{ - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - - String[] newNatures = new String[natures.length + 1]; - System.arraycopy(natures, 0, newNatures, 0, natures.length); - newNatures[natures.length] = SGXNature.NATURE_ID; - IStatus status = workspace.validateNatureSet(newNatures); - - if (status.getCode() == IStatus.OK) { - description.setNatureIds(newNatures); - project.setDescription(description, null); - } - - project.refreshLocal(IResource.DEPTH_ONE,null); - } catch(CoreException e){ - Activator.log(e); - throw new InvocationTargetException(e); - } - } catch(InvocationTargetException e){ - Activator.log(e); - e.printStackTrace(); - } - - try { - project.refreshLocal(IResource.DEPTH_INFINITE,null); - } catch (CoreException e) { - e.printStackTrace(); - } - } - return null; - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener arg0) { - } - - public static void copyFile(File source, File dest) throws IOException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (Exception e) { - System.err.println("Error: " + e.toString()); - - } finally { - try { - if (in != null) - in.close(); - } finally { - if (out != null) - out.close(); - } - } - } - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddTrustedStaticLib.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddTrustedStaticLib.java deleted file mode 100644 index 98efe947..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddTrustedStaticLib.java +++ /dev/null @@ -1,193 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Map; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.AddTrustedStaticLibFileDialog; -import com.intel.sgx.preferences.PreferenceConstants; - -public class AddTrustedStaticLib extends ModuleCreationBaseHandler implements IHandler { - - public String edlFilename = ""; - public String linuxMakePath = ""; - - @Override - public void addHandlerListener(IHandlerListener handlerListener) { - } - - @Override - public void dispose() { - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - String edlBasename,linuxPath,enclaveBasename; - IProject project = null; - - // Display display = Display.getCurrent(); - // Shell shell = new Shell(display); - Shell shell = null; - AddTrustedStaticLibFileDialog dialog = new AddTrustedStaticLibFileDialog(shell, this); - if (dialog.open() != InputDialog.OK) { - return null; - } - - if((edlFilename.isEmpty() )){ - System.err.println("No Enclave selected to Import."); - return null; - } - - edlBasename = edlFilename; - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if (selection instanceof IStructuredSelection) { - element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IResource) { - project = ((IResource) element).getProject(); - } - } - if (!project.exists()) { - System.err.println("Error: Project not found"); - return null; - } - - for (IConfigurationElement i : Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.core.resources.projectNature")){ - } - - - - - IPath linuxMkRelPath = (Path.fromOSString(linuxMakePath)).makeRelativeTo(project.getLocation().append("sgx").append("enclave_"+edlBasename)); - - - if(linuxMkRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){ - linuxPath = linuxMkRelPath.removeLastSegments(3).toOSString(); - enclaveBasename = linuxMkRelPath.removeLastSegments(2).lastSegment().toString(); - } - - else{ - linuxPath = linuxMkRelPath.removeLastSegments(2).toOSString(); - enclaveBasename = linuxMkRelPath.removeLastSegments(1).lastSegment().toString(); - } - - IProgressMonitor monitor = new NullProgressMonitor(); - TemplateCore template = null; - if(isCPProject(project)) - template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryC++Minimal"); - else - template = TemplateEngine.getDefault().getTemplateById("SGXTrustedStaticLibraryCMinimal"); - - Map valueStore = template.getValueStore(); - valueStore.put("projectName", project.getName()); - valueStore.put("workspacePath", linuxPath); - valueStore.put("baseName", enclaveBasename); - valueStore.put("enclaveName",edlFilename); - valueStore.put("EnclaveName",capitalize(edlFilename)); - valueStore.put("ENCLAVENAME",edlFilename.toUpperCase()); - valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH)); - - IStatus[] statuses = template.executeTemplateProcesses(monitor, false); - - - ManagedBuildManager.saveBuildInfo(project, true); - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - return null; - } - - private String capitalize(final String line) { - return Character.toUpperCase(line.charAt(0)) + line.substring(1); - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener handlerListener) { - } - - public void setFilename(String filename) { - edlFilename = filename; - } - - public static void copyFile(File source, File dest) throws IOException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (Exception e) { - Activator.log(e); - System.err.println("Error: " + e.toString()); - } finally { - try { - if (in != null) - in.close(); - } finally { - if (out != null) - out.close(); - } - } - } - } - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddUntrustedModule.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddUntrustedModule.java deleted file mode 100644 index 541654f1..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/AddUntrustedModule.java +++ /dev/null @@ -1,231 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Map; - - - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; - -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.AddUntrustedModuleDialog; -import com.intel.sgx.preferences.PreferenceConstants; - -public class AddUntrustedModule extends ModuleCreationBaseHandler implements IHandler { - - public String edlFilename = ""; - public String libPath = ""; - private IPath edlCanonicalFilename; - private IPath libCanonicalPathname; - - @Override - public void addHandlerListener(IHandlerListener handlerListener) { - } - - @Override - public void dispose() { - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - String edlBasename,edlPath,linuxLibPath,modulePath,enclaveBasename; - IProject project = null; - - //Display display = Display.getCurrent(); - Shell shell = null; - - AddUntrustedModuleDialog dialog = new AddUntrustedModuleDialog(shell, this); - if (dialog.open() != InputDialog.OK) { - return null; - } - - if((edlFilename.isEmpty() && libPath.isEmpty())){ - System.err.println("No Enclave selected to Import."); - return null; - } - if( edlFilename.isEmpty() ){ - System.err.println("Edl File not selected."); - return null; - } - edlCanonicalFilename = Path.fromOSString(edlFilename); - if (!edlCanonicalFilename.getFileExtension().toLowerCase().equals("edl")) { - System.err.println("Error: EDL file extension = "+ edlCanonicalFilename.getFileExtension()); - return null; - } - edlBasename = edlCanonicalFilename.removeFileExtension().lastSegment(); - - - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if (selection instanceof IStructuredSelection) { - element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IResource) { - project = ((IResource) element).getProject(); - } - } - if (!project.exists()) { - System.err.println("Error: Project not found"); - return null; - } - - IPath targetRelPath = project.getProjectRelativePath().append("sgx").append("untrusted_" + edlBasename); - - try { - for (int i = 1; i <= targetRelPath.segmentCount(); i++) { - IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i)); - - if (!subfolder.exists()) { - subfolder.create(true, true, null); - } - } - } catch (CoreException e) { - System.err.println("Error: Error creating enclave directory."); - Activator.log(e); - e.printStackTrace(); - } - - IPath edlRelPath = (Path.fromOSString(edlFilename)).makeRelativeTo(project.getLocation().append("sgx")); - edlPath = edlRelPath.toOSString(); - IPath linuxLibRelPath = (Path.fromOSString(libPath)).makeRelativeTo(project.getLocation().append("sgx")); - - if(linuxLibRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("sgx")){ - linuxLibPath = linuxLibRelPath.removeLastSegments(3).toOSString(); - modulePath = linuxLibRelPath.removeFirstSegments(linuxLibRelPath.segmentCount()-3).removeLastSegments(1).toOSString(); - } - else if(linuxLibRelPath.removeLastSegments(1).lastSegment().toString().equalsIgnoreCase("src")){ - linuxLibPath = linuxLibRelPath.removeLastSegments(3).toOSString(); - modulePath = linuxLibRelPath.removeFirstSegments(linuxLibRelPath.segmentCount()-3).removeLastSegments(1).toOSString(); - } - else{ - linuxLibPath = linuxLibRelPath.removeLastSegments(2).toOSString(); - modulePath = linuxLibRelPath.removeFirstSegments(linuxLibRelPath.segmentCount()-2).removeLastSegments(1).toOSString(); - } - - IProgressMonitor monitor = new NullProgressMonitor(); - TemplateCore template = null; - if(isCPProject(project)) - template = TemplateEngine.getDefault().getTemplateById("SGXUntrustedModuleC++Minimal"); - else - template = TemplateEngine.getDefault().getTemplateById("SGXUntrustedModuleCMinimal"); - - - - Map valueStore = template.getValueStore(); - - - valueStore.put("projectName", project.getName()); - valueStore.put("sourcepath",linuxLibPath); - valueStore.put("edlPath", edlPath); - valueStore.put("baseName", edlBasename); - valueStore.put("workspacePath", linuxLibPath);//deprecate - valueStore.put("modPath", modulePath); - valueStore.put("ENCLAVENAME",edlBasename.toUpperCase()); - valueStore.put("libPath",libPath); - valueStore.put("SdkPathFromPlugin", Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH)); - - IStatus[] statuses = template.executeTemplateProcesses(monitor, false); - - try { - copyFile(new File(edlFilename), project.getLocation().append("sgx").append("untrusted_"+edlBasename).append(edlBasename+".edl").toFile()); - } catch (IOException e1) { - e1.printStackTrace(); - } - - - ManagedBuildManager.saveBuildInfo(project, true); - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - return null; - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener handlerListener) { - } - - public void setFilename(String filename) { - edlFilename = filename; - } - - public static void copyFile(File source, File dest) throws IOException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (Exception e) { - Activator.log(e); - System.err.println("Error: " + e.toString()); - } finally { - try { - if (in != null) - in.close(); - } finally { - if (out != null) - out.close(); - } - } - } - } - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/EnclaveConfigHandler.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/EnclaveConfigHandler.java deleted file mode 100644 index 286281e1..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/EnclaveConfigHandler.java +++ /dev/null @@ -1,176 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.IOException; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.ui.dialogs.FilteredResourcesSelectionDialog; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.SAXException; - -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.EnclaveConfigDialog; -import com.intel.sgx.dialogs.SGXDialogBase; - -public class EnclaveConfigHandler extends SGXHandler { - - public String prodId; - public String isvSvn; - public String stackMinSize; - public String stackMaxSize; - public String heapMinSize; - public String heapInitSize; - public String heapMaxSize; - public String tcsNum; - public String tcsMaxNum; - public String tcsPool; - public String tcsPolicy; - public String disableDebug; - private IFile configPath; - - @Override - public void addHandlerListener(IHandlerListener arg0) { - } - - @Override - public void dispose() { - } - - @Override - public Object executeSGXStuff() throws CancelException, ErrorException { - - FilteredResourcesSelectionDialog d = SGXDialogBase - .dialogForConfig(shell); - d.setTitle("Select Config File"); - if (d.open() != Dialog.OK) { - cancel(); - } - - configPath = ((IFile) d.getResult()[0]); - - readConfig(configPath.getLocation()); - EnclaveConfigDialog dialog = new EnclaveConfigDialog(shell, this); - if (dialog.open() != InputDialog.OK) { - return null; - } - writeConfig(); - refreshProject(); - - return null; - } - - protected void writeConfig() { - IProgressMonitor monitor = new NullProgressMonitor(); - TemplateCore template = TemplateEngine.getDefault().getTemplateById("SGXEnclaveConfig"); - - Map valueStore = template.getValueStore(); - valueStore.put("projectName", project.getName()); - valueStore.put("configFile", configPath.getProjectRelativePath().toOSString()); - valueStore.put("ProdID", this.prodId); - valueStore.put("IsvSvn", this.isvSvn); - valueStore.put("StackMinSize", this.stackMinSize); - valueStore.put("StackMaxSize", this.stackMaxSize); - valueStore.put("HeapMinSize", this.heapMinSize); - valueStore.put("HeapInitSize", this.heapInitSize); - valueStore.put("HeapMaxSize", this.heapMaxSize); - valueStore.put("TcsNum", this.tcsNum); - valueStore.put("TcsMaxNum", this.tcsMaxNum); - valueStore.put("TcsMinPool", this.tcsPool); - valueStore.put("TcsPolicy", this.tcsPolicy); - valueStore.put("DisableDebug", this.disableDebug); - IStatus[] result = template.executeTemplateProcesses(monitor, true); - - for (IStatus status: result) { - } - } - - - - protected void readConfig(IPath configPath) throws ErrorException { - - try { - String xmlFile = configPath.toString(); - File configFile = new File(xmlFile); - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder; - dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(configFile); - doc.getDocumentElement().normalize(); - - NodeList nList = doc.getElementsByTagName("EnclaveConfiguration"); - Node nNode = nList.item(0); - - if (nNode.getNodeType() == Node.ELEMENT_NODE) { - Element e = (Element) nNode; - this.prodId = e.getElementsByTagName("ProdID").item(0) - .getTextContent(); - this.isvSvn = e.getElementsByTagName("ISVSVN").item(0) - .getTextContent(); - this.stackMinSize = e.getElementsByTagName("StackMinSize") - .item(0).getTextContent(); - this.stackMaxSize = e.getElementsByTagName("StackMaxSize") - .item(0).getTextContent(); - this.heapMinSize = e.getElementsByTagName("HeapMinSize") - .item(0).getTextContent(); - this.heapInitSize = e.getElementsByTagName("HeapInitSize") - .item(0).getTextContent(); - this.heapMaxSize = e.getElementsByTagName("HeapMaxSize") - .item(0).getTextContent(); - this.tcsNum = e.getElementsByTagName("TCSNum").item(0) - .getTextContent(); - this.tcsMaxNum = e.getElementsByTagName("TCSMaxNum").item(0) - .getTextContent(); - this.tcsPool = e.getElementsByTagName("TCSMinPool").item(0) - .getTextContent(); - this.tcsPolicy = e.getElementsByTagName("TCSPolicy").item(0) - .getTextContent(); - this.disableDebug = e.getElementsByTagName("DisableDebug") - .item(0).getTextContent(); - } - - } catch (ParserConfigurationException e) { - Activator.log(e); - e.printStackTrace(); - quitWithError("Could not parse '"+configPath.toOSString()+"'"); - } catch (SAXException e) { - Activator.log(e); - e.printStackTrace(); - quitWithError("Could not parse '"+configPath.toOSString()+"'"); - } catch (IOException e) { - Activator.log(e); - e.printStackTrace(); - quitWithError("Could not read'"+configPath.toOSString()+"'"); - } - - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/ModuleCreationBaseHandler.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/ModuleCreationBaseHandler.java deleted file mode 100644 index d97fa245..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/ModuleCreationBaseHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; - -public class ModuleCreationBaseHandler { - public boolean isCPProject(IProject project) - { - boolean isCPProject = false; - IProjectDescription description; - try { - description = project.getDescription(); - String[] natures = description.getNatureIds(); - for(String nature: natures){ - if(nature.equals("org.eclipse.cdt.core.ccnature")) - isCPProject = true; - } - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return isCPProject; - - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/RemoveEnclave.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/RemoveEnclave.java deleted file mode 100644 index 73808346..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/RemoveEnclave.java +++ /dev/null @@ -1,169 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.handlers.HandlerUtil; - -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.RemoveEnclaveFileDialog; - -public class RemoveEnclave implements IHandler { - - public String edlFilename = ""; - private IPath edlCanonicalFilename; - - @Override - public void addHandlerListener(IHandlerListener handlerListener) { - } - - @Override - public void dispose() { - } - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - String edlBasename; - IProject project = null; - - // Display display = Display.getCurrent(); - // Shell shell = new Shell(display); - - RemoveEnclaveFileDialog dialog = new RemoveEnclaveFileDialog(null, this); - - if (dialog.open() != InputDialog.OK) { - return null; - } - - edlCanonicalFilename = Path.fromOSString(edlFilename); - edlBasename = edlCanonicalFilename.lastSegment(); - - if(edlBasename.isEmpty()){ - return null; - } - - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if(selection instanceof IStructuredSelection) { - element = ((IStructuredSelection)selection).getFirstElement(); - if (element instanceof IResource) { - project= ((IResource)element).getProject(); - } - } - if (!project.exists()) { - System.err.println("Error: Project not found"); - return null; - } - - IPath targetRelPath = project.getProjectRelativePath().append("sgx").append("enclave_" + edlBasename); - - try { - for (int i=1;i<=targetRelPath.segmentCount();i++) { - IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i)); - - if (subfolder.exists()){ - if(subfolder.getProjectRelativePath().toOSString().contains("enclave_"+edlBasename)){ - subfolder.delete(true, true, null); - break; - } - } - } - targetRelPath = project.getProjectRelativePath().append("sgx").append(edlBasename); - for (int i=1;i<=targetRelPath.segmentCount();i++) { - IFolder subfolder = project.getFolder(targetRelPath.uptoSegment(i)); - - if (subfolder.exists()){ - if(subfolder.getProjectRelativePath().toOSString().contains(edlBasename)){ - subfolder.delete(true, true, null); - break; - } - } - } - } catch (Exception e) { - Activator.log(e); - } - - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - Activator.log(e); - } catch (IllegalArgumentException e){ - Activator.log(e); - } - - return null; - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener handlerListener) { - } - - public static void copyFile(File source, File dest) throws IOException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (Exception e) { - System.err.println("Error: " + e.toString()); - Activator.log(e); - } finally { - try { - if (in != null) - in.close(); - } finally { - if (out != null) - out.close(); - } - } - } - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXHandler.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXHandler.java deleted file mode 100644 index 81f4b855..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXHandler.java +++ /dev/null @@ -1,206 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; - -import javax.swing.JOptionPane; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; - -/** - * Utility base class for all Handlers The derived classes must implement - * executeSgxStuff() instead of execute(). The user may call methods cancel(), - * quitWithError() & info() - * - * @author mlutescu - * - */ -public abstract class SGXHandler implements IHandler { - - public String projectPath = null; - protected IProject project; - protected Shell shell; - - /** - * Throwing this IS an error. Means that the process can't continue - * - * @author mlutescu - * - */ - static protected class ErrorException extends Exception { - - public ErrorException(String message) { - super(message); - } - - } - - /** - * Throwing this is not an error; just signals stop of execution because the - * user cancels - * - * @author mlutescu - * - */ - static protected class CancelException extends Exception { - - public CancelException() { - super(); - } - - } - - @Override - public final Object execute(ExecutionEvent event) throws ExecutionException { - try { - initializeShell(); - initializeProject(event); - return executeSGXStuff(); - } catch (ErrorException e) { - e.printStackTrace(); - } catch (CancelException e) { - // do nothing by design ; it's Ok to not handle this exception. - } - return null; - } - - protected abstract Object executeSGXStuff() throws ErrorException, - CancelException; - - public SGXHandler() { - super(); - } - - public static void copyFile(File source, File dest) throws ErrorException { - byte[] bytes = new byte[4092]; - if (source != null && dest != null) { - if (source.isFile()) { - FileInputStream in = null; - FileOutputStream out = null; - try { - in = new FileInputStream(source); - out = new FileOutputStream(dest); - int len; - while ((len = in.read(bytes)) != -1) { - out.write(bytes, 0, len); - } - } catch (IOException e) { - System.err.println("Error: " + e.toString()); - quitWithError("Could not copy from\n" + "'" - + source.getAbsolutePath() + "'\n" + "to\n" + "'" - + dest.getAbsolutePath()); - } finally { - try { - if (in != null) { - in.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (out != null) { - try { - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } - } - } - } - - protected static void quitWithError(String message) throws ErrorException { - JOptionPane.showMessageDialog(null, message, "Two Step Enclave Sign", - JOptionPane.ERROR_MESSAGE); - throw new ErrorException(message); - } - - static protected void cancel() throws CancelException { - throw new CancelException(); - } - - protected void initializeProject(ExecutionEvent event) - throws ErrorException { - project = null; - ISelection selection = HandlerUtil.getCurrentSelection(event); - Object element = null; - if (selection instanceof IStructuredSelection) { - element = ((IStructuredSelection) selection).getFirstElement(); - if (element instanceof IResource) { - project = ((IResource) element).getProject(); - } - } - - if (!project.exists()) { - quitWithError("Project not found"); - } - - } - - @Override - public boolean isEnabled() { - return true; - } - - @Override - public boolean isHandled() { - return true; - } - - @Override - public void removeHandlerListener(IHandlerListener arg0) { - } - - @Override - public void addHandlerListener(IHandlerListener arg0) { - } - - @Override - public void dispose() { - } - - protected void initializeShell() { - shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - } - - protected void refreshProject() throws ErrorException { - try { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e1) { - quitWithError(e1.getLocalizedMessage()); - } - } - - protected void info(String windowName, String message) { - JOptionPane.showMessageDialog(null, message,windowName, - JOptionPane.INFORMATION_MESSAGE); - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXSDKWizardHandler.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXSDKWizardHandler.java deleted file mode 100644 index 9259c838..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/SGXSDKWizardHandler.java +++ /dev/null @@ -1,38 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import org.eclipse.cdt.managedbuilder.core.IToolChain; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.ui.wizards.STDWizardHandler; - -public class SGXSDKWizardHandler extends STDWizardHandler { - - public SGXSDKWizardHandler() { - super(null, null); - } - - - @Override - public IToolChain[] getSelectedToolChains() { - IToolChain[] tcs = ManagedBuildManager.getRealToolChains(); - for (IToolChain tc : tcs) { - if (tc.getId().equals("com.intel.sgx.SGXtoolChain")) - return new IToolChain[] { - tc - }; - } - return super.getSelectedToolChains(); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignHandlerBase.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignHandlerBase.java deleted file mode 100644 index 2fcfbb27..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignHandlerBase.java +++ /dev/null @@ -1,196 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; - -import com.intel.sgx.preferences.PreferenceConstants; - -public abstract class TwoStepSignHandlerBase extends SGXHandler { - - public String hashFile = null; - public String configFile = null; - public String enclaveFile = null; - public String externalSignPublicKeyFile = null; - public String externallySignedHashFile = null; - public String outputSignedEnclaveFile = null; - - protected File signtool; - - public TwoStepSignHandlerBase() { - super(); - } - - protected void executeGenData() throws ErrorException { - validateConfigFile(); - validateEnclaveFile(); - - refreshProject(); - executeSignTool(new String[] { "gendata", - "-enclave", enclaveFile, - "-config", configFile, - "-out", hashFile }); - refreshProject(); - - validateHashFile(); - - } - - protected void executeCatSig() throws ErrorException { - validateEnclaveFile(); - validateConfigFile(); - validateHashFile(); - - validateExternalSignPublicKeyFile(); - validateExternallySignedHashFile(); - - executeSignTool("catsig", - // enclave data: - "-enclave", enclaveFile, - "-config", configFile, - // previously generated: - "-unsigned", hashFile, - // externally generated - "-key", externalSignPublicKeyFile, - "-sig", externallySignedHashFile, - // output - "-out", outputSignedEnclaveFile - - ); - - refreshProject(); - - validateOutputSignedEnclaveFile(); - - info("Two Step Enclave Sign","Enclave signed successfully !"); - } - - 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 Intel(R) SGX SDK Directory in Window->Preferences->Intel(R) SGX Preferences. \n Usually the path is in /opt/intel/sgxsdk/" ); - } - - } - - protected void validateEnclaveFile() throws ErrorException { - File enclave = new File(enclaveFile); - if (!enclave.exists() || enclave.isDirectory()) { - quitWithError("Error generating hash! Unsigned Enclave File Not Found! Try building the enclave first"); - } - } - - protected void validateConfigFile() throws ErrorException { - if (configFile == null || configFile.isEmpty()) { - quitWithError("Error Enclave Configuration File Not Found !"); - } - File config = new File(configFile); - if (!config.exists() || config.isDirectory()) { - quitWithError("Enclave Config File Not Found !"); - } - } - - protected void validateExternallySignedHashFile() throws ErrorException { - if (externallySignedHashFile == null || externallySignedHashFile.isEmpty()) { - quitWithError("Error signing enclave! Signature File Not Found !"); - } - - File signature = new File(externallySignedHashFile); - if (!signature.exists() || signature.isDirectory()) { - quitWithError("Error signing enclave! Signature File Not Found !"); - } - } - - protected void validateExternalSignPublicKeyFile() throws ErrorException { - if (externalSignPublicKeyFile == null || externalSignPublicKeyFile.isEmpty()) { - quitWithError("Public Key File Not Found !"); - } - - File publickkey = new File(externalSignPublicKeyFile); - if (!publickkey.exists() || publickkey.isDirectory()) { - quitWithError("Error signing enclave! Public Key File Not Found !"); - } - } - - private void validateOutputSignedEnclaveFile() throws ErrorException { - if(outputSignedEnclaveFile == null || outputSignedEnclaveFile.isEmpty()) - { - quitWithError("Output Signed File Not Found !"); - } - File outputSignedEnclave = new File(outputSignedEnclaveFile); - if(!outputSignedEnclave.exists() || outputSignedEnclave.isDirectory()) - { - quitWithError("Output Signed File Not Found !"); - } - - // TODO Auto-generated method stub - - } - - protected void validateHashFile() throws ErrorException { - if(hashFile == null || hashFile.isEmpty()) - { - quitWithError("Hash File Not Found !"); - } - File hash = new File(hashFile); - if(!hash.exists() || hash.isDirectory()) - { - quitWithError("Hash File Not Found !"); - } - } - - - protected void executeSignTool(String... args) throws ErrorException { - - Process q; - try { - - String[] allArgs = new String[args.length+1]; - allArgs[0] = signtool.getAbsolutePath(); - System.arraycopy(args, 0, allArgs, 1, args.length); - - for (String arg : args){ - } - String fullOutput = ""; - q = Runtime.getRuntime().exec(allArgs); - - BufferedReader stdInput = new BufferedReader(new InputStreamReader( - q.getInputStream())); - BufferedReader stdErr = new BufferedReader(new InputStreamReader( - q.getErrorStream())); - String s = null; - while ((s = stdInput.readLine()) != null) { - } - String[] out = new String[20]; - int i = 0; - while ((out[i] = stdErr.readLine()) != null) { - fullOutput += out[i]+"\n"; - i++; - } - String result = out[i - 1]; - - if (!result.equals("Succeed.")) { - // quitWithError("Error generating hash! " + out[i - 2]); - quitWithError("Error generating hash! " + fullOutput); - } - } catch (IOException e) { - quitWithError(e.getLocalizedMessage()); - } - - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep1.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep1.java deleted file mode 100644 index 365202f5..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep1.java +++ /dev/null @@ -1,74 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import org.eclipse.jface.dialogs.InputDialog; - -import com.intel.sgx.dialogs.SGXDialogBase; -import com.intel.sgx.dialogs.TwoStepSignStep1Dialog1; -import com.intel.sgx.dialogs.TwoStepSignStep1Dialog2; -import com.intel.sgx.dialogs.TwoStepSignStep1Dialog3; - -// Generate Hash -public class TwoStepSignStep1 extends TwoStepSignHandlerBase { - - public TwoStepSignStep1() { - } - - @Override - protected Object executeSGXStuff() throws ErrorException, CancelException { - - initializeSigntool(); - - showDialog1(); - showDialog2(); - showDialog3(); - return null; - } - - private void showDialog1() throws CancelException, ErrorException { - - TwoStepSignStep1Dialog1 dialog1 = new TwoStepSignStep1Dialog1(shell, this); - if (dialog1.open() != InputDialog.OK) { - cancel(); - } - - executeGenData(); - - } - - private void showDialog2() throws CancelException { - TwoStepSignStep1Dialog2 dialog2 = new TwoStepSignStep1Dialog2(shell, - hashFile); - - if (dialog2.open() != InputDialog.OK) { - cancel(); - } - } - - protected void showDialog3() throws CancelException, ErrorException { - SGXDialogBase dialog3 = new TwoStepSignStep1Dialog3(shell, this); - if (dialog3.open() != InputDialog.OK) { - cancel(); - } - - validateExternalSignPublicKeyFile(); - - validateExternallySignedHashFile(); - - executeCatSig(); - - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep2.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep2.java deleted file mode 100644 index a12b460f..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/TwoStepSignStep2.java +++ /dev/null @@ -1,39 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import org.eclipse.jface.dialogs.InputDialog; - -import com.intel.sgx.dialogs.TwoStepSignStep2Dialog; - -// Sign -public class TwoStepSignStep2 extends TwoStepSignHandlerBase { - - public TwoStepSignStep2() { - } - - @Override - protected Object executeSGXStuff() throws ErrorException, CancelException { - initializeSigntool(); - - TwoStepSignStep2Dialog dialog = new TwoStepSignStep2Dialog(shell, this); - if(dialog.open() != InputDialog.OK) { - cancel(); - } - - executeCatSig(); - return null; - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/UpdateSigningKey.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/UpdateSigningKey.java deleted file mode 100644 index c7c7b365..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/UpdateSigningKey.java +++ /dev/null @@ -1,101 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.handlers; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -//import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -//import java.security.KeyPair; -//import java.security.KeyPairGenerator; -//import java.security.NoSuchAlgorithmException; - -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.core.commands.IHandlerListener; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.handlers.HandlerUtil; - -//import org.bouncycastle.openssl.PEMWriter; -import com.intel.sgx.Activator; -import com.intel.sgx.dialogs.UpdateSignKeyDialog; - -public class UpdateSigningKey extends SGXHandler { - - public String sourceKeyFile = null; - public String destinationKeyFile = null; - public String projectPath = null; - - @Override - protected Object executeSGXStuff() throws ErrorException, CancelException { - - UpdateSignKeyDialog dialog = new UpdateSignKeyDialog(shell, this); - int result = dialog.open(); - if (result != InputDialog.OK) { - cancel(); - } - - if(UpdateSignKeyDialog.regenerate == false) - { - IPath sourceFile = Path.fromOSString(sourceKeyFile); - IPath destFile = Path.fromOSString(destinationKeyFile); - copyFile(sourceFile.toFile(), destFile.toFile()); - refreshProject(); - info("Update Intel(R) SGX Enclave Signing Key","copied \n'" + sourceKeyFile + "' into \n'" + destFile + "'"); - } else { - UpdateSignKeyDialog.regenerate = false; - try { - Process q; - String opensslCmd = "openssl genrsa -out " + destinationKeyFile - + " -3 3072"; - q = Runtime.getRuntime().exec(opensslCmd); - BufferedReader stdInput = new BufferedReader( - new InputStreamReader(q.getInputStream())); - BufferedReader stdErr = new BufferedReader( - new InputStreamReader(q.getErrorStream())); - String s = null; - while ((s = stdInput.readLine()) != null) { - } - while ((s = stdErr.readLine()) != null) { - } - project.refreshLocal(IResource.DEPTH_INFINITE, null); - if (q.exitValue() == 0){ - info("Update Intel(R) SGX Enclave Signing Key","'"+destinationKeyFile+"'"+" was generated!"); - } else { - quitWithError("Could not generate '"+destinationKeyFile+"'!!!"); - } - } catch (IOException e) { - Activator.log(e); - e.printStackTrace(); - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - } - return null; - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/about.html b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/about.html deleted file mode 100644 index afabc4fc..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/handlers/about.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - -About - - -

About This Content

- -

June 22, 2007

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/messages.properties b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/messages.properties deleted file mode 100644 index 68048d01..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/messages.properties +++ /dev/null @@ -1,16 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - - -CreateNativeFolders_No_folders=No folders. -CreateNativeFolders_Missing_project_name=Missing project Name. -CreateNativeFolders_Project_does_not_exist=Project does not exist. diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXCCNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXCCNature.java deleted file mode 100644 index a6c3bfc8..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXCCNature.java +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.natures; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; - -public class SGXCCNature implements IProjectNature { - - private IProject project; - public static final String NATURE_ID = "com.intel.sgx.sgxccnature"; - - public SGXCCNature() { - } - - @Override - public void configure() throws CoreException { - } - - @Override - public void deconfigure() throws CoreException { - } - - @Override - public IProject getProject() { - return project; - } - - @Override - public void setProject(IProject project) { - this.project = project; - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXNature.java deleted file mode 100644 index 3a1eb8d2..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXNature.java +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.natures; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; - -public class SGXNature implements IProjectNature { - - private IProject project; - public static final String NATURE_ID = "com.intel.sgx.sgxnature"; - - public SGXNature() { - } - - @Override - public void configure() throws CoreException { - } - - @Override - public void deconfigure() throws CoreException { - } - - @Override - public IProject getProject() { - return project; - } - - @Override - public void setProject(IProject project) { - this.project = project; - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXStaticCCNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXStaticCCNature.java deleted file mode 100644 index 00e32cab..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/natures/SGXStaticCCNature.java +++ /dev/null @@ -1,45 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.natures; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectNature; -import org.eclipse.core.runtime.CoreException; - -public class SGXStaticCCNature implements IProjectNature { - - private IProject project; - public static final String NATURE_ID = "com.intel.sgx.sgxstaticccnature"; - - public SGXStaticCCNature() { - } - - @Override - public void configure() throws CoreException { - } - - @Override - public void deconfigure() throws CoreException { - } - - @Override - public IProject getProject() { - return project; - } - - @Override - public void setProject(IProject project) { - this.project = project; - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/ISDKDescriptor.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/ISDKDescriptor.java deleted file mode 100644 index 4051a8ae..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/ISDKDescriptor.java +++ /dev/null @@ -1,29 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.preferences; - -import java.io.File; - - -public interface ISDKDescriptor { - - public abstract File getSdkDir(); - - public abstract File getToolsDir(); - - public abstract File getSignerPath(); - - public abstract File getEdger8rPath(); - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceConstants.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceConstants.java deleted file mode 100644 index 21cd3979..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceConstants.java +++ /dev/null @@ -1,112 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.preferences; - -import java.io.File; - -import org.eclipse.jface.preference.IPreferenceStore; - -import com.intel.sgx.Activator; - -/** - * Constant definitions for plug-in preferences - */ -public class PreferenceConstants { - - public static final String SDK_PATH = "SDKPathPreference"; - - public static ISDKDescriptor getSDKDescriptor() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - File sdkDir = new File(store.getString(PreferenceConstants.SDK_PATH)); - - if (System.getProperty("os.arch").contains("64")) { - return new SGXSDK64Descriptor(sdkDir); - } else { - return new SGXSDK32Descriptor(sdkDir); - } - } - - - static public class SGXSDK32Descriptor implements ISDKDescriptor { - private final File sdkDir; - private final File toolDir; - private final File signerPath; - private final File edger8rPath; - - public SGXSDK32Descriptor(File location){ - this.sdkDir = location; - this.toolDir = new File(location, "bin/x86"); - this.signerPath = new File(toolDir, "sgx_sign"); - this.edger8rPath = new File(toolDir, "sgx_edger8r"); - } - - @Override - public File getSdkDir() { - return sdkDir; - } - - @Override - public File getToolsDir() { - return toolDir; - } - - @Override - public File getSignerPath() { - return signerPath; - } - - @Override - public File getEdger8rPath() { - return edger8rPath; - } - - } - - - static public class SGXSDK64Descriptor implements ISDKDescriptor { - private final File sdkDir; - private final File toolDir; - private final File signerPath; - private final File edger8rPath; - - public SGXSDK64Descriptor(File sdkDir){ - this.sdkDir = sdkDir; - this.toolDir = new File(sdkDir, "bin/x64"); - this.signerPath = new File(toolDir, "sgx_sign"); - this.edger8rPath = new File(toolDir, "sgx_edger8r"); - } - - @Override - public File getSdkDir() { - return sdkDir; - } - - @Override - public File getToolsDir() { - return toolDir; - } - - @Override - public File getSignerPath() { - return signerPath; - } - - @Override - public File getEdger8rPath() { - return edger8rPath; - } - - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceInitializer.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceInitializer.java deleted file mode 100644 index 7a8181ac..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/PreferenceInitializer.java +++ /dev/null @@ -1,32 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.preferences; - -import com.intel.sgx.Activator; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -/** - * Class used to initialize default preference values. - */ -public class PreferenceInitializer extends AbstractPreferenceInitializer { - - public void initializeDefaultPreferences() { - IPreferenceStore store = Activator.getDefault().getPreferenceStore(); - store.setDefault(PreferenceConstants.SDK_PATH, ""); - Activator.getDefault().getPreferenceStore().setValue(PreferenceConstants.SDK_PATH, "/opt/intel/sgxsdk"); - Activator.getDefault().getPreferenceStore().setDefault(PreferenceConstants.SDK_PATH, "/opt/intel/sgxsdk"); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/SGXPreferencePage.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/SGXPreferencePage.java deleted file mode 100644 index 96caec1a..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/preferences/SGXPreferencePage.java +++ /dev/null @@ -1,110 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.preferences; - -import org.eclipse.jface.preference.DirectoryFieldEditor; -import org.eclipse.jface.preference.FieldEditorPreferencePage; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; - -import com.intel.sgx.Activator; -import com.intel.sgx.SdkPathVariableProvider; - -/** - * This class represents a preference page that - * is contributed to the Preferences dialog. By - * subclassing FieldEditorPreferencePage, we - * can use the field support built into JFace that allows - * us to create a page that is small and knows how to - * save, restore and apply itself. - *

- * This page is used to modify preferences only. They - * are stored in the preference store that belongs to - * the main plug-in class. That way, preferences can - * be accessed directly via the preference store. - */ - -public class SGXPreferencePage - extends FieldEditorPreferencePage - implements IWorkbenchPreferencePage { - - private SGXSdkDirectoryFieldEditor sgxSdkDirectoryEditor; - - public SGXPreferencePage() { - super(GRID); - setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Intel(R) SGX Preferences"); - } - - /** - * Creates the field editors. Field editors are abstractions of - * the common GUI blocks needed to manipulate various types - * of preferences. Each field editor knows how to save and - * restore itself. - */ - - @Override - protected void createFieldEditors() { - sgxSdkDirectoryEditor = new SGXSdkDirectoryFieldEditor(PreferenceConstants.SDK_PATH, - "&Intel(R) SGX SDK Directory:", getFieldEditorParent()); - addField(sgxSdkDirectoryEditor); - } - - /* - * 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) { - super(name, labelText, parent); - setEmptyStringAllowed(true); - } - - @Override - protected boolean doCheckState() { - if (!super.doCheckState()) { - setErrorMessage("Intel(R) SGX Preferences: Not a Valid directory"); - return false; - } - - String dirname = getTextControl().getText().trim(); - if (!dirname.isEmpty() && !SdkPathVariableProvider.isValidSGXSdkLocation(dirname)) { - setErrorMessage("Intel(R) SGX SDK: Not a Valid SGX SDK directory"); - return false; - } - return true; - } - - @Override - public Text getTextControl(Composite parent) { - setValidateStrategy(VALIDATE_ON_KEY_STROKE); - return super.getTextControl(parent); - } - } - - @Override - public void init(IWorkbench workbench) { - } - - @Override - public void dispose() { - super.dispose(); - - if (sgxSdkDirectoryEditor != null) { - sgxSdkDirectoryEditor.dispose(); - sgxSdkDirectoryEditor = null; - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/CreateNativeFolders.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/CreateNativeFolders.java deleted file mode 100644 index a167f6aa..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/CreateNativeFolders.java +++ /dev/null @@ -1,230 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.templates; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.cdt.core.CCorePlugin; -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.model.ICProject; -import org.eclipse.cdt.core.model.IPathEntry; -import org.eclipse.cdt.core.settings.model.CIncludePathEntry; -import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; -import org.eclipse.cdt.core.settings.model.ICFolderDescription; -import org.eclipse.cdt.core.settings.model.ICLanguageSetting; -import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; -import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.core.settings.model.ICSettingEntry; -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.process.ProcessArgument; -import org.eclipse.cdt.core.templateengine.process.ProcessFailureException; -import org.eclipse.cdt.core.templateengine.process.ProcessRunner; -import org.eclipse.cdt.managedbuilder.core.IConfiguration; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.internal.core.Configuration; -import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; - -import com.intel.sgx.Activator; -import com.intel.sgx.Messages; -import com.intel.sgx.preferences.PreferenceConstants; - -@SuppressWarnings("restriction") -public class CreateNativeFolders extends ProcessRunner { - - @Override - public void process(TemplateCore template, ProcessArgument[] args, - String processId, IProgressMonitor monitor) - throws ProcessFailureException { - String projectName = null; - String[] sourceFolders = null; - String[] outputFolders = null; - - for (ProcessArgument arg : args) { - String argName = arg.getName(); - if (argName.equals("projectName")) { - projectName = arg.getSimpleValue(); - } else if (argName.equals("sourceFolders")) { - sourceFolders = arg.getSimpleArrayValue(); - } else if (argName.equals("outputFolders")) { - outputFolders = arg.getSimpleArrayValue(); - } - } - - if (projectName == null) - throw new ProcessFailureException( - Messages.CreateNativeFolders_Missing_project_name); - - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - if (!project.exists()) - throw new ProcessFailureException( - Messages.CreateNativeFolders_Project_does_not_exist); - - if (sourceFolders == null && outputFolders == null) - throw new ProcessFailureException( - Messages.CreateNativeFolders_No_folders); - - try { - ICProject cproject = CCorePlugin.getDefault().getCoreModel() - .create(project); - IPathEntry[] pathEntries = cproject.getRawPathEntries(); - List newEntries = new ArrayList( - pathEntries.length); - for (IPathEntry pathEntry : pathEntries) { - if (pathEntry.getEntryKind() != IPathEntry.CDT_SOURCE - && pathEntry.getEntryKind() != IPathEntry.CDT_OUTPUT) { - newEntries.add(pathEntry); - } - } - if (sourceFolders != null) - for (String sourceFolder : sourceFolders) { - IFolder folder = project.getFolder(new Path(sourceFolder)); - if (!folder.exists()) - folder.create(true, true, monitor); - newEntries.add(CoreModel.newSourceEntry(folder - .getFullPath())); - } - if (outputFolders != null) - for (String outputFolder : outputFolders) { - IFolder folder = project.getFolder(new Path(outputFolder)); - if (!folder.exists()) - folder.create(true, true, monitor); - newEntries.add(CoreModel.newOutputEntry(folder - .getFullPath())); - } - cproject.setRawPathEntries( - newEntries.toArray(new IPathEntry[newEntries.size()]), - monitor); - - // IConfiguration[] configs = managedProject.getConfigurations(); - // for(IConfiguration conf:configs){ - // managedProject.removeConfiguration(conf.getId()); - - // } - - IConfiguration conSimDebug = ManagedBuildManager - .getExtensionConfiguration("com.intel.sgx.configuration.Sim.Debug"); - IConfiguration conSimRelease = ManagedBuildManager - .getExtensionConfiguration("com.intel.sgx.configuration.Sim.Release"); - IConfiguration conHwDebug = ManagedBuildManager - .getExtensionConfiguration("com.intel.sgx.configuration.HW.Debug"); - IConfiguration conHwPrerelease = ManagedBuildManager - .getExtensionConfiguration("com.intel.sgx.configuration.HW.Prerelease"); - IConfiguration conHwRelease = ManagedBuildManager - .getExtensionConfiguration("com.intel.sgx.configuration.HW.Release"); - - addConfigurationToProject(project, conSimDebug); - addConfigurationToProject(project, conSimRelease); - addConfigurationToProject(project, conHwDebug); - addConfigurationToProject(project, conHwPrerelease); - addConfigurationToProject(project, conHwRelease); - - - changeProjectConfiguration(project, conSimDebug); - - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } catch (CoreException e) { - throw new ProcessFailureException(e); - } - } - - void addConfigurationToProject(IProject project, IConfiguration config) { - createConfiguration(project, config); - addSGXIncludePathsToConfiguration(project, config); - } - - private void addSGXIncludePathsToConfiguration(IProject project, - IConfiguration config) { - ICProjectDescription projectDescription = CoreModel.getDefault() - .getProjectDescription(project, true); - ICConfigurationDescription configDecriptions[] = projectDescription - .getConfigurations(); - for (ICConfigurationDescription configDescription : configDecriptions) { - ICFolderDescription projectRoot = configDescription - .getRootFolderDescription(); - - ICLanguageSetting[] settings = projectRoot.getLanguageSettings(); - for (ICLanguageSetting setting : settings) { - - if (!"org.eclipse.cdt.core.gcc".equals(setting.getLanguageId()) && !"org.eclipse.cdt.core.g++".equals(setting.getLanguageId()) ) { - continue; - } - List includes = new ArrayList(); - - includes.add(new CIncludePathEntry( Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SDK_PATH) + - "/include/", - ICSettingEntry.LOCAL)); - - setting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, includes); - } - } - try { - CoreModel.getDefault().setProjectDescription(project, - projectDescription); - } catch (CoreException e) { - e.printStackTrace(); - } - - } - - private void createConfiguration(IProject project, - IConfiguration config) { - ManagedProject managedProject = (ManagedProject) ManagedBuildManager.getBuildInfo(project) - .getManagedProject();; - - - Configuration cloneConfig1 = (Configuration) config; - Configuration cfg1 = new Configuration(managedProject, cloneConfig1, - cloneConfig1.getId(), false, false); - String target = cfg1.getArtifactName(); - if (target == null || target.length() == 0) - cfg1.setArtifactName(managedProject.getDefaultArtifactName()); - - cfg1.exportArtifactInfo(); - - ManagedBuildManager.saveBuildInfo(project, true); - } - - private void changeProjectConfiguration(IProject project, - IConfiguration conSimDebug) { - ICProjectDescription prjd = CCorePlugin.getDefault() - .getProjectDescriptionManager().getProjectDescription(project); - ICConfigurationDescription[] configs = prjd.getConfigurations(); - if (configs != null && configs.length > 0) { - for (ICConfigurationDescription config : configs) { - if (config.getConfiguration().getId() - .equals(conSimDebug.getId())) { - config.setActive(); - try { - CoreModel.getDefault().setProjectDescription(project, - prjd); - } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - break; - } - } - } - - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetCCNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetCCNature.java deleted file mode 100644 index a50c725a..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetCCNature.java +++ /dev/null @@ -1,77 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.templates; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.process.ProcessArgument; -import org.eclipse.cdt.core.templateengine.process.ProcessFailureException; -import org.eclipse.cdt.core.templateengine.process.ProcessRunner; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -import com.intel.sgx.Activator; -import com.intel.sgx.natures.SGXNature; - -public class SetCCNature extends ProcessRunner { - - public SetCCNature() { - } - - @Override - public void process(TemplateCore template, ProcessArgument[] args, - String processId, IProgressMonitor monitor) - throws ProcessFailureException { - String projectName = null; - IProject project = null; - - for(ProcessArgument arg: args){ - String argName = arg.getName(); - if(argName.equals("projectName")){ - projectName = arg.getSimpleValue(); - } - } - - - project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - IWorkspace workspace = project.getWorkspace(); - IProjectDescription description; - try { - description = project.getDescription(); - - String[] natures = description.getNatureIds(); - String[] newNatures = new String[natures.length+1]; - System.arraycopy(natures,0,newNatures,0,natures.length); - newNatures[natures.length] = SGXNature.NATURE_ID; - IStatus status = workspace.validateNatureSet(newNatures); - - if(status.getCode() == IStatus.OK) - { - - description.setNatureIds(newNatures); - project.setDescription(description, null); - } - else { - System.err.println("Incorrect Project Nature. Please check Project Settings."); - } - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetStaticCCNature.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetStaticCCNature.java deleted file mode 100644 index abb5f4c1..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/templates/SetStaticCCNature.java +++ /dev/null @@ -1,75 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.templates; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.process.ProcessArgument; -import org.eclipse.cdt.core.templateengine.process.ProcessFailureException; -import org.eclipse.cdt.core.templateengine.process.ProcessRunner; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; - -import com.intel.sgx.Activator; -import com.intel.sgx.natures.SGXStaticCCNature; - -public class SetStaticCCNature extends ProcessRunner { - - public SetStaticCCNature() { - } - - @Override - public void process(TemplateCore template, ProcessArgument[] args, - String processId, IProgressMonitor monitor) - throws ProcessFailureException { - - String projectName = null; - IProject project = null; - - for(ProcessArgument arg: args){ - String argName = arg.getName(); - if(argName.equals("projectName")){ - projectName = arg.getSimpleValue(); - } - } - - project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); - IWorkspace workspace = project.getWorkspace(); - IProjectDescription description; - try { - description = project.getDescription(); - - String[] natures = description.getNatureIds(); - String[] newNatures = new String[natures.length+1]; - System.arraycopy(natures,0,newNatures,0,natures.length); - newNatures[natures.length] = SGXStaticCCNature.NATURE_ID; - IStatus status = workspace.validateNatureSet(newNatures); - - if(status.getCode() == IStatus.OK) - { - description.setNatureIds(newNatures); - project.setDescription(description, null); - } - else - System.err.println("Incorrect Project Nature. Please check Project Settings."); - } catch (CoreException e) { - Activator.log(e); - e.printStackTrace(); - } - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/testers/SGXPropertyTester.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/testers/SGXPropertyTester.java deleted file mode 100644 index f77a73d5..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/testers/SGXPropertyTester.java +++ /dev/null @@ -1,79 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.testers; - -import java.util.regex.Pattern; - -import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.viewers.StructuredSelection; - -public class SGXPropertyTester extends PropertyTester { - - private static final Pattern isRelease = Pattern.compile(".*Release.*"); - private static final Pattern isHW = Pattern.compile(".*Hardware.*"); - private static final Pattern isPreRelease = Pattern.compile(".*Prerelease.*");; - - public SGXPropertyTester() { - super(); - - // TODO Auto-generated constructor stub - } - - @Override - public boolean test(Object receiver, String property, Object[] args, - Object expectedValue) { - - - - - - if (property.equals("twoStepsActive")) { - IProject project = getProjectOfSelectedItem(receiver); - IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); - return isHW(buildInfo) && isRelease(buildInfo) && !isPreRelease(buildInfo); - - } else if (property.equals("sgxNatureAdded")) { - IProject project = getProjectOfSelectedItem(receiver); - return true; - } else { - return false; - } - } - - private IProject getProjectOfSelectedItem(Object receiver) { - StructuredSelection selection = (StructuredSelection) receiver; - IResource resource = (IResource) selection.getFirstElement(); - IProject project = resource.getProject(); - return project; - } - - boolean isHW(IManagedBuildInfo buildInfo){ - return isHW.matcher(buildInfo.getConfigurationName()).matches(); - } - - - - boolean isRelease(IManagedBuildInfo buildInfo){ - return isRelease.matcher(buildInfo.getConfigurationName()).matches(); - } - - boolean isPreRelease(IManagedBuildInfo buildInfo){ - return isPreRelease.matcher(buildInfo.getConfigurationName()).matches(); - } - -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCCProjectWizard.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCCProjectWizard.java deleted file mode 100644 index d54d9afe..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCCProjectWizard.java +++ /dev/null @@ -1,145 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.wizards; - -import java.net.URI; -import java.util.Map; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.cdt.ui.wizards.CCProjectWizard; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; - -import com.intel.sgx.natures.SGXNature; - -public class SGXCCProjectWizard extends CCProjectWizard { - - private IProject project; - - @Override - protected boolean setCreated() throws CoreException { - boolean result = super.setCreated(); - doIt(project, new NullProgressMonitor()); - return result; - } - - @Override - public boolean performFinish() { - - return super.performFinish(); - } - - @Override - public void setInitializationData(IConfigurationElement config, - String propertyName, Object data) throws CoreException { - // TODO Auto-generated method stub - super.setInitializationData(config, propertyName, data); - } - - @Override - public IProject createIProject(String name, URI location) - throws CoreException { - // TODO Auto-generated method stub - return super.createIProject(name, location); - - } - - @Override - public IProject createIProject(String name, URI location, - IProgressMonitor monitor) throws CoreException { - project = super.createIProject(name, location, monitor); - return project; - } - - @Override - public String[] getExtensions() { - // TODO Auto-generated method stub - return super.getExtensions(); - } - - public SGXCCProjectWizard() { - // TODO Auto-generated constructor stub - } - - @Override - public String[] getNatures() { - // TODO Auto-generated method stub - return super.getNatures(); - } - - @Override - protected IProject continueCreation(IProject prj) { - // TODO Auto-generated method stub - return super.continueCreation(prj); - } - - @Override - public String[] getContentTypeIDs() { - // TODO Auto-generated method stub - return super.getContentTypeIDs(); - } - - @Override - public IProject getProject(boolean defaults) { - // TODO Auto-generated method stub - return super.getProject(defaults); - } - - @Override - public String[] getLanguageIDs() { - // TODO Auto-generated method stub - return super.getLanguageIDs(); - } - - void doIt(IProject project, IProgressMonitor monitor) throws CoreException { - TemplateCore template = TemplateEngine.getDefault().getTemplateById( - "AddSGXNature"); - Map valueStore = template.getValueStore(); - valueStore.put("projectName", project.getName()); - valueStore.put("baseName", project.getName()); - template.executeTemplateProcesses(monitor, false); - - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - - String[] newNatures = new String[natures.length + 1]; - System.arraycopy(natures, 0, newNatures, 0, natures.length); - newNatures[natures.length] = SGXNature.NATURE_ID; - IStatus status = workspace.validateNatureSet(newNatures); - - if (status.getCode() == IStatus.OK) { - description.setNatureIds(newNatures); - project.setDescription(description, null); - } else { - System.err - .println("Incorrect Project Nature. Please check Project Settings.");// TODO - // throw - // an - // exception - // here. - System.err.println("Status is: " + status.getCode()); - } - - // project.refreshLocal(IResource.DEPTH_ONE,null); - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCProjectWizard.java b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCProjectWizard.java deleted file mode 100644 index 70266fcf..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/src/com/intel/sgx/wizards/SGXCProjectWizard.java +++ /dev/null @@ -1,146 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2018 Intel Corporation. // -// // -// All rights reserved. This program and the accompanying materials // -// are made available under the terms of the Eclipse Public License v1.0 // -// which accompanies this distribution, and is available at // -// http://www.eclipse.org/legal/epl-v10.html // -// // -// Contributors: // -// Intel Corporation - initial implementation and documentation // -/////////////////////////////////////////////////////////////////////////// - - -package com.intel.sgx.wizards; - -import java.net.URI; -import java.util.Map; - -import org.eclipse.cdt.core.templateengine.TemplateCore; -import org.eclipse.cdt.core.templateengine.TemplateEngine; -import org.eclipse.cdt.ui.wizards.CProjectWizard; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; - -import com.intel.sgx.natures.SGXNature; - -public class SGXCProjectWizard extends CProjectWizard { - - private IProject project; - - @Override - protected boolean setCreated() throws CoreException { - boolean result = super.setCreated(); - doIt(project, new NullProgressMonitor()); - return result; - } - - @Override - public boolean performFinish() { - - return super.performFinish(); - } - - @Override - public void setInitializationData(IConfigurationElement config, - String propertyName, Object data) throws CoreException { - // TODO Auto-generated method stub - super.setInitializationData(config, propertyName, data); - } - - @Override - public IProject createIProject(String name, URI location) - throws CoreException { - // TODO Auto-generated method stub - return super.createIProject(name, location); - - } - - @Override - public IProject createIProject(String name, URI location, - IProgressMonitor monitor) throws CoreException { - project = super.createIProject(name, location, monitor); - return project; - } - - @Override - public String[] getExtensions() { - // TODO Auto-generated method stub - return super.getExtensions(); - } - - public SGXCProjectWizard() { - // TODO Auto-generated constructor stub - } - - @Override - public String[] getNatures() { - // TODO Auto-generated method stub - return super.getNatures(); - } - - @Override - protected IProject continueCreation(IProject prj) { - // TODO Auto-generated method stub - return super.continueCreation(prj); - } - - @Override - public String[] getContentTypeIDs() { - // TODO Auto-generated method stub - return super.getContentTypeIDs(); - } - - @Override - public IProject getProject(boolean defaults) { - // TODO Auto-generated method stub - return super.getProject(defaults); - } - - @Override - public String[] getLanguageIDs() { - // TODO Auto-generated method stub - return super.getLanguageIDs(); - } - - void doIt(IProject project, IProgressMonitor monitor) throws CoreException { - TemplateCore template = TemplateEngine.getDefault().getTemplateById( - "AddSGXNature"); - Map valueStore = template.getValueStore(); - valueStore.put("projectName", project.getName()); - valueStore.put("baseName", project.getName()); - template.executeTemplateProcesses(monitor, false); - - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProjectDescription description = project.getDescription(); - String[] natures = description.getNatureIds(); - for (String nature : natures) { - } - - String[] newNatures = new String[natures.length + 1]; - System.arraycopy(natures, 0, newNatures, 0, natures.length); - newNatures[natures.length] = SGXNature.NATURE_ID; - IStatus status = workspace.validateNatureSet(newNatures); - - if (status.getCode() == IStatus.OK) { - description.setNatureIds(newNatures); - project.setDescription(description, null); - } else { - System.err - .println("Incorrect Project Nature. Please check Project Settings.");// TODO - // throw - // an - // exception - // here. - System.err.println("Status is: " + status.getCode()); - } - - } -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGX.gif b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGX.gif deleted file mode 100644 index 21156bbf..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGX.gif and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/enclavetemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/enclavetemplate.xml deleted file mode 100644 index 18ccc888..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/enclavetemplate.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/trustedstatictemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/trustedstatictemplate.xml deleted file mode 100644 index ff3f7221..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/trustedstatictemplate.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/untrusted_module_template.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/untrusted_module_template.xml deleted file mode 100644 index 037e7119..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/minimal/untrusted_module_template.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/with_sample/enclavetemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/with_sample/enclavetemplate.xml deleted file mode 100644 index ee585558..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c++/with_sample/enclavetemplate.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/enclavetemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/enclavetemplate.xml deleted file mode 100644 index b915e167..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/enclavetemplate.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/trustedstatictemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/trustedstatictemplate.xml deleted file mode 100644 index 72afa8fd..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/trustedstatictemplate.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/untrusted_module_template.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/untrusted_module_template.xml deleted file mode 100644 index d95fa0c2..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/minimal/untrusted_module_template.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/with_sample/enclavetemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/with_sample/enclavetemplate.xml deleted file mode 100644 index 5e5b34c4..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/c/with_sample/enclavetemplate.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/common/addnaturetemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/common/addnaturetemplate.xml deleted file mode 100644 index 44d85162..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/common/addnaturetemplate.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/configtemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/configtemplate.xml deleted file mode 100644 index 59e15817..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/configtemplate.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/ctemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/ctemplate.xml deleted file mode 100644 index 37ddbd2f..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/ctemplate.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxstaticlibtemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxstaticlibtemplate.xml deleted file mode 100644 index be88e9eb..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxstaticlibtemplate.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxtemplate.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxtemplate.xml deleted file mode 100644 index 9d1d6f55..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/cxxtemplate.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/template.properties b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/template.properties deleted file mode 100644 index 5f89ea35..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/SGXtemplates/template.properties +++ /dev/null @@ -1,63 +0,0 @@ -######################################################################### -# Copyright (c) 2018 Intel Corporation. # -# # -# All rights reserved. This program and the accompanying materials # -# are made available under the terms of the Eclipse Public License v1.0 # -# which accompanies this distribution, and is available at # -# http://www.eclipse.org/legal/epl-v10.html # -# # -# Contributors: # -# Intel Corporation - initial implementation and documentation # -######################################################################### - SGX.author=Intel - - #Add Nature template Values - 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 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 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 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 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 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. - SGX.CStatictemplate.requiresEdl.label=Requires EDL - 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 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 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. - SGX.CXXStatictemplate.requiresEdl.label=Requires EDL - SGX.CXXStatictemplate.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. diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngc_app.gif b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngc_app.gif deleted file mode 100644 index 23b0284f..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngc_app.gif and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngcc_app.gif b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngcc_app.gif deleted file mode 100644 index 4b39411d..00000000 Binary files a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/newmngcc_app.gif and /dev/null differ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename.config.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename.config.xml deleted file mode 100644 index d87a62ba..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename.config.xml +++ /dev/null @@ -1,14 +0,0 @@ - - $(ProdID) - $(IsvSvn) - $(StackMinSize) - $(StackMaxSize) - $(HeapMinSize) - $(HeapInitSize) - $(HeapMaxSize) - $(TcsMaxNum) - $(TcsNum) - $(TcsMinPool) - $(TcsPolicy) - $(DisableDebug) - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename_private.pem b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename_private.pem deleted file mode 100644 index 790839d3..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/resources/Basename_private.pem +++ /dev/null @@ -1,39 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIG4wIBAAKCAYEA8DLzZJpN7sN5J1PtKZAqWFeW+0/pPJVWRKEB8lfqXGJ0YIjG -1o0g0/+60ktlm0vVdWSqepmpRpTB2ZZjxxc+JHfZGQnvmlGx6qQxSFS9u+S8mSzD -MknsquLVsi7rojq34dTwSckMg0KQ/sGmsV6EgsUnldhdcPOJ8+NaaqtmAmjHYIpK -jLo3pJz0e7NqKvzE2YhmZZjrIZBNFHxX/lrQ36lW6Obp8xj9CqUMZp+2+/ntdFSl -7u9BK5y3ZHh8hUx6PkHfV8f1h9iG1jroINrrQwhftKmcsg/DPG7NOnjK/EvFaBku -6p0pnmeJM6VUihaLWYNAAjylVmMysenAjl4jsSzQeIe5idoPzYonCuAcASj8utgz -4OxxMHFYAXzgc2An6jp700NOgmYdhtoTMCUjohyd+RHJoSNJpE+ocKPVM72xucJB -o8dK55kI2/E19EVm59UyhXs2YGIjswziMK94H9KSl+TRthny7wYKju09lbdQAGid -rZcYTv2LVYP1Q5IDAgEDAoIBgQCgIfeYZt6fLPtvjUjGYBw65Q9SNUYoY47Ya1ah -j/GS7E2VsISPCMCNVSc23O5nh+OjmHGnERuEYyvmZEKEuiltpTtmBp+8NnacbXYw -OH59QyhmHdd22/MclzkhdJ0W0c/r40rb212s1wtUgRnLlFhXLhpj5ZOgolv37Obx -x5lW8ITrBtxd0XptvfhSd5wcqIM7sERDu0drtYi4UuVUPIs/xjnwmfFMu1NcbghE -ann9UUj4OG6fSityaHpC+v2uMvrexpJP3csYY/VbrYdzlp9GLHkm9mM3Y1tSYoU4 -GhsLstDSHIOZ5f2trh+Re6759SktXi+E9B4xQvJwwVAufmfU0aVESHtJDllt+UOK -LfINb3SmXX8uINqAlees+xJDm/ZcA8vvWWioD8Hv6c47qzrYH1JwvTJtk3G3orFs -syZe7KYwUUBxTREmTCdWoeHC9Hou4MxgiyViPl5SbIUz4yqJgcr3gPtoSRhwvY3v -r1GyeyRuB0CsAun5TQCcx31XwssCgcEA/hK8i1nKvEaTJ5GX9bGZo7BtjWftuGfa -qk0b4aZLWBeoJpGgivolaloTYE+aBAhPMFNKo9HT357o9SW48yk0kyReywJj6HBf -b82TSjt9wXmeo+6cE7EO7k1sINoJnlRiDkWqdpZLzty24dWMN27oXjO2ELUmAgnT -M8rzcshlhRsp/OSD+kIyEfVstx3H3hzPDMyHsNnlPv0Jycdp+1YfANLOaog+JHUZ -Kwb90RF2ePXnLbt2ts0N03kuJKgqS6xbAoHBAPIFR1Sheib8A6UlBP3HYrYVPGzQ -GiaS35aN6YSrVxKn5AZcyPjKB6+IRnkcNA8efmUirhb8pCzf3hOiD1V3U17N+ccY -nLPUKjjGrnFfsyuILx1dWQgKGoFDEF0qO2+h1FHvH3Wm5bdxw70l0Z81Yv+57D9A -1/q8S90QqtrOtiA/jnRj3P+RfxwxYSLgm3G54JS3eEPQmQ4HjG2isGeEmVC9E7ob -GnU3NRrit9ZUzJEIsi2iRfTFq4WQ3EWwjvRBeQKBwQCpYdMHkTHS2bdvtmVOdmZt -IEkI7/PQRTxxiL1BGYeQD8VvC8BcpsOcPAzq37wCsDTK4jHCi+KVFJtOGSX3cM23 -bZSHVu1FoD+f3mIxfP6A+78X9GgNILSe3kgV5rEUOEFe2RxPDt00kySWjl16SfA+ -zSQLI26sBozNMfeh2u5YvMaomFf8LCFhTkh6E9qUEzSzMwUgkUN/U1vb2kanjr9V -4d7xsClto2Ycr1Pgtk77TpoefPnPM16M+3QYcBwycucCgcEAoVjaOGumxKgCbhit -/oTseWN9neARbwyVDwlGWHI6DG/tWZMwpdwFH7Au+2gitL7+7hceuf3CyJU+t8Ff -jk+M6d6mhLsTIo1xey8e9j/Mx7AfaOjmBVwRq4IK6MbSSmvi4UoU+RnuekvX026L -v3jsqnvy1NXlUdLdPgsckd8kFX+0TZfoqmD/aCDrbJW89nvrDc+lgosQtAUISRcg -RQMQ4H4NJry8TiTOEex6juMzC1shc8GD+IPHrmCS2SBfTYD7AoHAOYqsSbLvkhWP -JCx3wicFIY4y+eJW2hNK19ho+PEcrmu7+HKZHMU7oslsoSnme5mMomK9pZnY8KSy -px0D13XyUmEmZluxKcdUDC6mRWH4qkPt/9DGbzHwNLfla+KbxoNLi7F6U5XU5J/6 -NzZeO9HrLzHy1ck/0xUDU7Y+WWniMbUdlOpXSd+SsZtKomRhnc+QljYqSJplJL7f -mfnQ4stcY3RcPHGwfDOQT9sVk0hoIGXKCzEl217Iw1P8UwKvBbNe ------END RSA PRIVATE KEY----- diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_t.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_t.mk deleted file mode 100644 index 46b947f2..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_t.mk +++ /dev/null @@ -1,128 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted - -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 - -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 - -$(EnclaveName)_Cpp_Files := $(TRUSTED_DIR)/$(enclaveName).cpp -$(EnclaveName)_C_Files := -$(EnclaveName)_Include_Paths := -IInclude -I$(TRUSTED_DIR) -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. -$(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags) -$(EnclaveName)_Cpp_Flags := $(Common_C_Cpp_Flags) -std=c++11 -nostdinc++ -fno-builtin-printf -I. - -$(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_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=$(TRUSTED_DIR)/$(enclaveName).lds - -$(EnclaveName)_Cpp_Objects := $($(EnclaveName)_Cpp_Files:.cpp=.o) -$(EnclaveName)_C_Objects := $($(EnclaveName)_C_Files:.c=.o) - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -ifeq ($(Build_Mode), HW_RELEASE) -all: $(enclaveName).so - @echo "Build enclave $(enclaveName).so [$(Build_Mode)|$(SGX_ARCH)] success!" - @echo - @echo "*********************************************************************************************************************************************************" - @echo "PLEASE NOTE: In this mode, please sign the $(enclaveName).so first using Two Step Sign mechanism before you run the app to launch and access the enclave." - @echo "*********************************************************************************************************************************************************" - @echo - - -else -all: $(enclaveName).signed.so -endif - -run: all -ifneq ($(Build_Mode), HW_RELEASE) - @$(CURDIR)/app - @echo "RUN => app [$(SGX_MODE)|$(SGX_ARCH), OK]" -endif - - -######## $(enclaveName) Objects ######## - -$(TRUSTED_DIR)/$(enclaveName)_t.c: $(SGX_EDGER8R) ./$(TRUSTED_DIR)/$(enclaveName).edl - @cd ./$(TRUSTED_DIR) && $(SGX_EDGER8R) --trusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(TRUSTED_DIR)/$(enclaveName)_t.o: ./$(TRUSTED_DIR)/$(enclaveName)_t.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.cpp - @$(CXX) $($(EnclaveName)_Cpp_Flags) -c $< -o $@ - @echo "CXX <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(enclaveName).so: $(TRUSTED_DIR)/$(enclaveName)_t.o $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) - @$(CXX) $^ -o $@ $($(EnclaveName)_Link_Flags) - @echo "LINK => $@" - -$(enclaveName).signed.so: $(enclaveName).so - @$(SGX_ENCLAVE_SIGNER) sign -key $(TRUSTED_DIR)/$(enclaveName)_private.pem -enclave $(enclaveName).so -out $@ -config $(TRUSTED_DIR)/$(enclaveName).config.xml - @echo "SIGN => $@" -clean: - @rm -f $(enclaveName).* $(TRUSTED_DIR)/$(enclaveName)_t.* $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.mk deleted file mode 100644 index e7fa0c78..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.mk +++ /dev/null @@ -1,130 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted -UNTRUSTED_DIR=untrusted - -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/Edger8rSyntax/*.cpp) $(wildcard App/TrustedLibrary/*.cpp) -App_Cpp_Files := $(UNTRUSTED_DIR)/sample.cpp # $(wildcard App/TrustedLibrary/*.cpp) -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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) - - - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -ifeq ($(Build_Mode), HW_RELEASE) -all: sample - @echo "Build sample [$(Build_Mode)|$(SGX_ARCH)] success!" - @echo - @echo "*********************************************************************************************************************************************************" - @echo "PLEASE NOTE: In this mode, please sign the $(enclaveName).so first using Two Step Sign mechanism before you run the app to launch and access the enclave." - @echo "*********************************************************************************************************************************************************" - @echo - - -else -all: sample -endif - -run: all -ifneq ($(Build_Mode), HW_RELEASE) - @$(CURDIR)/sample - @echo "RUN => sample [$(SGX_MODE)|$(SGX_ARCH), OK]" -endif - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(UNTRUSTED_DIR)/%.o: $(UNTRUSTED_DIR)/%.cpp - @$(CXX) $(App_Cpp_Flags) -c $< -o $@ - @echo "CXX <= $<" - -sample: $(UNTRUSTED_DIR)/$(enclaveName)_u.o $(App_Cpp_Objects) - @$(CXX) $^ -o $@ $(App_Link_Flags) - @echo "LINK => $@" - - -.PHONY: clean - -clean: - @rm -f sample $(App_Cpp_Objects) $(UNTRUSTED_DIR)/$(enclaveName)_u.* diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.without_app.mk deleted file mode 100644 index df3c2602..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c++/sgx_u.without_app.mk +++ /dev/null @@ -1,72 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted -UNTRUSTED_DIR=untrusted - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(enclaveName)_u.o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @mkdir -p $(UNTRUSTED_DIR) - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(enclaveName)_u.* diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_t.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_t.mk deleted file mode 100644 index 1634f6fe..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_t.mk +++ /dev/null @@ -1,116 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted - -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 - -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 - -$(EnclaveName)_C_Files := $(TRUSTED_DIR)/$(enclaveName).c -$(EnclaveName)_Include_Paths := -IInclude -I$(TRUSTED_DIR) -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. -$(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_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=$(TRUSTED_DIR)/$(enclaveName).lds - -$(EnclaveName)_C_Objects := $($(EnclaveName)_C_Files:.c=.o) - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -ifeq ($(Build_Mode), HW_RELEASE) -all: $(enclaveName).so - @echo "Build enclave $(enclaveName).so [$(Build_Mode)|$(SGX_ARCH)] success!" - @echo - @echo "*********************************************************************************************************************************************************" - @echo "PLEASE NOTE: In this mode, please sign the $(enclaveName).so first using Two Step Sign mechanism before you run the app to launch and access the enclave." - @echo "*********************************************************************************************************************************************************" - @echo -else -all: $(enclaveName).signed.so -endif - -run: all -ifneq ($(Build_Mode), HW_RELEASE) - @$(CURDIR)/app - @echo "RUN => app [$(SGX_MODE)|$(SGX_ARCH), OK]" -endif - - -######## $(enclaveName) Objects ######## - -$(TRUSTED_DIR)/$(enclaveName)_t.c: $(SGX_EDGER8R) ./$(TRUSTED_DIR)/$(enclaveName).edl - @cd ./$(TRUSTED_DIR) && $(SGX_EDGER8R) --trusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(TRUSTED_DIR)/$(enclaveName)_t.o: ./$(TRUSTED_DIR)/$(enclaveName)_t.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(enclaveName).so: $(TRUSTED_DIR)/$(enclaveName)_t.o $($(EnclaveName)_C_Objects) - @$(CXX) $^ -o $@ $($(EnclaveName)_Link_Flags) - @echo "LINK => $@" - -$(enclaveName).signed.so: $(enclaveName).so - @$(SGX_ENCLAVE_SIGNER) sign -key $(TRUSTED_DIR)/$(enclaveName)_private.pem -enclave $(enclaveName).so -out $@ -config $(TRUSTED_DIR)/$(enclaveName).config.xml - @echo "SIGN => $@" -clean: - @rm -f $(enclaveName).* $(TRUSTED_DIR)/$(enclaveName)_t.* $($(EnclaveName)_C_Objects) \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.mk deleted file mode 100644 index c10e5361..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.mk +++ /dev/null @@ -1,127 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted -UNTRUSTED_DIR=untrusted - -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_C_Files := $(UNTRUSTED_DIR)/sample.c -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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_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_C_Objects := $(App_C_Files:.c=.o) - - - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -ifeq ($(Build_Mode), HW_RELEASE) -all: sample - @echo "Build sample [$(Build_Mode)|$(SGX_ARCH)] success!" - @echo - @echo "*********************************************************************************************************************************************************" - @echo "PLEASE NOTE: In this mode, please sign the $(enclaveName).so first using Two Step Sign mechanism before you run the app to launch and access the enclave." - @echo "*********************************************************************************************************************************************************" - @echo - -else -all: sample -endif - -run: all -ifneq ($(Build_Mode), HW_RELEASE) - @$(CURDIR)/sample - @echo "RUN => sample [$(SGX_MODE)|$(SGX_ARCH), OK]" -endif - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(UNTRUSTED_DIR)/%.o: $(UNTRUSTED_DIR)/%.c - @$(CXX) $(App_C_Flags) -c $< -o $@ - @echo "CXX <= $<" - -sample: $(UNTRUSTED_DIR)/$(enclaveName)_u.o $(App_C_Objects) - @$(CXX) $^ -o $@ $(App_Link_Flags) - @echo "LINK => $@" - - -.PHONY: clean - -clean: - @rm -f sample $(App_C_Objects) $(UNTRUSTED_DIR)/$(enclaveName)_u.* \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.without_app.mk deleted file mode 100644 index 2a22968e..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/c/sgx_u.without_app.mk +++ /dev/null @@ -1,71 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=trusted -UNTRUSTED_DIR=untrusted - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(enclaveName)_u.o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @mkdir -p $(UNTRUSTED_DIR) - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(enclaveName)_u.* diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/common/Makefile b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/common/Makefile deleted file mode 100644 index 3defedc4..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/makefiles/common/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - $(MAKE) -f sgx_u.mk all - $(MAKE) -f sgx_t.mk all - -clean: - $(MAKE) -f sgx_u.mk clean - $(MAKE) -f sgx_t.mk clean - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.config.xml b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.config.xml deleted file mode 100644 index 19983639..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.config.xml +++ /dev/null @@ -1,14 +0,0 @@ - - 0 - 0 - 0x2000 - 0x40000 - 0x1000 - 0x1000000 - 0x1000000 - 10 - 10 - 3 - 1 - 0 - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.cpp deleted file mode 100644 index 78f55c15..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include /* vsnprintf */ - -#include "$(enclaveName).h" -#include "$(enclaveName)_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_$(enclaveName)_sample(buf); -} - -int ecall_$(enclaveName)_sample() -{ - printf("IN $(ENCLAVENAME)\n"); - return 0; -} - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.edl b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.edl deleted file mode 100644 index e97f447e..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.edl +++ /dev/null @@ -1,18 +0,0 @@ -/* $(enclaveName).edl - Top EDL file. */ - -enclave { - - /* - * ocall_$(enclaveName)_sample - 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_$(enclaveName)_sample([in, string] const char *str); - }; - - - trusted { - public int ecall_$(enclaveName)_sample(); - }; -}; diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.h b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.h deleted file mode 100644 index 2d29332f..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _$(ENCLAVENAME)_H_ -#define _$(ENCLAVENAME)_H_ - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -void printf(const char *fmt, ...); - -#if defined(__cplusplus) -} -#endif - -#endif /* !_$(ENCLAVENAME)_H_ */ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.lds b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.lds deleted file mode 100644 index 9019f79f..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1.lds +++ /dev/null @@ -1,9 +0,0 @@ -$(enclaveName).so -{ - global: - g_global_data_sim; - g_global_data; - $(enclaveName)_entry; - local: - *; -}; diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.cpp deleted file mode 100644 index 79700c42..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "$(enclaveName)_t.h" /* print_string */ - -int ecall_$(enclaveName)_sample() -{ - return 0; -} - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.edl b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.edl deleted file mode 100644 index f332f819..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_minimal.edl +++ /dev/null @@ -1,10 +0,0 @@ -/* $(enclaveName).edl - Top EDL file. */ - -enclave { - untrusted { - }; - - trusted { - public int ecall_$(enclaveName)_sample(); - }; -}; diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_private.pem b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_private.pem deleted file mode 100644 index 529d07be..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/trusted/Enclave1_private.pem +++ /dev/null @@ -1,39 +0,0 @@ ------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----- diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.cpp deleted file mode 100644 index c8bcf489..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.cpp +++ /dev/null @@ -1,199 +0,0 @@ -#include -#include - -#include -#include -#include -#include - -# define MAX_PATH FILENAME_MAX - - -#include -#include "sample.h" - -#include "$(enclaveName)_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 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, - "Memory map conflicted.", - NULL - }, - { - SGX_ERROR_INVALID_METADATA, - "Invalid enclave metadata.", - NULL - }, - { - SGX_ERROR_DEVICE_BUSY, - "Intel(R) 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_MEMORY_MAP_FAILURE, - "Failed to reserve memory for the 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 code is 0x%X. Please refer to the \"Intel SGX SDK Developer Reference\" for more details.\n", ret); -} - -/* Initialize the enclave: - * Call sgx_create_enclave to initialize an enclave instance - */ -int initialize_enclave(void) -{ - sgx_status_t ret = SGX_ERROR_UNEXPECTED; - - /* Call sgx_create_enclave to initialize an enclave instance */ - /* Debug Support: set 2nd parameter to 1 */ - ret = sgx_create_enclave($(ENCLAVENAME)_FILENAME, SGX_DEBUG_FLAG, NULL, NULL, &global_eid, NULL); - - if (ret != SGX_SUCCESS) { - print_error_message(ret); - return -1; - } - - return 0; -} - -/* OCall functions */ -void ocall_$(enclaveName)_sample(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); - - /* Changing dir to where the executable is.*/ - char absolutePath [MAX_PATH]; - char *ptr = NULL; - - ptr = realpath(dirname(argv[0]),absolutePath); - - if( chdir(absolutePath) != 0) - abort(); - - /* Initialize the enclave */ - if(initialize_enclave() < 0){ - - return -1; - } - - sgx_status_t ret = SGX_ERROR_UNEXPECTED; - int ecall_return = 0; - - ret = ecall_$(enclaveName)_sample(global_eid, &ecall_return); - if (ret != SGX_SUCCESS) - abort(); - - if (ecall_return == 0) { - printf("Application ran with success\n"); - } - else - { - printf("Application failed %d \n", ecall_return); - } - - sgx_destroy_enclave(global_eid); - - return ecall_return; -} diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.h b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.h deleted file mode 100644 index 8a0aff98..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXEnclave/untrusted/sample.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _APP_H_ -#define _APP_H_ - -#include -#include -#include -#include - -#include "sgx_error.h" /* sgx_status_t */ -#include "sgx_eid.h" /* sgx_enclave_id_t */ - -#ifndef TRUE -# define TRUE 1 -#endif - -#ifndef FALSE -# define FALSE 0 -#endif - - -# define $(ENCLAVENAME)_FILENAME "$(enclaveName).signed.so" - -extern sgx_enclave_id_t global_eid; /* global enclave id */ - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(__cplusplus) -} -#endif - -#endif /* !_APP_H_ */ diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXNature/Makefile b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXNature/Makefile deleted file mode 100644 index 5a671516..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXNature/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -ALL_UNTRUSTED_MK=$(shell find . -name '*sgx_u.mk') -ALL_TRUSTED_MK=$(shell find . -name '*sgx_t.mk') -ALL_STATIC_MK=$(shell find . -name '*sgx_t_static.mk') - - - -.PHONY: all clean run - - -all clean: - $(foreach U_MK, $(ALL_UNTRUSTED_MK), $(MAKE) -C $(shell dirname $(U_MK)) -f $(shell basename $(U_MK)) $@;) - $(foreach T_MK, $(ALL_TRUSTED_MK), $(MAKE) -C $(shell dirname $(T_MK)) -f $(shell basename $(T_MK)) $@;) - $(foreach U_MK, $(ALL_STATIC_MK), $(MAKE) -C $(shell dirname $(U_MK)) -f $(shell basename $(U_MK)) $@;) - -run: - $(foreach U_MK, $(ALL_UNTRUSTED_MK), $(MAKE) -C $(shell dirname $(U_MK)) -f $(shell basename $(U_MK)) $@;) - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_t_static.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_t_static.mk deleted file mode 100644 index d3d485fd..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_t_static.mk +++ /dev/null @@ -1,106 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=static_trusted - -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 - -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 - -$(EnclaveName)_Cpp_Files := $(TRUSTED_DIR)/$(enclaveName).cpp -$(EnclaveName)_C_Files := -$(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. -$(EnclaveName)_C_Flags := $(Flags_Just_For_C) $(Common_C_Cpp_Flags) -$(EnclaveName)_Cpp_Flags := $(Common_C_Cpp_Flags) -std=c++11 -nostdinc++ -fno-builtin-printf -I. - -$(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_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=trusted/$(enclaveName).lds - - -$(EnclaveName)_Cpp_Objects := $($(EnclaveName)_Cpp_Files:.cpp=.o) -$(EnclaveName)_C_Objects := $($(EnclaveName)_C_Files:.c=.o) - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -all: lib$(enclaveName).sgx.static.lib.a - -######## $(enclaveName) Objects ######## - -$(TRUSTED_DIR)/$(enclaveName)_t.h: $(SGX_EDGER8R) ./$(TRUSTED_DIR)/$(enclaveName).edl - @cd ./$(TRUSTED_DIR) && $(SGX_EDGER8R) --header-only --trusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(TRUSTED_DIR)/$(enclaveName)_t.o: ./trusted/$(enclaveName)_t.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.cpp - @$(CXX) $($(EnclaveName)_Include_Paths) $($(EnclaveName)_Cpp_Flags) -c $< -o $@ - @echo "CXX <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -lib$(enclaveName).sgx.static.lib.a: $(TRUSTED_DIR)/$(enclaveName)_t.h $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) - ar rcs lib$(enclaveName).sgx.static.lib.a $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) - @echo "LINK => $@" - -clean: - @rm -f lib$(enclaveName).* $(TRUSTED_DIR)/$(enclaveName)_t.* $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_u.without_app.mk deleted file mode 100644 index ac9b32bc..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c++/sgx_u.without_app.mk +++ /dev/null @@ -1,72 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -UNTRUSTED_DIR=untrusted -TRUSTED_DIR=static_trusted - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(enclaveName)_u.o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @mkdir -p $(UNTRUSTED_DIR) - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(enclaveName)_u.* diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_t_static.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_t_static.mk deleted file mode 100644 index b49932ac..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_t_static.mk +++ /dev/null @@ -1,96 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -TRUSTED_DIR=static_trusted - -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 - -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 - -$(EnclaveName)_C_Files := $(TRUSTED_DIR)/$(enclaveName).c -$(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. -$(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_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=$(TRUSTED_DIR)/$(enclaveName).lds - -$(EnclaveName)_C_Objects := $($(EnclaveName)_C_Files:.c=.o) - -ifeq ($(SGX_MODE), HW) -ifneq ($(SGX_DEBUG), 1) -ifneq ($(SGX_PRERELEASE), 1) -Build_Mode = HW_RELEASE -endif -endif -endif - - -.PHONY: all run - -all: lib$(enclaveName).sgx.static.lib.a - -######## $(enclaveName) Objects ######## - -$(TRUSTED_DIR)/$(enclaveName)_t.h: $(SGX_EDGER8R) ./$(TRUSTED_DIR)/$(enclaveName).edl - @cd ./$(TRUSTED_DIR) && $(SGX_EDGER8R) --header-only --trusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(TRUSTED_DIR)/$(enclaveName)_t.o: ./$(TRUSTED_DIR)/$(enclaveName)_t.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(TRUSTED_DIR)/%.o: $(TRUSTED_DIR)/%.c - @$(CC) $($(EnclaveName)_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -lib$(enclaveName).sgx.static.lib.a: $(TRUSTED_DIR)/$(enclaveName)_t.h $($(EnclaveName)_C_Objects) - ar rcs lib$(enclaveName).sgx.static.lib.a $($(EnclaveName)_Cpp_Objects) $($(EnclaveName)_C_Objects) - @echo "LINK => $@" - -clean: - @rm -f lib$(enclaveName).* $(TRUSTED_DIR)/$(enclaveName)_t.* $($(EnclaveName)_C_Objects) \ No newline at end of file diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_u.without_app.mk deleted file mode 100644 index 98a6fbe3..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/c/sgx_u.without_app.mk +++ /dev/null @@ -1,71 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -UNTRUSTED_DIR=untrusted -TRUSTED_DIR=static_trusted - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(enclaveName)_u.o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(enclaveName)_u.c: $(SGX_EDGER8R) $(TRUSTED_DIR)/$(enclaveName).edl - @mkdir -p $(UNTRUSTED_DIR) - @cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted ../$(TRUSTED_DIR)/$(enclaveName).edl --search-path ../$(TRUSTED_DIR) --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(enclaveName)_u.o: $(UNTRUSTED_DIR)/$(enclaveName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(enclaveName)_u.* diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile deleted file mode 100644 index 3defedc4..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -all: - $(MAKE) -f sgx_u.mk all - $(MAKE) -f sgx_t.mk all - -clean: - $(MAKE) -f sgx_u.mk clean - $(MAKE) -f sgx_t.mk clean - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile.without_app b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile.without_app deleted file mode 100644 index 8002693e..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/makefiles/common/Makefile.without_app +++ /dev/null @@ -1,8 +0,0 @@ -all: - $(MAKE) -f sgx_u.mk all - $(MAKE) -f sgx_t_static.mk all - -clean: - $(MAKE) -f sgx_u.mk clean - $(MAKE) -f sgx_t_static.mk clean - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.cpp deleted file mode 100644 index 79700c42..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "$(enclaveName)_t.h" /* print_string */ - -int ecall_$(enclaveName)_sample() -{ - return 0; -} - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.edl b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.edl deleted file mode 100644 index 7af749e5..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXTrustedStaticLibrary/static_trusted/Enclave2_minimal.edl +++ /dev/null @@ -1,11 +0,0 @@ -/* $(enclaveName).edl - Top EDL file. */ - -enclave { - - untrusted { - }; - - trusted { - public int ecall_$(enclaveName)_sample(); - }; -}; diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c++/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c++/sgx_u.without_app.mk deleted file mode 100644 index f4945a4d..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c++/sgx_u.without_app.mk +++ /dev/null @@ -1,75 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -UNTRUSTED_DIR=untrusted -SGX_EDL_FILE := $(baseName).edl - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(baseName)_u.o $(UNTRUSTED_DIR)/$(baseName).o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(baseName)_u.c: $(SGX_EDGER8R) $(SGX_EDL_FILE) - @mkdir -p $(UNTRUSTED_DIR) && cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted $(SGX_EDL_FILE) --search-path .. --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(baseName)_u.o: $(UNTRUSTED_DIR)/$(baseName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(UNTRUSTED_DIR)/$(baseName).o: $(UNTRUSTED_DIR)/$(baseName).cpp - @$(CC) $(App_Cpp_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(baseName)_u.* $(UNTRUSTED_DIR)/$(baseName).o diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c/sgx_u.without_app.mk b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c/sgx_u.without_app.mk deleted file mode 100644 index 717d15f1..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/c/sgx_u.without_app.mk +++ /dev/null @@ -1,75 +0,0 @@ -######## Intel(R) SGX SDK Settings ######## -SGX_SDK ?= $(SdkPathFromPlugin) -SGX_MODE ?= SIM -SGX_ARCH ?= x64 -UNTRUSTED_DIR=untrusted -SGX_EDL_FILE := $(baseName).edl - -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_EDGER8R := $(SGX_SDK)/bin/x86/sgx_edger8r -else - SGX_COMMON_CFLAGS := -m64 - 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 ######## - -App_Include_Paths := -IInclude -I$(UNTRUSTED_DIR) -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 - -.PHONY: all run - -all: $(UNTRUSTED_DIR)/$(baseName)_u.o $(UNTRUSTED_DIR)/$(baseName).o - -######## App Objects ######## - -$(UNTRUSTED_DIR)/$(baseName)_u.c: $(SGX_EDGER8R) $(SGX_EDL_FILE) - @mkdir -p $(UNTRUSTED_DIR) && cd $(UNTRUSTED_DIR) && $(SGX_EDGER8R) --untrusted $(SGX_EDL_FILE) --search-path .. --search-path $(SGX_SDK)/include - @echo "GEN => $@" - -$(UNTRUSTED_DIR)/$(baseName)_u.o: $(UNTRUSTED_DIR)/$(baseName)_u.c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -$(UNTRUSTED_DIR)/$(baseName).o: $(UNTRUSTED_DIR)/$(baseName).c - @$(CC) $(App_C_Flags) -c $< -o $@ - @echo "CC <= $<" - -.PHONY: clean - -clean: - @rm -f $(UNTRUSTED_DIR)/$(baseName)_u.* $(UNTRUSTED_DIR)/$(baseName).o diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/common/Makefile b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/common/Makefile deleted file mode 100644 index af0747ec..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/makefiles/common/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -all: - $(MAKE) -f sgx_u.mk all - -clean: - $(MAKE) -f sgx_u.mk clean - diff --git a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/untrusted/untrusted_module.cpp b/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/untrusted/untrusted_module.cpp deleted file mode 100644 index f4d2acdc..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/plugins/com.intel.sgx/templates/sgx/SGXUntrustedModule/untrusted/untrusted_module.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "$(baseName)_u.h" diff --git a/Linux_SGXEclipsePlugin/build_directory/sites/site.xml b/Linux_SGXEclipsePlugin/build_directory/sites/site.xml deleted file mode 100644 index eae70692..00000000 --- a/Linux_SGXEclipsePlugin/build_directory/sites/site.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - This website hosts an evaluation version of the Eclipse Plug-in developed for Secure Guard Extensions Application development for Linux platforms. - - - - - - Intel(R) SGX Eclipse Plugin 1.0.1.qualifier - - diff --git a/Linux_SGXEclipsePlugin/clean.sh b/Linux_SGXEclipsePlugin/clean.sh deleted file mode 100755 index 41d3ec68..00000000 --- a/Linux_SGXEclipsePlugin/clean.sh +++ /dev/null @@ -1,20 +0,0 @@ -# clean input directories to make sure there's nothing left from previous run - -rm -rfv ./build_directory/features/com.intel.sgx.build.driver -rm -fv build_directory/*.properties -rm -fv build_directory/*.xml -rm -fv build_directory/plugins/com.intel.sgx/build.xml -rm -fv build_directory/plugins/com.intel.sgx.userguide/build.xml -rm -rfv build_directory/plugins/com.intel.sgx/bin -rm -rfv build_directory/plugins/com.intel.sgx.userguide/bin -rm -rfv build_directory/plugins/com.intel.sgx.source_1.0.0.* -rm -rfv build_directory/features/com.intel.sgx.source -rm -fv build_directory/features/com.intel.sgx.feature/build.xml -rm -fv build_directory/features/com.intel.sgx.feature/*.zip -rm -rfv build_directory/nestedJars -rm -rfv build_directory/updatesite/sgx-eclipse-plugin -find . -name "*.zip" ! -name "eclipse_oxygen.v4.7.3_x64.zip" | xargs rm -rfv -find . -name "javaCompiler*" | xargs rm -rfv -find . -name "@*" | xargs rm -rfv -find build_directory -maxdepth 1 -mindepth 1 | grep -v "features" | grep -v "plugins" | grep -v "sites" | grep -v "updatesite" | xargs rm -frv - diff --git a/Linux_SGXEclipsePlugin/readme.txt b/Linux_SGXEclipsePlugin/readme.txt deleted file mode 100644 index 15e77b0b..00000000 --- a/Linux_SGXEclipsePlugin/readme.txt +++ /dev/null @@ -1,22 +0,0 @@ -The eclipse plugin build from command line requires the following variables to be set. - -$ECLIPSE_HOME - Path to eclipse home. In order to build the plugin eclipse needs to be installed. -$RELEASE_ID - The release id for the plugin. The release id should be changed for each source codes updates. -$DELETE_CURRENT_ECLIPSE - Delete current eclipse or not. Generally this variable is set to false. - -The following plugins are pre-requisites to be installed in Eclipse before trying to build the plugin. - -1. Eclipse IDE for C/C++ Developers 4.21.0.20210910-1417 (tested_version) -2. Eclipse PDE Plug-in Developer Resources 3.13.3.v20180301-11 (tested_version) - -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 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 - -The plugin has been tested with the following Eclipse ADT version - -Build: v22.3.0-887826 diff --git a/SampleCode/Cxx11SGXDemo/.cproject b/SampleCode/Cxx11SGXDemo/.cproject deleted file mode 100644 index 6fff949b..00000000 --- a/SampleCode/Cxx11SGXDemo/.cproject +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleCode/Cxx11SGXDemo/.project b/SampleCode/Cxx11SGXDemo/.project deleted file mode 100644 index 8feb4901..00000000 --- a/SampleCode/Cxx11SGXDemo/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - Cxx11SGXDemo - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.intel.sgx.sgxnature - - diff --git a/SampleCode/Cxx11SGXDemo/.settings/language.settings.xml b/SampleCode/Cxx11SGXDemo/.settings/language.settings.xml deleted file mode 100644 index bb1f9221..00000000 --- a/SampleCode/Cxx11SGXDemo/.settings/language.settings.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleCode/PowerTransition/.cproject b/SampleCode/PowerTransition/.cproject deleted file mode 100644 index 28942341..00000000 --- a/SampleCode/PowerTransition/.cproject +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleCode/PowerTransition/.project b/SampleCode/PowerTransition/.project deleted file mode 100644 index 7f1ef068..00000000 --- a/SampleCode/PowerTransition/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - PowerTransition - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.intel.sgx.sgxnature - - diff --git a/SampleCode/PowerTransition/.settings/language.settings.xml b/SampleCode/PowerTransition/.settings/language.settings.xml deleted file mode 100644 index bb1f9221..00000000 --- a/SampleCode/PowerTransition/.settings/language.settings.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleCode/SampleEnclave/.cproject b/SampleCode/SampleEnclave/.cproject deleted file mode 100644 index 690134a3..00000000 --- a/SampleCode/SampleEnclave/.cproject +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/SampleCode/SampleEnclave/.project b/SampleCode/SampleEnclave/.project deleted file mode 100644 index 102c1058..00000000 --- a/SampleCode/SampleEnclave/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - SampleEnclave - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - org.eclipse.cdt.core.ccnature - com.intel.sgx.sgxnature - - diff --git a/SampleCode/SampleEnclave/.settings/language.settings.xml b/SampleCode/SampleEnclave/.settings/language.settings.xml deleted file mode 100644 index bb1f9221..00000000 --- a/SampleCode/SampleEnclave/.settings/language.settings.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/linux/installer/common/sdk/BOMs/sdk_base.txt b/linux/installer/common/sdk/BOMs/sdk_base.txt index d08de043..06512906 100644 --- a/linux/installer/common/sdk/BOMs/sdk_base.txt +++ b/linux/installer/common/sdk/BOMs/sdk_base.txt @@ -152,14 +152,11 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /SampleCode/PowerTransition/App/rwlock.cpp /package/SampleCode/PowerTransition/App/rwlock.cpp 0 main STP /SampleCode/PowerTransition/App/rwlock.h /package/SampleCode/PowerTransition/App/rwlock.h 0 main STP /SampleCode/PowerTransition/Common/types.h /package/SampleCode/PowerTransition/Common/types.h 0 main STP -/SampleCode/PowerTransition/.cproject /package/SampleCode/PowerTransition/.cproject 0 main STP -/SampleCode/PowerTransition/.settings/language.settings.xml /package/SampleCode/PowerTransition/.settings/language.settings.xml 0 main STP /SampleCode/PowerTransition/Enclave/Enclave.config.xml /package/SampleCode/PowerTransition/Enclave/Enclave.config.xml 0 main STP /SampleCode/PowerTransition/Enclave/Enclave.cpp /package/SampleCode/PowerTransition/Enclave/Enclave.cpp 0 main STP /SampleCode/PowerTransition/Enclave/Enclave.edl /package/SampleCode/PowerTransition/Enclave/Enclave.edl 0 main STP /SampleCode/PowerTransition/Enclave/Enclave.lds /package/SampleCode/PowerTransition/Enclave/Enclave.lds 0 main STP /SampleCode/PowerTransition/Makefile /package/SampleCode/PowerTransition/Makefile 0 main STP -/SampleCode/PowerTransition/.project /package/SampleCode/PowerTransition/.project 0 main STP /SampleCode/PowerTransition/README.txt /package/SampleCode/PowerTransition/README.txt 0 main STP /SampleCode/SampleEnclave/App/App.cpp /package/SampleCode/SampleEnclave/App/App.cpp 0 main STP /SampleCode/SampleEnclave/App/App.h /package/SampleCode/SampleEnclave/App/App.h 0 main STP @@ -170,8 +167,6 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /SampleCode/SampleEnclave/App/TrustedLibrary/Libc.cpp /package/SampleCode/SampleEnclave/App/TrustedLibrary/Libc.cpp 0 main STP /SampleCode/SampleEnclave/App/TrustedLibrary/Libcxx.cpp /package/SampleCode/SampleEnclave/App/TrustedLibrary/Libcxx.cpp 0 main STP /SampleCode/SampleEnclave/App/TrustedLibrary/Thread.cpp /package/SampleCode/SampleEnclave/App/TrustedLibrary/Thread.cpp 0 main STP -/SampleCode/SampleEnclave/.cproject /package/SampleCode/SampleEnclave/.cproject 0 main STP -/SampleCode/SampleEnclave/.settings/language.settings.xml /package/SampleCode/SampleEnclave/.settings/language.settings.xml 0 main STP /SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Arrays.cpp /package/SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Arrays.cpp 0 main STP /SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Arrays.edl /package/SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Arrays.edl 0 main STP /SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Functions.cpp /package/SampleCode/SampleEnclave/Enclave/Edger8rSyntax/Functions.cpp 0 main STP @@ -198,7 +193,6 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /SampleCode/SampleEnclave/Enclave/TrustedLibrary/Thread.edl /package/SampleCode/SampleEnclave/Enclave/TrustedLibrary/Thread.edl 0 main STP /SampleCode/SampleEnclave/Include/user_types.h /package/SampleCode/SampleEnclave/Include/user_types.h 0 main STP /SampleCode/SampleEnclave/Makefile /package/SampleCode/SampleEnclave/Makefile 0 main STP -/SampleCode/SampleEnclave/.project /package/SampleCode/SampleEnclave/.project 0 main STP /SampleCode/SampleEnclave/README.txt /package/SampleCode/SampleEnclave/README.txt 0 main STP /SampleCode/SampleEnclaveGMIPP/App/App.cpp /package/SampleCode/SampleEnclaveGMIPP/App/App.cpp 0 main STP /SampleCode/SampleEnclaveGMIPP/App/App.h /package/SampleCode/SampleEnclaveGMIPP/App/App.h 0 main STP @@ -307,9 +301,6 @@ DeliveryName InstallName FileCheckSum FileFeature FileOwner /SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.edl /package/SampleCode/Cxx11SGXDemo/Enclave/TrustedLibrary/Libcxx.edl 0 main STP /SampleCode/Cxx11SGXDemo/Makefile /package/SampleCode/Cxx11SGXDemo/Makefile 0 main STP /SampleCode/Cxx11SGXDemo/README.txt /package/SampleCode/Cxx11SGXDemo/README.txt 0 main STP -/SampleCode/Cxx11SGXDemo/.project /package/SampleCode/Cxx11SGXDemo/.project 0 main STP -/SampleCode/Cxx11SGXDemo/.cproject /package/SampleCode/Cxx11SGXDemo/.cproject 0 main STP -/SampleCode/Cxx11SGXDemo/.settings/language.settings.xml /package/SampleCode/Cxx11SGXDemo/.settings/language.settings.xml 0 main STP /SampleCode/Cxx14SGXDemo/App/App.cpp /package/SampleCode/Cxx14SGXDemo/App/App.cpp 0 main STP /SampleCode/Cxx14SGXDemo/App/App.h /package/SampleCode/Cxx14SGXDemo/App/App.h 0 main STP /SampleCode/Cxx14SGXDemo/App/TrustedLibrary/Libcxx.cpp /package/SampleCode/Cxx14SGXDemo/App/TrustedLibrary/Libcxx.cpp 0 main STP diff --git a/linux/installer/rpm/psw-dcap/psw-dcap.spec.tmpl b/linux/installer/rpm/psw-dcap/psw-dcap.spec.tmpl index 703b42e9..3918559c 100644 --- a/linux/installer/rpm/psw-dcap/psw-dcap.spec.tmpl +++ b/linux/installer/rpm/psw-dcap/psw-dcap.spec.tmpl @@ -42,7 +42,7 @@ Version: %{_psw_version} Release: 1%{?dist} Summary: Intel(R) Software Guard Extensions AESM Service -License: BSD and MIT and Apache and GPL and BSD/GPLv2 dual and zlib/libpng and Eclipse Public License-v1.0 and Open Source and OpenSSL +License: BSD and MIT and Apache and GPL and BSD/GPLv2 dual and zlib/libpng and Open Source and OpenSSL URL: https://github.com/intel/linux-sgx Source0: psw-dcap-%{version}.tar.gz diff --git a/linux/installer/rpm/psw-tdx/psw-tdx.spec.tmpl b/linux/installer/rpm/psw-tdx/psw-tdx.spec.tmpl index d7673f84..3d3151a1 100644 --- a/linux/installer/rpm/psw-tdx/psw-tdx.spec.tmpl +++ b/linux/installer/rpm/psw-tdx/psw-tdx.spec.tmpl @@ -42,7 +42,7 @@ Version: %{_dcap_version} Release: 1%{?dist} Summary: Intel(R) TD Quoting Generation Service -License: BSD and MIT and Apache and GPL and BSD/GPLv2 dual and zlib/libpng and Eclipse Public License-v1.0 and Open Source and OpenSSL +License: BSD and MIT and Apache and GPL and BSD/GPLv2 dual and zlib/libpng and Open Source and OpenSSL URL: https://github.com/intel/linux-sgx Source0: psw-tdx-%{version}.tar.gz