[Linux-SGX] tools: add building to the parent Makefile

This commit is contained in:
Rafał Wojdyła
2020-04-08 22:15:42 +02:00
parent 0dd84ddf94
commit 113d19c19f
9 changed files with 20 additions and 8 deletions
+1
View File
@@ -15,6 +15,7 @@ RUN apt-get update \
git \
libapr1-dev \
libaprutil1-dev \
libcurl4-openssl-dev \
libexpat1 \
libexpat1-dev \
libnss-mdns \
+1
View File
@@ -14,6 +14,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
libapr1-dev \
libaprutil1-dev \
libcurl4-openssl-dev \
libelf-dev \
libexpat1 \
libexpat1-dev \
+7 -1
View File
@@ -62,7 +62,7 @@ urts-asm-objs = sgx_entry.o
graphene_lib = .lib/graphene-lib.a
.PHONY: all
all: sgx-driver/sgx.h $(host_files)
all: sgx-driver/sgx.h $(host_files) tools
libpal-Linux-SGX.a: $(enclave-objs) $(enclave-asm-objs)
$(call cmd,ar_a_o)
@@ -120,6 +120,10 @@ endif
include ../../../../Scripts/Makefile.rules
.PHONY: tools
tools:
$(MAKE) -C tools
CLEAN_FILES += $(notdir $(pal_static) $(pal_lib) $(pal_loader))
CLEAN_FILES += debugger/sgx_gdb.so
CLEAN_FILES += quote/aesm.pb-c.c quote/aesm.pb-c.h quote/aesm.pb-c.d quote/aesm.pb-c.o
@@ -132,10 +136,12 @@ clean_:
.PHONY: clean
clean: clean_
$(MAKE) -C sgx-driver $@
$(MAKE) -C tools $@
.PHONY: distclean
distclean: clean_
$(MAKE) -C sgx-driver $@
$(MAKE) -C tools $@
.PHONY: test
test:
@@ -0,0 +1,2 @@
/cJSON*
/*.gz
@@ -18,7 +18,6 @@
#include <stdlib.h>
#include <string.h>
#include "api.h"
#include "attestation.h"
#include "cJSON.h"
#include "pal_crypto.h"
@@ -4,9 +4,10 @@ include ../../../../../../Scripts/Makefile.rules
CFLAGS += -I../.. \
-I../common \
-L../common \
-L../../../../../lib/crypto/mbedtls/install/lib \
-D_GNU_SOURCE
LDLIBS += -lsgx_util
LDLIBS += -lsgx_util -lmbedcrypto
PREFIX ?= /usr/local
@@ -88,18 +88,18 @@ int report(struct ias_context_t* ias, const char* quote_path, const char* nonce,
ssize_t quote_size;
quote_data = read_file(quote_path, &quote_size);
if (!quote_data) {
if (!quote_data || quote_size <= 0) {
ERROR("Failed to read quote file '%s'\n", quote_path);
goto out;
}
if (quote_size < sizeof(sgx_quote_t)) {
if ((size_t)quote_size < sizeof(sgx_quote_t)) {
ERROR("Quote is too small\n");
goto out;
}
sgx_quote_t* quote = (sgx_quote_t*)quote_data;
if (quote_size < sizeof(sgx_quote_t) + quote->signature_len) {
if ((size_t)quote_size < sizeof(sgx_quote_t) + quote->signature_len) {
ERROR("Quote is too small\n");
goto out;
}
@@ -4,9 +4,10 @@ include ../../../../../../Scripts/Makefile.rules
CFLAGS += -I../.. \
-I../common \
-L../common \
-L../../../../../lib/crypto/mbedtls/install/lib \
-D_GNU_SOURCE
LDLIBS += -lsgx_util
LDLIBS += -lsgx_util -lmbedcrypto
PREFIX ?= /usr/local
@@ -4,9 +4,10 @@ include ../../../../../../Scripts/Makefile.rules
CFLAGS += -I../.. \
-I../common \
-L../common \
-L../../../../../lib/crypto/mbedtls/install/lib \
-D_GNU_SOURCE
LDLIBS += -lsgx_util
LDLIBS += -lsgx_util -lmbedcrypto
PREFIX ?= /usr/local