Added Check_Measurement function to pts_database instead of returning enumerator over hashes

List of requested files/directories are kept within imv state now
Allocated memory for entries in files_in_dir_with_meas list
This commit is contained in:
Sansar Choinyambuu
2011-09-08 12:17:08 +02:00
committed by Andreas Steffen
parent e9fd8b4b7b
commit af275f3fdb
@@ -275,7 +275,6 @@ static TNC_Result send_message(TNC_ConnectionID connection_id)
{ {
break; break;
} }
while (enumerator->enumerate(enumerator, &id, &type, &pathname)) while (enumerator->enumerate(enumerator, &id, &type, &pathname))
{ {
is_directory = (type != 0); is_directory = (type != 0);
@@ -285,8 +284,7 @@ static TNC_Result send_message(TNC_ConnectionID connection_id)
delimiter, pathname); delimiter, pathname);
attr->set_noskip_flag(attr, TRUE); attr->set_noskip_flag(attr, TRUE);
msg->add_attribute(msg, attr); msg->add_attribute(msg, attr);
attestation_state->add_requested_file(attestation_state, id , type);
attestation_state->add_requested_file(attestation_state, id, type);
} }
enumerator->destroy(enumerator); enumerator->destroy(enumerator);
@@ -313,15 +311,6 @@ static TNC_Result send_message(TNC_ConnectionID connection_id)
return result; return result;
} }
/**
* String matching function with boolean return value
* Used to remove an item from linked list of strings
*/
static bool string_cmp(char *a, char *b)
{
return (strcmp(a,b) == 0) ? TRUE : FALSE;
}
/** /**
* see section 3.7.3 of TCG TNC IF-IMV Specification 1.2 * see section 3.7.3 of TCG TNC IF-IMV Specification 1.2
*/ */
@@ -578,7 +567,6 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
files_in_dir_with_meas->destroy_function(files_in_dir_with_meas, free); files_in_dir_with_meas->destroy_function(files_in_dir_with_meas, free);
e_meas->destroy(e_meas); e_meas->destroy(e_meas);
break; break;
} }
@@ -632,13 +620,15 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
{ {
if (measurement_error || attestation_state->get_requests_count(attestation_state)) if (measurement_error || attestation_state->get_requests_count(attestation_state))
{ {
file_request_t *entry;
enumerator_t *e; enumerator_t *e;
int request; int request;
e = attestation_state->create_requests_enumerator(attestation_state); e = attestation_state->create_requests_enumerator(attestation_state);
while (e->enumerate(e, &request)) while (e->enumerate(e, &request))
{ {
DBG1(DBG_IMV, "measurement/s not received for requests: %d", request); DBG1(DBG_IMV, "%s measurement not received for request: %d",
(entry->is_dir) ? "Directory" : "File", entry->request_id);
} }
e->destroy(e); e->destroy(e);