PB-TNC Client sends empty CLOSE batch only in DECIDED state

This commit is contained in:
Andreas Steffen
2012-07-11 17:09:05 +02:00
parent a287a3cdcd
commit 1de4af66d5
+16 -3
View File
@@ -609,7 +609,7 @@ METHOD(tls_t, build, status_t,
state = this->state_machine->get_state(this->state_machine);
if (this->is_server && this->fatal_error && state == PB_STATE_END)
if (this->fatal_error && state == PB_STATE_END)
{
DBG1(DBG_TNC, "a fatal PB-TNC error occurred, terminating connection");
return FAILED;
@@ -629,8 +629,9 @@ METHOD(tls_t, build, status_t,
this->request_handshake_retry = FALSE;
}
if (this->batch_type == PB_BATCH_NONE && this->is_server &&
state == PB_STATE_SERVER_WORKING)
if (this->batch_type == PB_BATCH_NONE)
{
if (this->is_server && state == PB_STATE_SERVER_WORKING)
{
if (this->state_machine->get_empty_cdata(this->state_machine) ||
this->recs->have_recommendation(this->recs, NULL, NULL))
@@ -644,6 +645,18 @@ METHOD(tls_t, build, status_t,
this->batch_type = PB_BATCH_SDATA;
}
}
else
{
/**
* In the DECIDED state and if no CRETRY is under way,
* a PB-TNC client replies with an empty CLOSE batch.
*/
if (state == PB_STATE_DECIDED)
{
this->batch_type = PB_BATCH_CLOSE;
}
}
}
if (this->batch_type != PB_BATCH_NONE)
{