diff --git a/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp b/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp index c7e90f3e..9c96428c 100644 --- a/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp +++ b/HIRS_ProvisionerTPM2/src/TPM2_Provisioner.cpp @@ -143,10 +143,16 @@ int provision() { RestfulClientProvisioner provisioner; string response = provisioner.sendIdentityClaim(identityClaim); hirs::pb::IdentityClaimResponse icr; - if (!icr.ParseFromString(response) || !icr.has_credential_blob()) { - cout << "----> Provisioning failed." << endl; - cout << "The ACA did not send make credential information." << endl; - return 0; + + try { + if (response == "" || !icr.has_credential_blob()) { + logger.error("The ACA did not send make credential blob."); + cout << "----> Provisioning failed." << endl; + cout << "The ACA did not send make credential information." << endl; + return 0; + } + } catch (const google::protobuf::FatalException& e) { + logger.error(e.what()); } string nonceBlob = icr.credential_blob();