From 3ca520fd1c66d1aca82ea22f61599395273cb4b5 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Mon, 13 Nov 2017 20:44:06 -0500 Subject: [PATCH] swtpm_ioctl: print error message in case setting state blob fails Signed-off-by: Stefan Berger --- src/swtpm_ioctl/tpm_ioctl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/swtpm_ioctl/tpm_ioctl.c b/src/swtpm_ioctl/tpm_ioctl.c index a6990b4..b2fbab8 100644 --- a/src/swtpm_ioctl/tpm_ioctl.c +++ b/src/swtpm_ioctl/tpm_ioctl.c @@ -574,6 +574,13 @@ static int do_load_state_blob(int fd, bool is_chardev, const char *blobtype, goto cleanup; } res = devtoh32(is_chardev, pss.u.resp.tpm_result); + if (res != 0) { + fprintf(stderr, + "TPM result from PTM_SET_STATEBLOB: 0x%x\n", + res); + had_error = 1; + goto cleanup; + } break; }