swtpm: deactivate reset establishment

Deactivate the code around resetting the TPM established bit
since its implementation currently requires libtpms 0.6.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
Stefan Berger 2016-03-24 14:33:53 -04:00
parent 03e0099137
commit b5fbddbcf1
2 changed files with 32 additions and 31 deletions

View File

@ -1,4 +1,3 @@
#include <stdio.h>
/*
* ctrlchannel.c -- control channel implementation
*
@ -102,7 +101,7 @@ int ctrlchannel_process_fd(int fd,
ptm_est *te = (ptm_est *)&output.body;
/* Read-write */
ptm_init *init_p;
ptm_reset_est *re;
/* ptm_reset_est *re; */
ptm_getconfig *pgc;
ptm_hdata *data;
@ -134,7 +133,7 @@ int ctrlchannel_process_fd(int fd,
PTM_CAP_SHUTDOWN |
PTM_CAP_STOP |
PTM_CAP_GET_TPMESTABLISHED |
PTM_CAP_RESET_TPMESTABLISHED |
/* PTM_CAP_RESET_TPMESTABLISHED | requires libtpms 0.6 */
PTM_CAP_HASHING |
PTM_CAP_CANCEL_TPM_CMD |
PTM_CAP_STORE_VOLATILE);
@ -202,6 +201,7 @@ int ctrlchannel_process_fd(int fd,
break;
/*
case CMD_RESET_TPMESTABLISHED:
if (!*tpm_running)
goto err_not_running;
@ -220,6 +220,7 @@ int ctrlchannel_process_fd(int fd,
out_len = sizeof(re->u.resp);
break;
*/
case CMD_HASH_START:
if (!*tpm_running)

View File

@ -43,7 +43,7 @@ socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CLIENT:$SOCK_PATH 2>&1 | \
sed -n '/^ /p' | \
tail -n1 > $RESP_PATH
res="$(cat $RESP_PATH)"
exp=" 00 00 00 00 00 00 04 f7"
exp=" 00 00 00 00 00 00 04 77"
if [ "$res" != "$exp" ]; then
echo "Error: Unexpected response from CMD_GET_CAPABILITY:"
echo " actual : $res"
@ -180,7 +180,7 @@ socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CLIENT:$SOCK_PATH 2>&1 | \
sed -n '/^ /p' | \
tail -n1 > $RESP_PATH
res="$(cat $RESP_PATH)"
exp=" 00 00 00 00 00 00 04 f7"
exp=" 00 00 00 00 00 00 04 77"
if [ "$res" != "$exp" ]; then
echo "Error: Socket TPM: Unexpected response from CMD_GET_CAPABILITY:"
echo " actual : $res"
@ -323,34 +323,34 @@ if [ "$res" != "$exp" ]; then
fi
# 5. Send command to reset TPM established flag: CMD_RESET_TPMESTABLISHED = 00 00 00 0b 03
echo -en '\x00\x00\x00\x0b\x03' > $CMD_PATH
cat $RESP_PATH
socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CONNECT:$SOCK_PATH 2>&1 | \
sed -n '/^ /p' | \
tail -n1 > $RESP_PATH
res="$(cat $RESP_PATH)"
exp=" 00 00 00 00"
if [ "$res" != "$exp" ]; then
echo "Error: Socket TPM: Unexpected response from sending CMD_GET_TPMESTABLISHED command:"
echo " actual : $res"
echo " expected: $exp"
exit 1
fi
#echo -en '\x00\x00\x00\x0b\x03' > $CMD_PATH
#cat $RESP_PATH
#socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CONNECT:$SOCK_PATH 2>&1 | \
# sed -n '/^ /p' | \
# tail -n1 > $RESP_PATH
#res="$(cat $RESP_PATH)"
#exp=" 00 00 00 00"
#if [ "$res" != "$exp" ]; then
# echo "Error: Socket TPM: Unexpected response from sending CMD_GET_TPMESTABLISHED command:"
# echo " actual : $res"
# echo " expected: $exp"
# exit 1
#fi
# 6. Send command to get TPM established flag: CMD_GET_TPMESTABLISHED = 00 00 00 04
echo -en '\x00\x00\x00\x04' > $CMD_PATH
cat $RESP_PATH
socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CONNECT:$SOCK_PATH 2>&1 | \
sed -n '/^ /p' | \
tail -n1 > $RESP_PATH
res="$(cat $RESP_PATH)"
exp=" 00 00 00 00 00 00 00 00"
if [ "$res" != "$exp" ]; then
echo "Error: Socket TPM: Unexpected response from sending CMD_GET_TPMESTABLISHED command:"
echo " actual : $res"
echo " expected: $exp"
exit 1
fi
#echo -en '\x00\x00\x00\x04' > $CMD_PATH
#cat $RESP_PATH
#socat -x -t10 FILE:$CMD_PATH,rdonly UNIX-CONNECT:$SOCK_PATH 2>&1 | \
# sed -n '/^ /p' | \
# tail -n1 > $RESP_PATH
#res="$(cat $RESP_PATH)"
#exp=" 00 00 00 00 00 00 00 00"
#if [ "$res" != "$exp" ]; then
# echo "Error: Socket TPM: Unexpected response from sending CMD_GET_TPMESTABLISHED command:"
# echo " actual : $res"
# echo " expected: $exp"
# exit 1
#fi
# Read PCR 17
exec 100<>/dev/tcp/localhost/65530