-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.93 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
SERVER_SANDBOX = msg_server_sandbox
SERVER_SANDBOX_CERTS = $(SERVER_SANDBOX)/certs
SERVER_SANDBOX_PRIVATE = $(SERVER_SANDBOX)/private
SERVER_SANDBOX_HASHED_PW = $(SERVER_SANDBOX)/hashed_pw
SERVER_SANDBOX_USERS = $(SERVER_SANDBOX)/users
install: sandbox_build four random_sends
server:
rm -rf $(SERVER_SANDBOX)
mkdir -p $(SERVER_SANDBOX)
mkdir -p $(SERVER_SANDBOX_CERTS)
mkdir -p $(SERVER_SANDBOX_CERTS)/users
mkdir -p $(SERVER_SANDBOX_PRIVATE)
mkdir -p $(SERVER_SANDBOX_HASHED_PW)
mkdir -p $(SERVER_SANDBOX_USERS)
g++ -o server.out server.cpp my.cpp -lssl -lcrypto -lcrypt
cp server.out $(SERVER_SANDBOX)
cp certs/container/intermediate_ca/certs/msg_server.cert.pem $(SERVER_SANDBOX_CERTS)/msg_server.cert.pem
cp certs/container/intermediate_ca/certs/ca-chain.cert.pem $(SERVER_SANDBOX_CERTS)/ca-chain.cert.pem
cp certs/container/intermediate_ca/private/msg_server.key.pem $(SERVER_SANDBOX_PRIVATE)/msg_server.key.pem
cp certs/container/intermediate_ca/certs/intermediate_ca.cert.pem $(SERVER_SANDBOX_CERTS)/intermediate_ca.cert.pem
cp certs/container/intermediate_ca/private/intermediate_ca.key.pem $(SERVER_SANDBOX_PRIVATE)/intermediate_ca.key.pem
cp users/hashed_pw/* $(SERVER_SANDBOX_HASHED_PW)
cp -r users/users/* $(SERVER_SANDBOX_USERS)
four: getcert changepw sendmsg recvmsg
getcert:
g++ -o getcert.out getcert.cpp client.cpp my.cpp -lssl -lcrypto
changepw:
g++ -o changepw.out changepw.cpp client.cpp my.cpp -lssl -lcrypto
sendmsg:
g++ -o sendmsg.out sendmsg.cpp client.cpp cms.cpp my.cpp -lssl -lcrypto
recvmsg:
g++ -o recvmsg.out recvmsg.cpp client.cpp cms.cpp my.cpp -lssl -lcrypto
cms:
g++ -o cms.out cms.cpp -lssl -lcrypto
random_sends:
g++ -o random_sends.out random_sends.cpp my.cpp -lssl -lcrypto
sandbox_build:
python3 users/gen.py
sudo docker build -t yz3645/sandbox:0.1 .
sandbox_run:
sudo docker run -p 4399:4399 --rm -ti yz3645/sandbox:0.1
clean:
rm -rf *.out
rm -rf $(SERVER_SANDBOX)
rm -rf *.txt
rm -rf *.pem