get rid of intermediate handshake_state variable
This commit is contained in:
@@ -464,7 +464,6 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
pa_tnc_attr_t *attr;
|
pa_tnc_attr_t *attr;
|
||||||
imc_state_t *state;
|
imc_state_t *state;
|
||||||
imc_attestation_state_t *attestation_state;
|
imc_attestation_state_t *attestation_state;
|
||||||
imc_attestation_handshake_state_t handshake_state;
|
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
TNC_Result result;
|
TNC_Result result;
|
||||||
bool fatal_error = FALSE;
|
bool fatal_error = FALSE;
|
||||||
@@ -541,9 +540,8 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
attr_req_proto_caps = (tcg_pts_attr_proto_caps_t*)attr;
|
attr_req_proto_caps = (tcg_pts_attr_proto_caps_t*)attr;
|
||||||
proto_caps = attr_req_proto_caps->get_flags(attr_req_proto_caps);
|
proto_caps = attr_req_proto_caps->get_flags(attr_req_proto_caps);
|
||||||
|
|
||||||
handshake_state = IMC_ATTESTATION_STATE_REQ_PROTO_CAP;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMC_ATTESTATION_STATE_REQ_PROTO_CAP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_PTS_MEAS_ALGO:
|
case TCG_PTS_MEAS_ALGO:
|
||||||
@@ -570,25 +568,21 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
{
|
{
|
||||||
/* TODO generate an error message */
|
/* TODO generate an error message */
|
||||||
}
|
}
|
||||||
|
|
||||||
handshake_state = IMC_ATTESTATION_STATE_REQ_MEAS_ALGO;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMC_ATTESTATION_STATE_REQ_MEAS_ALGO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case TCG_PTS_GET_TPM_VERSION_INFO:
|
case TCG_PTS_GET_TPM_VERSION_INFO:
|
||||||
{
|
{
|
||||||
handshake_state = IMC_ATTESTATION_STATE_GET_TPM_INFO;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMC_ATTESTATION_STATE_GET_TPM_INFO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_PTS_GET_AIK:
|
case TCG_PTS_GET_AIK:
|
||||||
{
|
{
|
||||||
handshake_state = IMC_ATTESTATION_STATE_GET_AIK;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMC_ATTESTATION_STATE_GET_AIK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,9 +609,8 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
directory_list->insert_last(directory_list, entry) :
|
directory_list->insert_last(directory_list, entry) :
|
||||||
file_list->insert_last(file_list, entry);
|
file_list->insert_last(file_list, entry);
|
||||||
|
|
||||||
handshake_state = IMC_ATTESTATION_STATE_REQ_FILE_MEAS;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMC_ATTESTATION_STATE_REQ_FILE_MEAS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,6 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
|||||||
pa_tnc_attr_t *attr;
|
pa_tnc_attr_t *attr;
|
||||||
imv_state_t *state;
|
imv_state_t *state;
|
||||||
imv_attestation_state_t *attestation_state;
|
imv_attestation_state_t *attestation_state;
|
||||||
imv_attestation_handshake_state_t handshake_state;
|
|
||||||
enumerator_t *enumerator;
|
enumerator_t *enumerator;
|
||||||
TNC_Result result;
|
TNC_Result result;
|
||||||
bool fatal_error = FALSE;
|
bool fatal_error = FALSE;
|
||||||
@@ -427,9 +426,8 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
|||||||
attr_proto_caps = (tcg_pts_attr_proto_caps_t*)attr;
|
attr_proto_caps = (tcg_pts_attr_proto_caps_t*)attr;
|
||||||
proto_caps = attr_proto_caps->get_flags(attr_proto_caps);
|
proto_caps = attr_proto_caps->get_flags(attr_proto_caps);
|
||||||
/* TODO: What to do with the protocol capabilities from imc */
|
/* TODO: What to do with the protocol capabilities from imc */
|
||||||
handshake_state = IMV_ATTESTATION_STATE_PROTO_CAP;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMV_ATTESTATION_STATE_PROTO_CAP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_PTS_MEAS_ALGO_SELECTION:
|
case TCG_PTS_MEAS_ALGO_SELECTION:
|
||||||
@@ -441,9 +439,8 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
|||||||
selected_algorithm = attr_meas_algo_selection->get_algorithms(attr_meas_algo_selection);
|
selected_algorithm = attr_meas_algo_selection->get_algorithms(attr_meas_algo_selection);
|
||||||
/* TODO: What to do with the selected algorithm from imc */
|
/* TODO: What to do with the selected algorithm from imc */
|
||||||
|
|
||||||
handshake_state = IMV_ATTESTATION_STATE_MEAS_ALGO;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMV_ATTESTATION_STATE_MEAS_ALGO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_PTS_TPM_VERSION_INFO:
|
case TCG_PTS_TPM_VERSION_INFO:
|
||||||
@@ -473,17 +470,15 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
|||||||
versionInfo.tpmVendorID[0], versionInfo.tpmVendorID[1],
|
versionInfo.tpmVendorID[0], versionInfo.tpmVendorID[1],
|
||||||
versionInfo.tpmVendorID[2], versionInfo.tpmVendorID[3]);
|
versionInfo.tpmVendorID[2], versionInfo.tpmVendorID[3]);
|
||||||
|
|
||||||
handshake_state = IMV_ATTESTATION_STATE_TPM_INFO;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMV_ATTESTATION_STATE_TPM_INFO);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_PTS_AIK:
|
case TCG_PTS_AIK:
|
||||||
{
|
{
|
||||||
/* TODO: Save the AIK key and certificate */
|
/* TODO: Save the AIK key and certificate */
|
||||||
handshake_state = IMV_ATTESTATION_STATE_AIK;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMV_ATTESTATION_STATE_AIK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -506,9 +501,8 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
|||||||
|
|
||||||
/* TODO: Start working here */
|
/* TODO: Start working here */
|
||||||
|
|
||||||
handshake_state = IMV_ATTESTATION_STATE_FILE_MEAS;
|
|
||||||
attestation_state->set_handshake_state(attestation_state,
|
attestation_state->set_handshake_state(attestation_state,
|
||||||
handshake_state);
|
IMV_ATTESTATION_STATE_FILE_MEAS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user