[Assignment-7] App Intermediary and Proxy
- Intermediary is fully functional - Proxy is ready until invocation of enclave
This commit is contained in:
parent
b41976a5ff
commit
6d966e0b94
7 changed files with 182 additions and 155 deletions
|
|
@ -74,8 +74,8 @@ else
|
|||
Urts_Library_Name := sgx_urts
|
||||
endif
|
||||
|
||||
App_C_Files := App/App.c
|
||||
App_Include_Paths := -IInclude -IApp -I$(SGX_SDK)/include
|
||||
App_C_Files := app/main.c app/proxy.c app/intermediary.c app/util.c
|
||||
App_Include_Paths := -IInclude -Iapp -I$(SGX_SDK)/include
|
||||
|
||||
App_C_Flags := $(SGX_COMMON_CFLAGS) -fPIC -Wno-attributes $(App_Include_Paths)
|
||||
|
||||
|
|
@ -91,7 +91,8 @@ else
|
|||
App_C_Flags += -DNDEBUG -UEDEBUG -UDEBUG
|
||||
endif
|
||||
|
||||
App_Link_Flags := $(SGX_COMMON_CFLAGS) -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread
|
||||
Openssl_Link_Flags = `pkg-config --libs openssl`
|
||||
App_Link_Flags := $(SGX_COMMON_CFLAGS) -L$(SGX_LIBRARY_PATH) -l$(Urts_Library_Name) -lpthread $(Openssl_Link_Flags)
|
||||
|
||||
ifneq ($(SGX_MODE), HW)
|
||||
App_Link_Flags += -lsgx_uae_service_sim
|
||||
|
|
@ -101,7 +102,7 @@ endif
|
|||
|
||||
App_C_Objects := $(App_C_Files:.c=.o)
|
||||
|
||||
App_Name := app
|
||||
App_Name := signatureproxy
|
||||
|
||||
|
||||
######## Enclave Settings ########
|
||||
|
|
@ -115,8 +116,8 @@ else
|
|||
endif
|
||||
Crypto_Library_Name := sgx_tcrypto
|
||||
|
||||
Enclave_C_Files := Enclave/Enclave.c
|
||||
Enclave_Include_Paths := -IInclude -IEnclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
|
||||
Enclave_C_Files := enclave/enclave.c
|
||||
Enclave_Include_Paths := -IInclude -Ienclave -I$(SGX_SDK)/include -I$(SGX_SDK)/include/tlibc -I$(SGX_SDK)/include/libcxx
|
||||
|
||||
CC_BELOW_4_9 := $(shell expr "`$(CC) -dumpversion`" \< "4.9")
|
||||
ifeq ($(CC_BELOW_4_9), 1)
|
||||
|
|
@ -141,13 +142,13 @@ Enclave_Link_Flags := $(SGX_COMMON_CFLAGS) -Wl,--no-undefined -nostdlib -nodefau
|
|||
-Wl,-Bstatic -Wl,-Bsymbolic -Wl,--no-undefined \
|
||||
-Wl,-pie,-eenclave_entry -Wl,--export-dynamic \
|
||||
-Wl,--defsym,__ImageBase=0 -Wl,--gc-sections \
|
||||
-Wl,--version-script=Enclave/Enclave.lds \
|
||||
-Wl,--version-script=enclave/enclave.lds \
|
||||
|
||||
Enclave_C_Objects := $(Enclave_C_Files:.c=.o)
|
||||
|
||||
Enclave_Name := enclave.so
|
||||
Signed_Enclave_Name := enclave.signed.so
|
||||
Enclave_Config_File := Enclave/Enclave.config.xml
|
||||
Enclave_Config_File := enclave/enclave.config.xml
|
||||
|
||||
ifeq ($(SGX_MODE), HW)
|
||||
ifeq ($(SGX_DEBUG), 1)
|
||||
|
|
@ -200,49 +201,49 @@ endif
|
|||
|
||||
######## App Objects ########
|
||||
|
||||
App/Enclave_u.c: $(SGX_EDGER8R) Enclave/Enclave.edl
|
||||
@cd App && $(SGX_EDGER8R) --untrusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
|
||||
app/enclave_u.c: $(SGX_EDGER8R) enclave/enclave.edl
|
||||
@cd app && $(SGX_EDGER8R) --untrusted ../enclave/enclave.edl --search-path ../enclave --search-path $(SGX_SDK)/include
|
||||
@echo "GEN => $@"
|
||||
|
||||
App/Enclave_u.o: App/Enclave_u.c
|
||||
app/enclave_u.o: app/enclave_u.c
|
||||
@$(CC) $(App_C_Flags) -c $< -o $@
|
||||
@echo "CC <= $<"
|
||||
|
||||
App/%.o: App/%.c
|
||||
@$(CC) $(App_C_Flags) -c $< -o $@
|
||||
app/%.o: app/%.c
|
||||
@$(CC) $(app_C_Flags) -c $< -o $@
|
||||
@echo "CC <= $<"
|
||||
|
||||
$(App_Name): App/Enclave_u.o $(App_C_Objects)
|
||||
$(App_Name): app/enclave_u.o $(App_C_Objects)
|
||||
@$(CC) $^ -o $@ $(App_Link_Flags)
|
||||
@echo "LINK => $@"
|
||||
|
||||
.config_$(Build_Mode)_$(SGX_ARCH):
|
||||
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_C_Objects) App/Enclave_u.* $(Enclave_C_Objects) Enclave/Enclave_t.*
|
||||
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_C_Objects) app/enclave_u.* $(Enclave_C_Objects) enclave/enclave_t.*
|
||||
@touch .config_$(Build_Mode)_$(SGX_ARCH)
|
||||
|
||||
######## Enclave Objects ########
|
||||
|
||||
Enclave/Enclave_t.c: $(SGX_EDGER8R) Enclave/Enclave.edl
|
||||
@cd Enclave && $(SGX_EDGER8R) --trusted ../Enclave/Enclave.edl --search-path ../Enclave --search-path $(SGX_SDK)/include
|
||||
enclave/enclave_t.c: $(SGX_EDGER8R) enclave/enclave.edl
|
||||
@cd enclave && $(SGX_EDGER8R) --trusted ../enclave/enclave.edl --search-path ../enclave --search-path $(SGX_SDK)/include
|
||||
@echo "GEN => $@"
|
||||
|
||||
Enclave/Enclave_t.o: Enclave/Enclave_t.c
|
||||
enclave/enclave_t.o: enclave/enclave_t.c
|
||||
@$(CC) $(Enclave_C_Flags) -c $< -o $@
|
||||
@echo "CC <= $<"
|
||||
|
||||
Enclave/%.o: Enclave/%.c
|
||||
enclave/%.o: enclave/%.c
|
||||
@$(CC) $(Enclave_C_Flags) -c $< -o $@
|
||||
@echo "CC <= $<"
|
||||
|
||||
$(Enclave_Name): Enclave/Enclave_t.o $(Enclave_C_Objects)
|
||||
$(Enclave_Name): enclave/enclave_t.o $(Enclave_C_Objects)
|
||||
@$(CC) $^ -o $@ $(Enclave_Link_Flags)
|
||||
@echo "LINK => $@"
|
||||
|
||||
$(Signed_Enclave_Name): $(Enclave_Name)
|
||||
@$(SGX_ENCLAVE_SIGNER) sign -key Enclave/Enclave_private.pem -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File)
|
||||
@$(SGX_ENCLAVE_SIGNER) sign -key enclave/enclave_private.pem -enclave $(Enclave_Name) -out $@ -config $(Enclave_Config_File)
|
||||
@echo "SIGN => $@"
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
clean:
|
||||
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_C_Objects) App/Enclave_u.* $(Enclave_C_Objects) Enclave/Enclave_t.*
|
||||
@rm -f .config_* $(App_Name) $(Enclave_Name) $(Signed_Enclave_Name) $(App_C_Objects) app/enclave_u.* $(Enclave_C_Objects) enclave/enclave_t.*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue