fIXES

parent b42f633e
......@@ -7,13 +7,13 @@ install-sh
/config.status
/Makefile.in
/Makefile
/EnclaveGmpTest_u.h
/EnclaveGmpTest_u.c
/EnclaveGmpTest.edl
/secure_enclave_u.h
/secure_enclave_u.c
/secure_enclave.edl
/am--include-marker
*.o
/aclocal.m4
/EnclaveGmpTest.signed.so
/secure_enclave.signed.so
/sgxgmpmath
/sgxgmppi
/.deps/
EnclaveGmpTest.o: EnclaveGmpTest.c EnclaveGmpTest_t.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_defs.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_error.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_eid.h \
/d/sgxd/tgmp-build/include/sgx_tgmp.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_trts.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_attributes.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_key.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_report.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tseal.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/math.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/float.h
EnclaveGmpTest_t.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_defs.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_error.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_eid.h:
/d/sgxd/tgmp-build/include/sgx_tgmp.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_trts.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_attributes.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_key.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_report.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tseal.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_tcrypto.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/math.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/float.h:
EnclaveGmpTest_t.o: EnclaveGmpTest_t.c EnclaveGmpTest_t.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_defs.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_error.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_eid.h \
/d/sgxd/tgmp-build/include/sgx_tgmp.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/limits.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_trts.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_lfence.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/errno.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/mbusafecrt.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/string.h \
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h
EnclaveGmpTest_t.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdint.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/stdint.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/cdefs.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/_types.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/wchar.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stddef.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_edger8r.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_defs.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_error.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_eid.h:
/d/sgxd/tgmp-build/include/sgx_tgmp.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/limits.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/sys/limits.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdlib.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_trts.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/sgx_lfence.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/errno.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/mbusafecrt.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/string.h:
/d/sgxd/sgx-sdk-build/sgxsdk/include/tlibc/stdarg.h:
......@@ -107,7 +107,7 @@ PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = sgx_stub.$(OBJEXT) sgx_detect_linux.$(OBJEXT) \
create_enclave.$(OBJEXT) oc_alloc.$(OBJEXT)
am_sgxd_OBJECTS = sgxd.$(OBJEXT) $(am__objects_1)
am__objects_2 = EnclaveGmpTest_u.$(OBJEXT)
am__objects_2 = secure_enclave_u.$(OBJEXT)
nodist_sgxd_OBJECTS = $(am__objects_2)
sgxd_OBJECTS = $(am_sgxd_OBJECTS) $(nodist_sgxd_OBJECTS)
sgxd_DEPENDENCIES =
......@@ -354,18 +354,18 @@ AM_CPPFLAGS = -I$(SGXSDK_INCDIR) -DSKALE_SGX=1 \
-fno-builtin-memset $(GMP_CPPFLAGS)
#AM_LDFLAGS = $(GMP_LDFLAGS)
AM_LDFLAGS = -L$(SGXSDK_LIBDIR) $(GMP_LDFLAGS)
SUBDIRS = EnclaveGmpTest
CLEANFILES = $(COMMON_ENCLAVE_SRC) EnclaveGmpTest.edl \
EnclaveGmpTest.signed.so
SUBDIRS = secure_enclave
CLEANFILES = $(COMMON_ENCLAVE_SRC) secure_enclave.edl \
secure_enclave.signed.so
COMMON_SRC = sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC = EnclaveGmpTest_u.c EnclaveGmpTest_u.h
COMMON_ENCLAVE_SRC = secure_enclave_u.c secure_enclave_u.h
sgxgmpmath_SOURCES = sgxgmpmath.c $(COMMON_SRC)
nodist_sgxgmpmath_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxgmpmath_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxgmpmath_DEPENDENCIES = secure_enclave.signed.so
sgxd_SOURCES = sgxd.c $(COMMON_SRC)
nodist_sgxd_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxd_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxd_DEPENDENCIES = secure_enclave.signed.so
BUILT_SOURCES = $(COMMON_ENCLAVE_SRC)
sgxgmpmath_LDADD = -l$(SGX_URTS_LIB) -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread
sgxd_LDADD = -l$(SGX_URTS_LIB) -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread
......@@ -461,9 +461,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/EnclaveGmpTest_u.Po
include ./$(DEPDIR)/create_enclave.Po
include ./$(DEPDIR)/oc_alloc.Po
include ./$(DEPDIR)/secure_enclave_u.Po
include ./$(DEPDIR)/sgx_detect_linux.Po
include ./$(DEPDIR)/sgx_stub.Po
include ./$(DEPDIR)/sgxd.Po
......@@ -916,10 +916,10 @@ uninstall-am: uninstall-binPROGRAMS
%_u.h %_u.c: %.edl
$(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --untrusted $<
EnclaveGmpTest.edl: EnclaveGmpTest/EnclaveGmpTest.edl
secure_enclave.edl: secure_enclave/secure_enclave.edl
ln -s $?
EnclaveGmpTest.signed.so: EnclaveGmpTest/EnclaveGmpTest.signed.so
secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
ln -s $?
# Tell versions [3.59,3.63) of GNU make to not export all variables.
......
......@@ -26,7 +26,7 @@ include $(top_srcdir)/build-aux/sgx_app.am
## SGX_UAE_SERVICE_LIB
## SGX_EDGER8R
SUBDIRS=EnclaveGmpTest
SUBDIRS=secure_enclave
## Supply additional flags to edger8r here.
##
......@@ -36,7 +36,7 @@ SUBDIRS=EnclaveGmpTest
## Needed to make our pattern rule work.
EnclaveGmpTest.edl: EnclaveGmpTest/EnclaveGmpTest.edl
secure_enclave.edl: secure_enclave/secure_enclave.edl
ln -s $?
## Additional automake variables
......@@ -50,8 +50,8 @@ AM_CPPFLAGS += -DSKALE_SGX=1 -DBINARY_OUTPUT=1 -Ilibff -fno-builtin-memset $(GM
## Additional targets to remove with 'make clean'. You must list
## any edger8r generated files here.
CLEANFILES = $(COMMON_ENCLAVE_SRC) EnclaveGmpTest.edl \
EnclaveGmpTest.signed.so
CLEANFILES = $(COMMON_ENCLAVE_SRC) secure_enclave.edl \
secure_enclave.signed.so
## The build target
......@@ -63,20 +63,20 @@ bin_PROGRAMS = sgxd
## have to be explicitly listed.
COMMON_SRC = sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC = EnclaveGmpTest_u.c EnclaveGmpTest_u.h
COMMON_ENCLAVE_SRC = secure_enclave_u.c secure_enclave_u.h
sgxgmpmath_SOURCES = sgxgmpmath.c $(COMMON_SRC)
nodist_sgxgmpmath_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxgmpmath_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxgmpmath_DEPENDENCIES = secure_enclave.signed.so
sgxd_SOURCES = sgxd.c $(COMMON_SRC)
nodist_sgxd_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxd_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxd_DEPENDENCIES = secure_enclave.signed.so
BUILT_SOURCES = $(COMMON_ENCLAVE_SRC)
AM_LDFLAGS += $(GMP_LDFLAGS)
EnclaveGmpTest.signed.so: EnclaveGmpTest/EnclaveGmpTest.signed.so
secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
ln -s $?
## Library flags. At minimum, an Intel SGX application will need:
......
......@@ -107,7 +107,7 @@ PROGRAMS = $(bin_PROGRAMS)
am__objects_1 = sgx_stub.$(OBJEXT) sgx_detect_linux.$(OBJEXT) \
create_enclave.$(OBJEXT) oc_alloc.$(OBJEXT)
am_sgxd_OBJECTS = sgxd.$(OBJEXT) $(am__objects_1)
am__objects_2 = EnclaveGmpTest_u.$(OBJEXT)
am__objects_2 = secure_enclave_u.$(OBJEXT)
nodist_sgxd_OBJECTS = $(am__objects_2)
sgxd_OBJECTS = $(am_sgxd_OBJECTS) $(nodist_sgxd_OBJECTS)
sgxd_DEPENDENCIES =
......@@ -354,18 +354,18 @@ SGXSSL_BINDIR = @SGXSSL_BINDIR@
@SGX_ENABLED_TRUE@ -fno-builtin-memset $(GMP_CPPFLAGS)
@SGX_ENABLED_FALSE@AM_LDFLAGS = $(GMP_LDFLAGS)
@SGX_ENABLED_TRUE@AM_LDFLAGS = -L$(SGXSDK_LIBDIR) $(GMP_LDFLAGS)
SUBDIRS = EnclaveGmpTest
CLEANFILES = $(COMMON_ENCLAVE_SRC) EnclaveGmpTest.edl \
EnclaveGmpTest.signed.so
SUBDIRS = secure_enclave
CLEANFILES = $(COMMON_ENCLAVE_SRC) secure_enclave.edl \
secure_enclave.signed.so
COMMON_SRC = sgx_stub.c sgx_detect_linux.c create_enclave.c oc_alloc.c
COMMON_ENCLAVE_SRC = EnclaveGmpTest_u.c EnclaveGmpTest_u.h
COMMON_ENCLAVE_SRC = secure_enclave_u.c secure_enclave_u.h
sgxgmpmath_SOURCES = sgxgmpmath.c $(COMMON_SRC)
nodist_sgxgmpmath_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxgmpmath_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxgmpmath_DEPENDENCIES = secure_enclave.signed.so
sgxd_SOURCES = sgxd.c $(COMMON_SRC)
nodist_sgxd_SOURCES = $(COMMON_ENCLAVE_SRC)
EXTRA_sgxd_DEPENDENCIES = EnclaveGmpTest.signed.so
EXTRA_sgxd_DEPENDENCIES = secure_enclave.signed.so
BUILT_SOURCES = $(COMMON_ENCLAVE_SRC)
sgxgmpmath_LDADD = -l$(SGX_URTS_LIB) -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread
sgxd_LDADD = -l$(SGX_URTS_LIB) -lgmp -ldl -l:libsgx_capable.a -l:libsgx_tprotected_fs.a -lpthread
......@@ -461,9 +461,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EnclaveGmpTest_u.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_enclave.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oc_alloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave_u.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgx_detect_linux.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgx_stub.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sgxd.Po@am__quote@
......@@ -916,10 +916,10 @@ uninstall-am: uninstall-binPROGRAMS
@SGX_ENABLED_TRUE@%_u.h %_u.c: %.edl
@SGX_ENABLED_TRUE@ $(SGX_EDGER8R) --search-path $(SGXSDK_INCDIR) $(SGX_EDGER8R_FLAGS) --untrusted $<
EnclaveGmpTest.edl: EnclaveGmpTest/EnclaveGmpTest.edl
secure_enclave.edl: secure_enclave/secure_enclave.edl
ln -s $?
EnclaveGmpTest.signed.so: EnclaveGmpTest/EnclaveGmpTest.signed.so
secure_enclave.signed.so: secure_enclave/secure_enclave.signed.so
ln -s $?
# Tell versions [3.59,3.63) of GNU make to not export all variables.
......
......@@ -236,7 +236,7 @@ generated by GNU Autoconf 2.69. Invocation command line was
on kladko
config.status:815: creating Makefile
config.status:815: creating EnclaveGmpTest/Makefile
config.status:815: creating secure_enclave/Makefile
config.status:987: executing depfiles commands
## ---------------- ##
......
......@@ -393,7 +393,7 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
# Files that config.status was made for.
config_files=" Makefile EnclaveGmpTest/Makefile"
config_files=" Makefile secure_enclave/Makefile"
config_commands=" depfiles"
ac_cs_usage="\
......@@ -531,7 +531,7 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"EnclaveGmpTest/Makefile") CONFIG_FILES="$CONFIG_FILES EnclaveGmpTest/Makefile" ;;
"secure_enclave/Makefile") CONFIG_FILES="$CONFIG_FILES secure_enclave/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
......
......@@ -4384,7 +4384,7 @@ TGMP_CPPFLAGS="-I${tgmpdir}/include -I${gmpdir}/include"
TGMP_LDFLAGS="-L$tgmpdir/lib"
ac_config_files="$ac_config_files Makefile EnclaveGmpTest/Makefile"
ac_config_files="$ac_config_files Makefile secure_enclave/Makefile"
cat >confcache <<\_ACEOF
......@@ -5146,7 +5146,7 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"EnclaveGmpTest/Makefile") CONFIG_FILES="$CONFIG_FILES EnclaveGmpTest/Makefile" ;;
"secure_enclave/Makefile") CONFIG_FILES="$CONFIG_FILES secure_enclave/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
......
......@@ -35,6 +35,6 @@ AS_IF([test "$tgmpdir" != ""], [
AC_SUBST([TGMP_LDFLAGS], [-L$tgmpdir/lib])
])
AC_CONFIG_FILES([Makefile EnclaveGmpTest/Makefile])
AC_CONFIG_FILES([Makefile secure_enclave/Makefile])
AC_OUTPUT()
......@@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include <stdio.h>
#include "EnclaveGmpTest_u.h"
#include "secure_enclave_u.h"
uint64_t oc_realloc (void *optr, size_t osz, size_t nsz)
{
......
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# EnclaveGmpTest/Makefile. Generated from Makefile.in by configure.
# secure_enclave/Makefile. Generated from Makefile.in by configure.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
......@@ -89,7 +89,7 @@ POST_UNINSTALL = :
libexec_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3)
#am__append_1 = signed_enclave_rel
am__append_2 = signed_enclave_debug
subdir = EnclaveGmpTest
subdir = secure_enclave
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sgx_init.m4 \
$(top_srcdir)/configure.ac
......@@ -99,19 +99,19 @@ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = EnclaveGmpTest$(EXEEXT)
am__EXEEXT_1 = secure_enclave$(EXEEXT)
#am__EXEEXT_2 = signed_enclave_rel$(EXEEXT)
am__EXEEXT_3 = \
signed_enclave_debug$(EXEEXT)
am__installdirs = "$(DESTDIR)$(libexecdir)"
PROGRAMS = $(libexec_PROGRAMS)
am__objects_1 =
am_EnclaveGmpTest_OBJECTS = EnclaveGmpTest_t.$(OBJEXT) \
EnclaveGmpTest.$(OBJEXT) BLSUtils.$(OBJEXT) \
am_secure_enclave_OBJECTS = secure_enclave_t.$(OBJEXT) \
secure_enclave.$(OBJEXT) BLSUtils.$(OBJEXT) \
alt_bn128_init.$(OBJEXT) alt_bn128_g1.$(OBJEXT) \
$(am__objects_1) $(am__objects_1)
EnclaveGmpTest_OBJECTS = $(am_EnclaveGmpTest_OBJECTS)
EnclaveGmpTest_DEPENDENCIES =
secure_enclave_OBJECTS = $(am_secure_enclave_OBJECTS)
secure_enclave_DEPENDENCIES =
nodist_signed_enclave_debug_OBJECTS = \
signed_enclave_debug.$(OBJEXT)
signed_enclave_debug_OBJECTS = $(nodist_signed_enclave_debug_OBJECTS)
......@@ -165,10 +165,10 @@ AM_V_CXXLD = $(am__v_CXXLD_$(V))
am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(EnclaveGmpTest_SOURCES) \
SOURCES = $(secure_enclave_SOURCES) \
$(nodist_signed_enclave_debug_SOURCES) \
$(nodist_signed_enclave_rel_SOURCES)
DIST_SOURCES = $(EnclaveGmpTest_SOURCES)
DIST_SOURCES = $(secure_enclave_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
......@@ -268,8 +268,8 @@ STRIP =
TGMP_CPPFLAGS = -I/d/sgxd/tgmp-build/include -I/d/sgxd/gmp-build/include
TGMP_LDFLAGS = -L/d/sgxd/tgmp-build/lib
VERSION = 1.0
abs_builddir = /d/sgxd/EnclaveGmpTest
abs_srcdir = /d/sgxd/EnclaveGmpTest
abs_builddir = /d/sgxd/secure_enclave
abs_srcdir = /d/sgxd/secure_enclave
abs_top_builddir = /d/sgxd
abs_top_srcdir = /d/sgxd
ac_ct_CC = gcc
......@@ -321,19 +321,19 @@ AM_CPPFLAGS = -I$(SGXSDK_INCDIR) -I$(SGXSDK_INCDIR)/tlibc $(TGMP_CPPFLAGS) -I../
-I../sgx-sdk-build/sgxsdk/include/libcxx
AM_CXXFLAGS = -nostdinc++ -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector -fno-builtin
AM_LDFLAGS = -nostdlib -nodefaultlibs -nostartfiles -L$(SGXSDK_LIBDIR) $(TGMP_LDFLAGS)
CLEANFILES = $(ENCLAVE).signed.so EnclaveGmpTest_t.c \
EnclaveGmpTest_t.h
CLEANFILES = $(ENCLAVE).signed.so secure_enclave_t.c \
secure_enclave_t.h
#nodist_signed_enclave_rel_SOURCES = signed_enclave_rel.c
nodist_signed_enclave_debug_SOURCES = signed_enclave_debug.c
ENCLAVE = EnclaveGmpTest
ENCLAVE = secure_enclave
ENCLAVE_CONFIG = $(ENCLAVE).config.xml
ENCLAVE_KEY = $(ENCLAVE)_private.pem
EnclaveGmpTest_SOURCES = EnclaveGmpTest_t.c EnclaveGmpTest_t.h \
EnclaveGmpTest.c \
secure_enclave_SOURCES = secure_enclave_t.c secure_enclave_t.h \
secure_enclave.c \
BLSUtils.cpp ../libff/libff/algebra/curves/alt_bn128/alt_bn128_init.cpp \
../libff/libff/algebra/curves/alt_bn128/alt_bn128_g1.cpp $(ENCLAVE_KEY) $(ENCLAVE_CONFIG)
EnclaveGmpTest_LDADD = -Wl,--no-undefined -Wl,--whole-archive -l$(SGX_TRTS_LIB) -Wl,--no-whole-archive -Wl,--start-group $(SGX_EXTRA_TLIBS) -lsgx_tstdc -lsgx_tcrypto -l$(SGX_TSERVICE_LIB) -Wl,--end-group -Wl,-Bstatic -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0
secure_enclave_LDADD = -Wl,--no-undefined -Wl,--whole-archive -l$(SGX_TRTS_LIB) -Wl,--no-whole-archive -Wl,--start-group $(SGX_EXTRA_TLIBS) -lsgx_tstdc -lsgx_tcrypto -l$(SGX_TSERVICE_LIB) -Wl,--end-group -Wl,-Bstatic -Wl,-Bsymbolic -Wl,-pie,-eenclave_entry -Wl,--export-dynamic -Wl,--defsym,__ImageBase=0
SGX_EXTRA_TLIBS = -lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx
all: all-am
......@@ -348,9 +348,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build-aux/sgx_enclav
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign EnclaveGmpTest/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign secure_enclave/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign EnclaveGmpTest/Makefile
$(AUTOMAKE) --foreign secure_enclave/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -412,9 +412,9 @@ uninstall-libexecPROGRAMS:
clean-libexecPROGRAMS:
-test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
EnclaveGmpTest$(EXEEXT): $(EnclaveGmpTest_OBJECTS) $(EnclaveGmpTest_DEPENDENCIES) $(EXTRA_EnclaveGmpTest_DEPENDENCIES)
@rm -f EnclaveGmpTest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(EnclaveGmpTest_OBJECTS) $(EnclaveGmpTest_LDADD) $(LIBS)
secure_enclave$(EXEEXT): $(secure_enclave_OBJECTS) $(secure_enclave_DEPENDENCIES) $(EXTRA_secure_enclave_DEPENDENCIES)
@rm -f secure_enclave$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(secure_enclave_OBJECTS) $(secure_enclave_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
......@@ -423,10 +423,10 @@ distclean-compile:
-rm -f *.tab.c
include ./$(DEPDIR)/BLSUtils.Po
include ./$(DEPDIR)/EnclaveGmpTest.Po
include ./$(DEPDIR)/EnclaveGmpTest_t.Po
include ./$(DEPDIR)/alt_bn128_g1.Po
include ./$(DEPDIR)/alt_bn128_init.Po
include ./$(DEPDIR)/secure_enclave.Po
include ./$(DEPDIR)/secure_enclave_t.Po
include ./$(DEPDIR)/signed_enclave_debug.Po
include ./$(DEPDIR)/signed_enclave_rel.Po
......
......@@ -48,7 +48,7 @@ include $(top_srcdir)/build-aux/sgx_enclave.am
##
## libexec_PROGRAMS=$(ENCLAVE)
ENCLAVE=EnclaveGmpTest
ENCLAVE=secure_enclave
ENCLAVE_CONFIG=$(ENCLAVE).config.xml
ENCLAVE_KEY=$(ENCLAVE)_private.pem
......@@ -70,7 +70,7 @@ AM_CXXFLAGS += -fno-builtin
## Additional files to remove with 'make clean'. This list needs
## to include your edger8r genreated files.
CLEANFILES+= EnclaveGmpTest_t.c EnclaveGmpTest_t.h
CLEANFILES+= secure_enclave_t.c secure_enclave_t.h
## Supply additional flags to edger8r here.
......@@ -82,8 +82,8 @@ CLEANFILES+= EnclaveGmpTest_t.c EnclaveGmpTest_t.h
## files. You can't use the $(ENCLAVE) variable in the build
## target name (i.e., $(ENCLAVE)_SOURCES will not work).
EnclaveGmpTest_SOURCES = EnclaveGmpTest_t.c EnclaveGmpTest_t.h \
EnclaveGmpTest.c \
secure_enclave_SOURCES = secure_enclave_t.c secure_enclave_t.h \
secure_enclave.c \
BLSUtils.cpp ../libff/libff/algebra/curves/alt_bn128/alt_bn128_init.cpp \
../libff/libff/algebra/curves/alt_bn128/alt_bn128_g1.cpp $(ENCLAVE_KEY) $(ENCLAVE_CONFIG)
......@@ -104,7 +104,7 @@ AM_LDFLAGS += $(TGMP_LDFLAGS)
## of the definition to make sure you pick up the right linker flags
## and SGX trusted libraries.
EnclaveGmpTest_LDADD = @SGX_ENCLAVE_LDADD@
secure_enclave_LDADD = @SGX_ENCLAVE_LDADD@
## Place any additional trusted libraries that your enclave may need in
......@@ -123,6 +123,6 @@ SGX_EXTRA_TLIBS=-lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx
## @SGX_ENCLAVE_LDFLAGS@ is included in the definition as this will
## override AM_LDFLAGS.
##
## EnclaveGmpTest_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@
## secure_enclave_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@
##
......@@ -89,7 +89,7 @@ POST_UNINSTALL = :
libexec_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3)
@ENCLAVE_RELEASE_SIGN_TRUE@am__append_1 = signed_enclave_rel
@ENCLAVE_RELEASE_SIGN_FALSE@am__append_2 = signed_enclave_debug
subdir = EnclaveGmpTest
subdir = secure_enclave
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/sgx_init.m4 \
$(top_srcdir)/configure.ac
......@@ -99,19 +99,19 @@ DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = EnclaveGmpTest$(EXEEXT)
am__EXEEXT_1 = secure_enclave$(EXEEXT)
@ENCLAVE_RELEASE_SIGN_TRUE@am__EXEEXT_2 = signed_enclave_rel$(EXEEXT)
@ENCLAVE_RELEASE_SIGN_FALSE@am__EXEEXT_3 = \
@ENCLAVE_RELEASE_SIGN_FALSE@ signed_enclave_debug$(EXEEXT)
am__installdirs = "$(DESTDIR)$(libexecdir)"
PROGRAMS = $(libexec_PROGRAMS)
am__objects_1 =
am_EnclaveGmpTest_OBJECTS = EnclaveGmpTest_t.$(OBJEXT) \
EnclaveGmpTest.$(OBJEXT) BLSUtils.$(OBJEXT) \
am_secure_enclave_OBJECTS = secure_enclave_t.$(OBJEXT) \
secure_enclave.$(OBJEXT) BLSUtils.$(OBJEXT) \
alt_bn128_init.$(OBJEXT) alt_bn128_g1.$(OBJEXT) \
$(am__objects_1) $(am__objects_1)
EnclaveGmpTest_OBJECTS = $(am_EnclaveGmpTest_OBJECTS)
EnclaveGmpTest_DEPENDENCIES =
secure_enclave_OBJECTS = $(am_secure_enclave_OBJECTS)
secure_enclave_DEPENDENCIES =
@ENCLAVE_RELEASE_SIGN_FALSE@nodist_signed_enclave_debug_OBJECTS = \
@ENCLAVE_RELEASE_SIGN_FALSE@ signed_enclave_debug.$(OBJEXT)
signed_enclave_debug_OBJECTS = $(nodist_signed_enclave_debug_OBJECTS)
......@@ -165,10 +165,10 @@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(EnclaveGmpTest_SOURCES) \
SOURCES = $(secure_enclave_SOURCES) \
$(nodist_signed_enclave_debug_SOURCES) \
$(nodist_signed_enclave_rel_SOURCES)
DIST_SOURCES = $(EnclaveGmpTest_SOURCES)
DIST_SOURCES = $(secure_enclave_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
......@@ -321,19 +321,19 @@ AM_CPPFLAGS = @SGX_ENCLAVE_CPPFLAGS@ $(TGMP_CPPFLAGS) -I../libff \
-I../sgx-sdk-build/sgxsdk/include/libcxx
AM_CXXFLAGS = @SGX_ENCLAVE_CXXFLAGS@ @SGX_ENCLAVE_CFLAGS@ -fno-builtin
AM_LDFLAGS = @SGX_ENCLAVE_LDFLAGS@ $(TGMP_LDFLAGS)
CLEANFILES = $(ENCLAVE).signed.so EnclaveGmpTest_t.c \
EnclaveGmpTest_t.h
CLEANFILES = $(ENCLAVE).signed.so secure_enclave_t.c \
secure_enclave_t.h
@ENCLAVE_RELEASE_SIGN_TRUE@nodist_signed_enclave_rel_SOURCES = signed_enclave_rel.c
@ENCLAVE_RELEASE_SIGN_FALSE@nodist_signed_enclave_debug_SOURCES = signed_enclave_debug.c
ENCLAVE = EnclaveGmpTest
ENCLAVE = secure_enclave
ENCLAVE_CONFIG = $(ENCLAVE).config.xml
ENCLAVE_KEY = $(ENCLAVE)_private.pem
EnclaveGmpTest_SOURCES = EnclaveGmpTest_t.c EnclaveGmpTest_t.h \
EnclaveGmpTest.c \
secure_enclave_SOURCES = secure_enclave_t.c secure_enclave_t.h \
secure_enclave.c \
BLSUtils.cpp ../libff/libff/algebra/curves/alt_bn128/alt_bn128_init.cpp \
../libff/libff/algebra/curves/alt_bn128/alt_bn128_g1.cpp $(ENCLAVE_KEY) $(ENCLAVE_CONFIG)
EnclaveGmpTest_LDADD = @SGX_ENCLAVE_LDADD@
secure_enclave_LDADD = @SGX_ENCLAVE_LDADD@
SGX_EXTRA_TLIBS = -lsgx_tgmp -lsgx_tservice -lsgx_urts -lsgx_tcxx
all: all-am
......@@ -348,9 +348,9 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/build-aux/sgx_enclav
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign EnclaveGmpTest/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign secure_enclave/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign EnclaveGmpTest/Makefile
$(AUTOMAKE) --foreign secure_enclave/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
......@@ -412,9 +412,9 @@ uninstall-libexecPROGRAMS:
clean-libexecPROGRAMS:
-test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS)
EnclaveGmpTest$(EXEEXT): $(EnclaveGmpTest_OBJECTS) $(EnclaveGmpTest_DEPENDENCIES) $(EXTRA_EnclaveGmpTest_DEPENDENCIES)
@rm -f EnclaveGmpTest$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(EnclaveGmpTest_OBJECTS) $(EnclaveGmpTest_LDADD) $(LIBS)
secure_enclave$(EXEEXT): $(secure_enclave_OBJECTS) $(secure_enclave_DEPENDENCIES) $(EXTRA_secure_enclave_DEPENDENCIES)
@rm -f secure_enclave$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(secure_enclave_OBJECTS) $(secure_enclave_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
......@@ -423,10 +423,10 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BLSUtils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EnclaveGmpTest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EnclaveGmpTest_t.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_g1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alt_bn128_init.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_enclave_t.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_debug.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signed_enclave_rel.Po@am__quote@
......
......@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "EnclaveGmpTest_t.h"
#include "secure_enclave_t.h"
#include <sgx_tgmp.h>
#include <sgx_trts.h>
#include "sgx_tcrypto.h"
......
File added
/*
Copyright 2018 Intel Corporation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sgx_urts.h>
#include <gmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "sgx_detect.h"
#include "secure_enclave_u.h"
#include "create_enclave.h"
#define ENCLAVE_NAME "secure_enclave.signed.so"
void usage ();
void usage () {
fprintf(stderr, "usage: sgxgmppi digits\n");
exit(1);
}
int main (int argc, char *argv[])
{
sgx_launch_token_t token= { 0 };
sgx_enclave_id_t eid= 0;
sgx_status_t status;
int updated= 0;
unsigned long support;
mpf_t pi;
uint64_t digits;
int opt;
while ( (opt= getopt(argc, argv, "h")) != -1 ) {
switch (opt) {
case 'h':
default:
usage();
}
}
argc-= optind;
argv+= optind;
if ( argc != 1 ) usage();
digits= strtoull(argv[0], NULL, 10);
if ( digits == 0 ) {
fprintf(stderr, "invalid digit count\n");
return 1;
}
#ifndef SGX_HW_SIM
support= get_sgx_support();
if ( ! SGX_OK(support) ) {
sgx_support_perror(support);
return 1;
}
#endif
status= sgx_create_enclave_search(ENCLAVE_NAME, SGX_DEBUG_FLAG,
&token, &updated, &eid, 0);
if ( status != SGX_SUCCESS ) {
if ( status == SGX_ERROR_ENCLAVE_FILE_ACCESS ) {
fprintf(stderr, "sgx_create_enclave: %s: file not found\n",
ENCLAVE_NAME);
fprintf(stderr, "Did you forget to set LD_LIBRARY_PATH?\n");
} else {
fprintf(stderr, "%s: 0x%04x\n", ENCLAVE_NAME, status);
}
return 1;
}
fprintf(stderr, "Enclave launched\n");
status= tgmp_init(eid);
if ( status != SGX_SUCCESS ) {
fprintf(stderr, "ECALL test_mpz_add: 0x%04x\n", status);
return 1;
}
fprintf(stderr, "libtgmp initialized\n");
mpf_init(pi);
status= encrypt_key(eid, &pi, digits);
if ( status != SGX_SUCCESS ) {
fprintf(stderr, "ECALL e_pi: 0x%04x\n", status);
return 1;
}
gmp_printf("pi : %.*Ff\n", digits, pi);
return 0;
}
......@@ -35,11 +35,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gmp.h>
#include <stdio.h>
#include <stdlib.h>
#include "EnclaveGmpTest_u.h"
#include "secure_enclave_u.h"
#include "create_enclave.h"
#include "sgx_detect.h"
#define ENCLAVE_NAME "EnclaveGmpTest.signed.so"
#define ENCLAVE_NAME "secure_enclave.signed.so"
int main (int argc, char *argv[])
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment