buffer PA-TNC attributes until Generate Attestation Evidence attribute is received
This commit is contained in:
@@ -394,14 +394,15 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
|
||||
{
|
||||
break;
|
||||
}
|
||||
attestation_state->add_evidence(attestation_state, evid);
|
||||
if (measurements)
|
||||
{
|
||||
DBG2(DBG_IMC, "collected %d file measurements",
|
||||
measurements->get_file_count(measurements));
|
||||
attr = tcg_pts_attr_file_meas_create(measurements);
|
||||
attr_list->insert_last(attr_list, attr);
|
||||
attestation_state->add_attr(attestation_state, attr);
|
||||
}
|
||||
attr = tcg_pts_attr_simple_comp_evid_create(evid);
|
||||
attestation_state->add_attr(attestation_state, attr);
|
||||
}
|
||||
while (status == NEED_MORE);
|
||||
comp->destroy(comp);
|
||||
@@ -413,14 +414,12 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
|
||||
{
|
||||
pts_simple_evid_final_flag_t flags;
|
||||
pts_meas_algorithms_t comp_hash_algorithm;
|
||||
pts_comp_evidence_t *evid;
|
||||
chunk_t pcr_composite, quote_sig;
|
||||
bool use_quote2;
|
||||
|
||||
/* Send buffered Simple Component Evidences */
|
||||
while (attestation_state->next_evidence(attestation_state, &evid))
|
||||
/* Send buffered PA-TNC attributes */
|
||||
while (attestation_state->next_attr(attestation_state, &attr))
|
||||
{
|
||||
attr = tcg_pts_attr_simple_comp_evid_create(evid);
|
||||
attr_list->insert_last(attr_list, attr);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ struct private_imc_attestation_state_t {
|
||||
pts_t *pts;
|
||||
|
||||
/**
|
||||
* PTS Component Evidence list
|
||||
* PA-TNC attribute cache list
|
||||
*/
|
||||
linked_list_t *list;
|
||||
|
||||
@@ -125,16 +125,16 @@ METHOD(imc_attestation_state_t, get_pts, pts_t*,
|
||||
return this->pts;
|
||||
}
|
||||
|
||||
METHOD(imc_attestation_state_t, add_evidence, void,
|
||||
private_imc_attestation_state_t *this, pts_comp_evidence_t *evidence)
|
||||
METHOD(imc_attestation_state_t, add_attr, void,
|
||||
private_imc_attestation_state_t *this, pa_tnc_attr_t *attr)
|
||||
{
|
||||
this->list->insert_last(this->list, evidence);
|
||||
this->list->insert_last(this->list, attr);
|
||||
}
|
||||
|
||||
METHOD(imc_attestation_state_t, next_evidence, bool,
|
||||
private_imc_attestation_state_t *this, pts_comp_evidence_t **evid)
|
||||
METHOD(imc_attestation_state_t, next_attr, bool,
|
||||
private_imc_attestation_state_t *this, pa_tnc_attr_t **attr)
|
||||
{
|
||||
return this->list->remove_first(this->list, (void**)evid) == SUCCESS;
|
||||
return this->list->remove_first(this->list, (void**)attr) == SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -158,8 +158,8 @@ imc_state_t *imc_attestation_state_create(TNC_ConnectionID connection_id)
|
||||
.destroy = _destroy,
|
||||
},
|
||||
.get_pts = _get_pts,
|
||||
.add_evidence = _add_evidence,
|
||||
.next_evidence = _next_evidence,
|
||||
.add_attr = _add_attr,
|
||||
.next_attr = _next_attr,
|
||||
},
|
||||
.connection_id = connection_id,
|
||||
.state = TNC_CONNECTION_STATE_CREATE,
|
||||
|
||||
@@ -47,19 +47,19 @@ struct imc_attestation_state_t {
|
||||
pts_t* (*get_pts)(imc_attestation_state_t *this);
|
||||
|
||||
/**
|
||||
* Add an entry to the Component Evidence list
|
||||
* Add an entry to the PA-TNC attribute cache list
|
||||
*
|
||||
* @param entry Component Evidence entry
|
||||
* @param attr PA-TNC attribute entry
|
||||
*/
|
||||
void (*add_evidence)(imc_attestation_state_t *this, pts_comp_evidence_t *entry);
|
||||
void (*add_attr)(imc_attestation_state_t *this, pa_tnc_attr_t *attr);
|
||||
|
||||
/**
|
||||
* Removes next Component Evidence entry from list and returns it
|
||||
* Removes next entry from the PA-TNC attribute cash list and returns it
|
||||
*
|
||||
* @param evid Next Component Evidence entry
|
||||
* @param attr Next PA-TNC attribute entry
|
||||
* @return TRUE if next entry is available
|
||||
*/
|
||||
bool (*next_evidence)(imc_attestation_state_t *this, pts_comp_evidence_t** evid);
|
||||
bool (*next_attr)(imc_attestation_state_t *this, pa_tnc_attr_t** attr);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user