imv-attestation: Fixed file hash measurements

The introduction of file versions broke file hash measurements.
This has been fixed by using a generic product versions having an
empty package name.
This commit is contained in:
Andreas Steffen
2017-09-01 10:51:15 +02:00
parent 66805c7b32
commit 076aac7069
9 changed files with 131 additions and 49 deletions
@@ -318,15 +318,24 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg,
enumerator_t *e;
char *filename;
chunk_t measurement;
int vid;
if (!pts_db->get_product_version(pts_db,
pts->get_platform_id(pts), &vid))
{
eval = TNC_IMV_EVALUATION_RESULT_ERROR;
break;
}
e = measurements->create_enumerator(measurements);
while (e->enumerate(e, &filename, &measurement))
{
if (pts_db->add_file_measurement(pts_db,
pts->get_platform_id(pts), algo, measurement,
filename, is_dir, arg_int) != SUCCESS)
if (!pts_db->add_file_measurement(pts_db, vid, algo,
measurement, filename, is_dir, arg_int))
{
eval = TNC_IMV_EVALUATION_RESULT_ERROR;
e->destroy(e);
break;
}
}
e->destroy(e);