else
{
/* TODO generate an error message */
+ selected_algorithm = PTS_MEAS_ALGO_SHA256;
}
+ DBG2(DBG_IMC, "selected PTS measurement algorithm is %N",
+ hash_algorithm_names,
+ pts_meas_to_hash_algorithm(selected_algorithm));
+
attestation_state->set_handshake_state(attestation_state,
IMC_ATTESTATION_STATE_REQ_MEAS_ALGO);
break;
}
case TCG_PTS_MEAS_ALGO_SELECTION:
{
- tcg_pts_attr_meas_algo_t *attr_meas_algo_selection;
+ tcg_pts_attr_meas_algo_t *attr_meas;
pts_meas_algorithms_t selected_algorithm;
+ hash_algorithm_t hash_alg;
- attr_meas_algo_selection = (tcg_pts_attr_meas_algo_t*)attr;
- selected_algorithm = attr_meas_algo_selection->get_algorithms(attr_meas_algo_selection);
+ attr_meas = (tcg_pts_attr_meas_algo_t*)attr;
+ selected_algorithm = attr_meas->get_algorithms(attr_meas);
+ hash_alg = pts_meas_to_hash_algorithm(selected_algorithm);
+ if (hash_alg == HASH_UNKNOWN)
+ {
+ /* TODO generate an error message */
+ break;
+ }
+ DBG2(DBG_IMV, "selected PTS measurement algorithm is %N",
+ hash_algorithm_names, hash_alg);
/* TODO: What to do with the selected algorithm from imc */
attestation_state->set_handshake_state(attestation_state,
}
attestation_state = (imv_attestation_state_t*)state;
- /* Check if IMV has to initiate the IF-M exchange */
+ /* Check if IMV has to initiate the PA-TNC exchange */
if (attestation_state->get_handshake_state(attestation_state) ==
IMV_ATTESTATION_STATE_INIT)
{