fixed memory leaks
This commit is contained in:
@@ -422,8 +422,6 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
|
||||
|
||||
use_quote2 = lib->settings->get_bool(lib->settings,
|
||||
"libimcv.plugins.imc-attestation.use_quote2", TRUE);
|
||||
|
||||
/* Quote */
|
||||
if (!pts->quote_tpm(pts, use_quote2, &pcr_composite, "e_sig))
|
||||
{
|
||||
DBG1(DBG_IMC, "error occured during TPM quote operation");
|
||||
@@ -433,7 +431,7 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
|
||||
/* Send Simple Evidence Final attribute */
|
||||
flags = use_quote2 ? PTS_SIMPLE_EVID_FINAL_QUOTE_INFO2 :
|
||||
PTS_SIMPLE_EVID_FINAL_QUOTE_INFO;
|
||||
comp_hash_algorithm == PTS_MEAS_ALGO_SHA1;
|
||||
comp_hash_algorithm = PTS_MEAS_ALGO_SHA1;
|
||||
|
||||
attr = tcg_pts_attr_simple_evid_final_create(flags,
|
||||
comp_hash_algorithm, pcr_composite, quote_sig);
|
||||
|
||||
@@ -318,18 +318,19 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
|
||||
if (!pts->get_quote_info(pts, use_quote2, use_ver_info,
|
||||
comp_hash_algorithm, &pcr_composite, "e_info))
|
||||
{
|
||||
DBG1(DBG_IMV, "unable to compute TPM Quote Info");
|
||||
DBG1(DBG_IMV, "unable to construct TPM Quote Info");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!chunk_equals(pcr_comp, pcr_composite))
|
||||
{
|
||||
DBG1(DBG_IMV, "received and computed PCR Composite match");
|
||||
DBG1(DBG_IMV, "received PCR Composite does not match "
|
||||
"constructed one");
|
||||
free(pcr_composite.ptr);
|
||||
free(quote_info.ptr);
|
||||
return FALSE;
|
||||
}
|
||||
DBG2(DBG_IMV, "received and computed PCR Composite do not match");
|
||||
DBG2(DBG_IMV, "received PCR Composite matches constructed one");
|
||||
free(pcr_composite.ptr);
|
||||
|
||||
if (!pts->verify_quote_signature(pts, quote_info, tpm_quote_sig))
|
||||
|
||||
Reference in New Issue
Block a user