This repository has been archived by the owner on Jan 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
/
run.in
executable file
·135 lines (105 loc) · 3.09 KB
/
run.in
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#! /bin/bash
#----------------------------------------------------------------------------
# Get our program name
#----------------------------------------------------------------------------
PROG=`basename $0`
#----------------------------------------------------------------------------
# Environment setup.
#----------------------------------------------------------------------------
# Where is OpenSSL 1.1.x?
OPENSSL_LIBDIR=@OPENSSL_LIBDIR@
if [ "$OPENSSL_LIBDIR" != "" ]
then
if [ "$LD_LIBRARY_PATH" = "" ]
then
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR
else
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR:$LD_LIBRARY_PATH
fi
fi
# Do we need to add curl's libdir?
CURL_LIBDIR=@CURL_LIBDIR@
if [ "$CURL_LIBDIR" != "" ]
then
if [ "$LD_LIBRARY_PATH" = "" ]
then
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR
else
export LD_LIBRARY_PATH=$OPENSSL_LIBDIR:$LD_LIBRARY_PATH
fi
fi
#----------------------------------------------------------------------------
# Parse our settings file
#----------------------------------------------------------------------------
. ./settings
. ./policy
# Optional settings
if [ "$QUERY_IAS_PRODUCTION" != "" -a "0$QUERY_IAS_PRODUCTION" -ne 0 ]; then
sp_production=-P
fi
if [ "$LINKABLE" != "" -a "0$LINKABLE" -ne 0 ]; then
flag_linkable=-l
fi
# Optional client settings
if [ "$RANDOM_NONCE" != "" -a "0$RANDOM_NONCE" -ne 0 ]; then
cl_nonce=-r
fi
if [ "$USE_PLATFORM_SERVICES" != "" -a "0$USE_PLATFORM_SERVICES" -ne 0 ]; then
cl_pse=-m
fi
# Optional service provider/server settings
if [ "$IAS_CLIENT_KEY_FILE" != "" ]; then
sp_cert_key="--ias-cert-key=$IAS_CLIENT_KEY_FILE"
fi
if [ "$IAS_CLIENT_CERT_KEY_PASSWORD_FILE" != "" ]; then
sp_cert_passwd="--ias-cert-passwd=$IAS_CLIENT_CERT_KEY_PASSWORD_FILE"
fi
if [ "$IAS_CLIENT_CERT_TYPE" != "" ]; then
sp_cert_type="--ias-cert-type=$IAS_CLIENT_CERT_TYPE"
fi
if [ "$IAS_DISABLE_PROXY" != "" -a "0$IAS_DISABLE_PROXY" -ne 0 ]; then
sp_noproxy="-x"
elif [ "$IAS_PROXY_URL" != "" ]; then
sp_proxy="--proxy=$IAS_PROXY_URL"
fi
if [ "$POLICY_STRICT_TRUST" != "" -a "0$POLICY_STRICT_TRUST" -ne 0 ]; then
sp_strict_trust="-X"
fi
if [ "$ALLOW_DEBUG_ENCLAVE" != "" -a "0$ALLOW_DEBUG_ENCLAVE" -eq 0 ]; then
flag_no_debug_enclave=-D
fi
# Debugging options
if [ "$VERBOSE" != "" -a "0$VERBOSE" -ne 0 ]; then
flag_verbose=-v
fi
if [ "$DEBUG" != "" -a "0$DEBUG" -ne 0 ]; then
flag_debug=-d
fi
#----------------------------------------------------------------------------
# Execute
#----------------------------------------------------------------------------
if [ "$PROG" = "run-client" ]
then
./client \
-s $SPID \
$cl_nonce $cl_pse \
$flag_linkable $flag_debug $flag_verbose \
"$@"
elif [ "$PROG" = "run-server" ]
then
./sp \
-s $SPID \
-i $IAS_PRIMARY_SUBSCRIPTION_KEY \
-j $IAS_SECONDARY_SUBSCRIPTION_KEY \
-A "$IAS_REPORT_SIGNING_CA_FILE" \
-N $MRSIGNER \
-V $MIN_ISVSVN \
-R $PRODID \
$sp_noproxy $sp_proxy \
$flag_linkable $sp_strict_trust $flag_debug $flag_verbose \
$sp_production $flag_no_debug_enclave \
"$@"
else
echo "$PROG: unrecognized instance (expected run-client or run-server)" >&2
exit 1
fi