forked from keylime/keylime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tpm_with_ima.sh
executable file
·57 lines (52 loc) · 1.31 KB
/
tpm_with_ima.sh
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
#!/bin/bash
################################################################################
# SPDX-License-Identifier: Apache-2.0
# Copyright 2017 Massachusetts Institute of Technology.
################################################################################
# don't do this every boot
#echo "resetting TPM"
#init_tpm_server
echo "starting TPM emulator"
tpm_serverd
if [[ -n "$(command -v createek)" ]]; then
echo "Touching prerequisite TPM 1.2 binaries"
createek -h
getpubek -h
takeown -h
identity -h
getpubkey -h
listkeys -h
loadkey -h
activateidentity -h
getcapability -h
nv_definespace -h
nv_writevalue -h
nv_readvalue -h
pcrreset -h
extend -h
deepquote -h
tpmquote -h
getrandom -h
flushspecific -h
elif [[ -n "$(command -v tpm2_createek)" ]]; then
echo "Touching prerequisite TPM 2.0 binaries"
tpm2_createek -h
tpm2_readpublic -h
tpm2_changeauth -h
tpm2_createak -h
tpm2_activatecredential -h
tpm2_getcap -h
tpm2_nvdefine
tpm2_nvwrite -h
tpm2_nvread -h
tpm2_pcrreset -h
tpm2_pcrextend -h
tpm2_deluxequote -h
tpm2_getrandom -h
tpm2_evictcontrol -h
tpm2_nvrelease -h
fi
export TPM2TOOLS_TCTI="mssim:port=2321"
echo "starting IMA stub"
pkill -f keylime_ima_emulator
keylime_ima_emulator