From cf47149f885e8cdfff35fd3bb70bde2d4217877b Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Mon, 13 Nov 2017 19:34:00 -0500 Subject: [PATCH] swtpm: log when the decryption of the NVRAM file fails Signed-off-by: Stefan Berger --- src/swtpm/swtpm_nvfile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/swtpm/swtpm_nvfile.c b/src/swtpm/swtpm_nvfile.c index c185371..48982f8 100644 --- a/src/swtpm/swtpm_nvfile.c +++ b/src/swtpm/swtpm_nvfile.c @@ -316,6 +316,11 @@ SWTPM_NVRAM_LoadData_Intern(unsigned char **data, /* freed by caller */ *data, *length); TPM_DEBUG(" SWTPM_NVRAM_LoadData: SWTPM_NVRAM_DecryptData rc = %d\n", rc); + if (rc != 0) + logprintf(STDERR_FILENO, + "SWTPM_NVRAM_LoadData: Decrypting the NVRAM data " + "failed rc = %d\n", rc); + if (rc == 0) { if (decrypt_data) { TPM_DEBUG(" SWTPM_NVRAM_LoadData: Decrypted %u bytes of "