forked from openenclave/openenclave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (52 loc) · 2.12 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright (c) Open Enclave SDK contributors.
# Licensed under the MIT License.
.PHONY: all symcrypt build clean run
# set OE_CRYPTO_LIB to either "mbedtls" or "openssl" based on the crypto wrapper to be used.
# OE_CRYPTO_LIB is case sensitive. Use all lowercase letters.
OE_CRYPTO_LIB := mbedtls
export OE_CRYPTO_LIB
TARGETS =
SYMCRYPT_TAR = symcrypt_AMD64_oe_full_v101.3.0-31e06ae.tgz
SYMCRYPT_URL = https://github.com/microsoft/SymCrypt/releases/download/v101.3.0/${SYMCRYPT_TAR}
SYMCRYPT_SHA256 = 53fcbdbae3925b82e880c102969dc4c646b36dffbca602d2f85f967d54e958e7
SYMCRYPT_DIR = SymCrypt
SYMCRYPT_SO = libsymcrypt.so.101.3.0
# The linker can only resolve up to single number after .so
SYMCRYPT_LINK_SO = libsymcrypt.so.101
ifeq (${OE_CRYPTO_LIB}, openssl_symcrypt_fips)
TARGETS += symcrypt
endif
TARGETS += build
all: ${TARGETS}
symcrypt:
wget ${SYMCRYPT_URL}
echo "${SYMCRYPT_SHA256} ${SYMCRYPT_TAR}" | sha256sum --check
mkdir -p ${SYMCRYPT_DIR}
tar zxvf ${SYMCRYPT_TAR} -C ${SYMCRYPT_DIR}
rm ${SYMCRYPT_TAR}
cp ${SYMCRYPT_DIR}/lib/${SYMCRYPT_SO} server/enc/${SYMCRYPT_LINK_SO}
cp ${SYMCRYPT_DIR}/lib/${SYMCRYPT_SO} client/enc/${SYMCRYPT_LINK_SO}
build:
echo ${OE_CRYPTO_LIB}
$(MAKE) -C server
$(MAKE) -C client
$(MAKE) -C non_enc_client
clean:
$(MAKE) -C server clean
$(MAKE) -C client clean
$(MAKE) -C non_enc_client clean
rm -rf ${SYMCRYPT_DIR}
rm -f server/enc/${SYMCRYPT_LINK_SO}
rm -f client/enc/${SYMCRYPT_LINK_SO}
run:
echo "Launch processes to establish an Attested TLS between two enclaves"
./server/host/tls_server_host ./server/enc/tls_server_enc.signed -port:12341 &
sleep 2
./client/host/tls_client_host ./client/enc/tls_client_enc.signed -server:localhost -port:12341
echo "Launch processes to establish an Attested TLS between an non-encalve TLS client and an TLS server running inside an enclave"
./server/host/tls_server_host ./server/enc/tls_server_enc.signed -port:12345 &
sleep 2
./non_enc_client/tls_non_enc_client -server:localhost -port:12345
run-server-in-loop:
echo "Launch long-running Attested TLS server"
./server/host/tls_server_host ./server/enc/tls_server_enc.signed -port:12341 -server-in-loop