[Assignment-7] add simulate.sh
All checks were successful
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (push) Successful in 1m5s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (push) Successful in 1m3s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (push) Successful in 1m2s
Latex Build / build-latex (Assignment 4 - Protokollsicherheit (Praxis)) (pull_request) Successful in 32s
Latex Build / build-latex (Assignment 5 - Software Security - Teil 1) (pull_request) Successful in 9s
Latex Build / build-latex (Assignment 6 - Software Security - Teil 2) (pull_request) Successful in 9s

This commit is contained in:
Paul Zinselmeyer 2024-07-06 18:23:12 +02:00
parent 6f4c0a8aec
commit a43cc4ebce
Signed by: pfzetto
GPG key ID: B471A1AF06C895FD

28
7-SGX_Hands-on/src/simulate.sh Executable file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env sh
set -eu
TMP=/tmp/signatureproxy
KEYDIR=../employee_keys
mkdir -p $TMP
echo "setting up enclave"
./signatureproxy proxysetup -pkey $TMP/proxy_private.bin > $TMP/proxy_public.pem
echo "generating dummy firmware"
dd if=/dev/urandom of=$TMP/firmware.bin bs=1M count=1 &> /dev/null
echo "signing firmware as Alice"
./signatureproxy employee -ekey $KEYDIR/alice_private.pem -firm $TMP/firmware.bin > $TMP/signature_alice.der
echo "resigning firmware using enclave"
cat $TMP/signature_alice.der | ./signatureproxy proxy -pkey $TMP/proxy_private.bin -epub $KEYDIR/alice_public.pem -firm $TMP/firmware.bin > $TMP/signature_for_alice.der
echo "verifying firmware"
cat $TMP/signature_for_alice.der | ./signatureproxy embedded -ppub $TMP/proxy_public.pem -firm $TMP/firmware.bin
echo "signing firmware as Oskar"
./signatureproxy employee -ekey $KEYDIR/oskar_private.pem -firm $TMP/firmware.bin > $TMP/signature_oskar.der
echo "resigning firmware using enclave"
cat $TMP/signature_oskar.der | ./signatureproxy proxy -pkey $TMP/proxy_private.bin -epub $KEYDIR/oskar_public.pem -firm $TMP/firmware.bin || echo "Oskars signing request successfully rejected"