moved TSS into pts object

This commit is contained in:
Andreas Steffen
2011-09-08 12:08:12 +02:00
parent 48f04107ea
commit 8a2482c7c2
11 changed files with 287 additions and 87 deletions
@@ -44,6 +44,11 @@ struct private_imc_attestation_state_t {
*/
imc_attestation_handshake_state_t handshake_state;
/**
* PTS object
*/
pts_t *pts;
};
METHOD(imc_state_t, get_connection_id, TNC_ConnectionID,
@@ -61,6 +66,7 @@ METHOD(imc_state_t, change_state, void,
METHOD(imc_state_t, destroy, void,
private_imc_attestation_state_t *this)
{
this->pts->destroy(this->pts);
free(this);
}
@@ -71,11 +77,18 @@ METHOD(imc_attestation_state_t, get_handshake_state, imc_attestation_handshake_s
}
METHOD(imc_attestation_state_t, set_handshake_state, void,
private_imc_attestation_state_t *this, imc_attestation_handshake_state_t new_state)
private_imc_attestation_state_t *this,
imc_attestation_handshake_state_t new_state)
{
this->handshake_state = new_state;
}
METHOD(imc_attestation_state_t, get_pts, pts_t*,
private_imc_attestation_state_t *this)
{
return this->pts;
}
/**
* Described in header.
*/
@@ -92,10 +105,12 @@ imc_state_t *imc_attestation_state_create(TNC_ConnectionID connection_id)
},
.get_handshake_state = _get_handshake_state,
.set_handshake_state = _set_handshake_state,
.get_pts = _get_pts,
},
.state = TNC_CONNECTION_STATE_CREATE,
.connection_id = connection_id,
.state = TNC_CONNECTION_STATE_CREATE,
.handshake_state = IMC_ATTESTATION_STATE_INIT,
.pts = pts_create(),
);
return &this->public.interface;