From 40e744690b3d4bf72b2fb2eedc303afaa6655c27 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Wed, 25 Nov 2020 08:23:02 -0500 Subject: [PATCH] The 3 files the provisioner uploads to the ACA are system flat files. If the first or second one dosn't exist or cause an exception to be thrown, the rest aren't executed. This change separates the try catch statements so that each one is executed independently of the previous ones' error. --- HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp b/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp index f280c924..f30d6588 100644 --- a/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp +++ b/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp @@ -74,7 +74,15 @@ int provision() { const std::string& swid_file = props.get("tcg.swidtag.file", ""); try { dv.set_logfile(hirs::file_utils::fileToString(rim_file)); + } catch (HirsRuntimeException& hirsRuntimeException) { + logger.error(hirsRuntimeException.what()); + } + try { dv.set_swidfile(hirs::file_utils::fileToString(swid_file)); + } catch (HirsRuntimeException& hirsRuntimeException) { + logger.error(hirsRuntimeException.what()); + } + try { dv.set_livelog(hirs::file_utils::fileToString( "/sys/kernel/security/tpm0/binary_bios_measurements")); } catch (HirsRuntimeException& hirsRuntimeException) {