Do PTS measurements only if session initialisation was successful
This commit is contained in:
@@ -345,15 +345,14 @@ METHOD(imv_agent_if_t, batch_ending, TNC_Result,
|
|||||||
state->set_action_flags(state, IMV_ATTESTATION_FLAG_ATTR_REQ);
|
state->set_action_flags(state, IMV_ATTESTATION_FLAG_ATTR_REQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create an empty out message - we might need it */
|
|
||||||
out_msg = imv_msg_create(this->agent, state, id, imv_id, TNC_IMCID_ANY,
|
|
||||||
msg_types[0]);
|
|
||||||
|
|
||||||
if (handshake_state == IMV_ATTESTATION_STATE_INIT)
|
if (handshake_state == IMV_ATTESTATION_STATE_INIT)
|
||||||
{
|
{
|
||||||
pa_tnc_attr_t *attr;
|
pa_tnc_attr_t *attr;
|
||||||
pts_proto_caps_flag_t flags;
|
pts_proto_caps_flag_t flags;
|
||||||
|
|
||||||
|
out_msg = imv_msg_create(this->agent, state, id, imv_id, TNC_IMCID_ANY,
|
||||||
|
msg_types[0]);
|
||||||
|
|
||||||
/* Send Request Protocol Capabilities attribute */
|
/* Send Request Protocol Capabilities attribute */
|
||||||
flags = pts->get_proto_caps(pts);
|
flags = pts->get_proto_caps(pts);
|
||||||
attr = tcg_pts_attr_proto_caps_create(flags, TRUE);
|
attr = tcg_pts_attr_proto_caps_create(flags, TRUE);
|
||||||
@@ -367,11 +366,27 @@ METHOD(imv_agent_if_t, batch_ending, TNC_Result,
|
|||||||
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
IMV_ATTESTATION_STATE_DISCOVERY);
|
IMV_ATTESTATION_STATE_DISCOVERY);
|
||||||
|
|
||||||
|
/* send these initial PTS attributes and exit */
|
||||||
|
result = out_msg->send(out_msg, FALSE);
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (platform_info && session &&
|
/* exit if we are not ready yet for PTS measurements */
|
||||||
(state->get_action_flags(state) & IMV_ATTESTATION_FLAG_ALGO) &&
|
if (!platform_info || !session ||
|
||||||
!(state->get_action_flags(state) & IMV_ATTESTATION_FLAG_FILE_MEAS))
|
!(state->get_action_flags(state) & IMV_ATTESTATION_FLAG_ALGO))
|
||||||
|
{
|
||||||
|
return TNC_RESULT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create an empty out message - we might need it */
|
||||||
|
out_msg = imv_msg_create(this->agent, state, id, imv_id, TNC_IMCID_ANY,
|
||||||
|
msg_types[0]);
|
||||||
|
|
||||||
|
/* establish the PTS measurements to be taken */
|
||||||
|
if (!(state->get_action_flags(state) & IMV_ATTESTATION_FLAG_FILE_MEAS))
|
||||||
{
|
{
|
||||||
bool is_dir, no_workitems = TRUE;
|
bool is_dir, no_workitems = TRUE;
|
||||||
u_int32_t delimiter = SOLIDUS_UTF;
|
u_int32_t delimiter = SOLIDUS_UTF;
|
||||||
|
|||||||
Reference in New Issue
Block a user