Added out message queue for imv_msg receive method
This commit is contained in:
@@ -435,7 +435,7 @@ METHOD(imc_msg_t, receive, TNC_Result,
|
|||||||
if (!contract)
|
if (!contract)
|
||||||
{
|
{
|
||||||
/* TODO no contract - generate error message */
|
/* TODO no contract - generate error message */
|
||||||
DBG2(DBG_IMC, "no contract for received next segment "
|
DBG1(DBG_IMC, "no contract for received next segment "
|
||||||
"request with base attribute ID %u", base_attr_id);
|
"request with base attribute ID %u", base_attr_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ METHOD(imv_msg_t, send_assessment, TNC_Result,
|
|||||||
}
|
}
|
||||||
|
|
||||||
METHOD(imv_msg_t, receive, TNC_Result,
|
METHOD(imv_msg_t, receive, TNC_Result,
|
||||||
private_imv_msg_t *this, bool *fatal_error)
|
private_imv_msg_t *this, imv_msg_t *out_msg, bool *fatal_error)
|
||||||
{
|
{
|
||||||
TNC_Result result = TNC_RESULT_SUCCESS;
|
TNC_Result result = TNC_RESULT_SUCCESS;
|
||||||
linked_list_t *non_fatal_types;
|
linked_list_t *non_fatal_types;
|
||||||
@@ -310,25 +310,13 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
break;
|
break;
|
||||||
case VERIFY_ERROR:
|
case VERIFY_ERROR:
|
||||||
{
|
{
|
||||||
imv_msg_t *error_msg;
|
|
||||||
|
|
||||||
error_msg = imv_msg_create_as_reply(&this->public);
|
|
||||||
|
|
||||||
/* extract and copy by reference all error attributes */
|
/* extract and copy by reference all error attributes */
|
||||||
enumerator = this->pa_msg->create_error_enumerator(this->pa_msg);
|
enumerator = this->pa_msg->create_error_enumerator(this->pa_msg);
|
||||||
while (enumerator->enumerate(enumerator, &attr))
|
while (enumerator->enumerate(enumerator, &attr))
|
||||||
{
|
{
|
||||||
error_msg->add_attribute(error_msg, attr->get_ref(attr));
|
out_msg->add_attribute(out_msg, attr->get_ref(attr));
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
/*
|
|
||||||
* send the PA-TNC message containing all error attributes
|
|
||||||
* with the excl flag set
|
|
||||||
*/
|
|
||||||
result = error_msg->send(error_msg, TRUE);
|
|
||||||
error_msg->destroy(error_msg);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
case FAILED:
|
case FAILED:
|
||||||
default:
|
default:
|
||||||
@@ -340,7 +328,6 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
while (enumerator->enumerate(enumerator, &attr))
|
while (enumerator->enumerate(enumerator, &attr))
|
||||||
{
|
{
|
||||||
uint32_t max_attr_size, max_seg_size, my_max_attr_size, my_max_seg_size;
|
uint32_t max_attr_size, max_seg_size, my_max_attr_size, my_max_seg_size;
|
||||||
imv_msg_t *out_msg;
|
|
||||||
seg_contract_manager_t *contracts;
|
seg_contract_manager_t *contracts;
|
||||||
seg_contract_t *contract;
|
seg_contract_t *contract;
|
||||||
char buf[BUF_LEN];
|
char buf[BUF_LEN];
|
||||||
@@ -399,17 +386,10 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
max_seg_size);
|
max_seg_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send Maximum Attribute Size Response */
|
/* Add Maximum Attribute Size Response attribute */
|
||||||
out_msg = imv_msg_create_as_reply(&this->public);
|
|
||||||
attr = tcg_seg_attr_max_size_create(max_attr_size,
|
attr = tcg_seg_attr_max_size_create(max_attr_size,
|
||||||
max_seg_size, FALSE);
|
max_seg_size, FALSE);
|
||||||
out_msg->add_attribute(out_msg, attr);
|
out_msg->add_attribute(out_msg, attr);
|
||||||
result = out_msg->send(out_msg, TRUE);
|
|
||||||
out_msg->destroy(out_msg);
|
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TCG_SEG_MAX_ATTR_SIZE_RESP:
|
case TCG_SEG_MAX_ATTR_SIZE_RESP:
|
||||||
@@ -463,10 +443,7 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
attr = contract->add_segment(contract, attr, &error, &more);
|
attr = contract->add_segment(contract, attr, &error, &more);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
out_msg = imv_msg_create_as_reply(&this->public);
|
|
||||||
out_msg->add_attribute(out_msg, error);
|
out_msg->add_attribute(out_msg, error);
|
||||||
result = out_msg->send(out_msg, TRUE);
|
|
||||||
out_msg->destroy(out_msg);
|
|
||||||
}
|
}
|
||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
@@ -475,11 +452,8 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
if (more)
|
if (more)
|
||||||
{
|
{
|
||||||
/* Send Next Segment Request */
|
/* Send Next Segment Request */
|
||||||
out_msg = imv_msg_create_as_reply(&this->public);
|
|
||||||
attr = tcg_seg_attr_next_seg_create(base_attr_id, FALSE);
|
attr = tcg_seg_attr_next_seg_create(base_attr_id, FALSE);
|
||||||
out_msg->add_attribute(out_msg, attr);
|
out_msg->add_attribute(out_msg, attr);
|
||||||
result = out_msg->send(out_msg, TRUE);
|
|
||||||
out_msg->destroy(out_msg);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -496,21 +470,20 @@ METHOD(imv_msg_t, receive, TNC_Result,
|
|||||||
if (!contract)
|
if (!contract)
|
||||||
{
|
{
|
||||||
/* TODO no contract - generate error message */
|
/* TODO no contract - generate error message */
|
||||||
DBG2(DBG_IMV, "no contract for received next segment "
|
DBG1(DBG_IMV, "no contract for received next segment "
|
||||||
"request with base attribute ID %u", base_attr_id);
|
"request with base attribute ID %u", base_attr_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
attr = contract->next_segment(contract, base_attr_id);
|
attr = contract->next_segment(contract, base_attr_id);
|
||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
out_msg = imv_msg_create_as_reply(&this->public);
|
|
||||||
out_msg->add_attribute(out_msg, attr);
|
out_msg->add_attribute(out_msg, attr);
|
||||||
result = out_msg->send(out_msg, TRUE);
|
|
||||||
out_msg->destroy(out_msg);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* TODO no more segments - generate error message */
|
/* TODO no more segments - generate error message */
|
||||||
|
DBG1(DBG_IMV, "no more segments found for "
|
||||||
|
"base attribute ID %u", base_attr_id);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,10 +79,12 @@ struct imv_msg_t {
|
|||||||
/**
|
/**
|
||||||
* Processes a received PA-TNC message
|
* Processes a received PA-TNC message
|
||||||
*
|
*
|
||||||
|
* @param out_msg outgoing PA-TN message
|
||||||
* @param fatal_error TRUE if IMC sent a fatal error message
|
* @param fatal_error TRUE if IMC sent a fatal error message
|
||||||
* @return TNC result code
|
* @return TNC result code
|
||||||
*/
|
*/
|
||||||
TNC_Result (*receive)(imv_msg_t *this, bool *fatal_error);
|
TNC_Result (*receive)(imv_msg_t *this, imv_msg_t *out_msg,
|
||||||
|
bool *fatal_error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a PA-TNC attribute to the send queue
|
* Add a PA-TNC attribute to the send queue
|
||||||
|
|||||||
@@ -171,15 +171,17 @@ static TNC_Result receive_msg(private_imv_os_agent_t *this, imv_state_t *state,
|
|||||||
session = state->get_session(state);
|
session = state->get_session(state);
|
||||||
os_info = session->get_os_info(session);
|
os_info = session->get_os_info(session);
|
||||||
|
|
||||||
|
/* generate an outgoing PA-TNC message - we might need it */
|
||||||
|
out_msg = imv_msg_create_as_reply(in_msg);
|
||||||
|
|
||||||
/* parse received PA-TNC message and handle local and remote errors */
|
/* parse received PA-TNC message and handle local and remote errors */
|
||||||
result = in_msg->receive(in_msg, &fatal_error);
|
result = in_msg->receive(in_msg,out_msg, &fatal_error);
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
if (result != TNC_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
|
|
||||||
/* analyze PA-TNC attributes */
|
/* analyze PA-TNC attributes */
|
||||||
enumerator = in_msg->create_attribute_enumerator(in_msg);
|
enumerator = in_msg->create_attribute_enumerator(in_msg);
|
||||||
while (enumerator->enumerate(enumerator, &attr))
|
while (enumerator->enumerate(enumerator, &attr))
|
||||||
@@ -394,20 +396,20 @@ static TNC_Result receive_msg(private_imv_os_agent_t *this, imv_state_t *state,
|
|||||||
{
|
{
|
||||||
os_state->set_handshake_state(os_state, IMV_OS_STATE_END);
|
os_state->set_handshake_state(os_state, IMV_OS_STATE_END);
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* send PA-TNC message with excl flag set */
|
{
|
||||||
result = out_msg->send(out_msg, TRUE);
|
/* send PA-TNC message with the EXCL flag set */
|
||||||
|
result = out_msg->send(out_msg, TRUE);
|
||||||
|
}
|
||||||
out_msg->destroy(out_msg);
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
||||||
private_imv_os_agent_t *this, TNC_ConnectionID id,
|
private_imv_os_agent_t *this, TNC_ConnectionID id,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Andreas Steffen
|
* Copyright (C) 2013-2014 Andreas Steffen
|
||||||
* HSR Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
@@ -94,10 +94,14 @@ static TNC_Result receive_msg(private_imv_scanner_agent_t *this,
|
|||||||
ietf_attr_port_filter_t *port_filter_attr;
|
ietf_attr_port_filter_t *port_filter_attr;
|
||||||
bool fatal_error = FALSE;
|
bool fatal_error = FALSE;
|
||||||
|
|
||||||
|
/* generate an outgoing PA-TNC message - we might need it */
|
||||||
|
out_msg = imv_msg_create_as_reply(in_msg);
|
||||||
|
|
||||||
/* parse received PA-TNC message and handle local and remote errors */
|
/* parse received PA-TNC message and handle local and remote errors */
|
||||||
result = in_msg->receive(in_msg, &fatal_error);
|
result = in_msg->receive(in_msg, out_msg, &fatal_error);
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
if (result != TNC_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,17 +125,20 @@ static TNC_Result receive_msg(private_imv_scanner_agent_t *this,
|
|||||||
state->set_recommendation(state,
|
state->set_recommendation(state,
|
||||||
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
||||||
TNC_IMV_EVALUATION_RESULT_ERROR);
|
TNC_IMV_EVALUATION_RESULT_ERROR);
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* send PA-TNC message with the EXCL flag set */
|
||||||
|
result = out_msg->send(out_msg, TRUE);
|
||||||
|
}
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
return TNC_RESULT_SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2013 Andreas Steffen
|
* Copyright (C) 2013-2014 Andreas Steffen
|
||||||
* HSR Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
@@ -94,10 +94,14 @@ static TNC_Result receive_msg(private_imv_test_agent_t *this, imv_state_t *state
|
|||||||
int rounds;
|
int rounds;
|
||||||
bool fatal_error = FALSE, received_command = FALSE, retry = FALSE;
|
bool fatal_error = FALSE, received_command = FALSE, retry = FALSE;
|
||||||
|
|
||||||
|
/* generate an outgoing PA-TNC message - we might need it */
|
||||||
|
out_msg = imv_msg_create_as_reply(in_msg);
|
||||||
|
|
||||||
/* parse received PA-TNC message and handle local and remote errors */
|
/* parse received PA-TNC message and handle local and remote errors */
|
||||||
result = in_msg->receive(in_msg, &fatal_error);
|
result = in_msg->receive(in_msg, out_msg, &fatal_error);
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
if (result != TNC_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,14 +176,12 @@ static TNC_Result receive_msg(private_imv_test_agent_t *this, imv_state_t *state
|
|||||||
state->set_recommendation(state,
|
state->set_recommendation(state,
|
||||||
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
||||||
TNC_IMV_EVALUATION_RESULT_ERROR);
|
TNC_IMV_EVALUATION_RESULT_ERROR);
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* request a handshake retry ? */
|
/* request a handshake retry ? */
|
||||||
@@ -195,7 +197,6 @@ static TNC_Result receive_msg(private_imv_test_agent_t *this, imv_state_t *state
|
|||||||
/* repeat the measurement ? */
|
/* repeat the measurement ? */
|
||||||
if (test_state->another_round(test_state, in_msg->get_src_id(in_msg)))
|
if (test_state->another_round(test_state, in_msg->get_src_id(in_msg)))
|
||||||
{
|
{
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
attr = ita_attr_command_create("repeat");
|
attr = ita_attr_command_create("repeat");
|
||||||
out_msg->add_attribute(out_msg, attr);
|
out_msg->add_attribute(out_msg, attr);
|
||||||
|
|
||||||
@@ -208,19 +209,20 @@ static TNC_Result receive_msg(private_imv_test_agent_t *this, imv_state_t *state
|
|||||||
|
|
||||||
if (received_command)
|
if (received_command)
|
||||||
{
|
{
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return TNC_RESULT_SUCCESS;
|
/* send PA-TNC message with the EXCL flag set */
|
||||||
|
result = out_msg->send(out_msg, TRUE);
|
||||||
}
|
}
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
||||||
|
|||||||
@@ -176,19 +176,21 @@ static TNC_Result receive_msg(private_imv_attestation_agent_t *this,
|
|||||||
chunk_t os_name, os_version;
|
chunk_t os_name, os_version;
|
||||||
bool fatal_error = FALSE;
|
bool fatal_error = FALSE;
|
||||||
|
|
||||||
|
/* generate an outgoing PA-TNC message - we might need it */
|
||||||
|
out_msg = imv_msg_create_as_reply(in_msg);
|
||||||
|
out_msg->set_msg_type(out_msg, msg_types[0]);
|
||||||
|
|
||||||
/* parse received PA-TNC message and handle local and remote errors */
|
/* parse received PA-TNC message and handle local and remote errors */
|
||||||
result = in_msg->receive(in_msg, &fatal_error);
|
result = in_msg->receive(in_msg, out_msg, &fatal_error);
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
if (result != TNC_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
session = state->get_session(state);
|
session = state->get_session(state);
|
||||||
os_info = session->get_os_info(session);
|
os_info = session->get_os_info(session);
|
||||||
|
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
out_msg->set_msg_type(out_msg, msg_types[0]);
|
|
||||||
|
|
||||||
/* analyze PA-TNC attributes */
|
/* analyze PA-TNC attributes */
|
||||||
enumerator = in_msg->create_attribute_enumerator(in_msg);
|
enumerator = in_msg->create_attribute_enumerator(in_msg);
|
||||||
while (enumerator->enumerate(enumerator, &attr))
|
while (enumerator->enumerate(enumerator, &attr))
|
||||||
@@ -305,16 +307,16 @@ static TNC_Result receive_msg(private_imv_attestation_agent_t *this,
|
|||||||
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
||||||
TNC_IMV_EVALUATION_RESULT_ERROR);
|
TNC_IMV_EVALUATION_RESULT_ERROR);
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* send PA-TNC message with excl flag set */
|
{
|
||||||
result = out_msg->send(out_msg, TRUE);
|
/* send PA-TNC message with the EXCL flag set */
|
||||||
|
result = out_msg->send(out_msg, TRUE);
|
||||||
|
}
|
||||||
out_msg->destroy(out_msg);
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -119,10 +119,14 @@ static TNC_Result receive_msg(private_imv_swid_agent_t *this,
|
|||||||
TNC_Result result;
|
TNC_Result result;
|
||||||
bool fatal_error = FALSE;
|
bool fatal_error = FALSE;
|
||||||
|
|
||||||
|
/* generate an outgoing PA-TNC message - we might need it */
|
||||||
|
out_msg = imv_msg_create_as_reply(in_msg);
|
||||||
|
|
||||||
/* parse received PA-TNC message and handle local and remote errors */
|
/* parse received PA-TNC message and handle local and remote errors */
|
||||||
result = in_msg->receive(in_msg, &fatal_error);
|
result = in_msg->receive(in_msg, out_msg, &fatal_error);
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
if (result != TNC_RESULT_SUCCESS)
|
||||||
{
|
{
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,17 +309,20 @@ static TNC_Result receive_msg(private_imv_swid_agent_t *this,
|
|||||||
state->set_recommendation(state,
|
state->set_recommendation(state,
|
||||||
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
|
||||||
TNC_IMV_EVALUATION_RESULT_ERROR);
|
TNC_IMV_EVALUATION_RESULT_ERROR);
|
||||||
out_msg = imv_msg_create_as_reply(in_msg);
|
|
||||||
result = out_msg->send_assessment(out_msg);
|
result = out_msg->send_assessment(out_msg);
|
||||||
out_msg->destroy(out_msg);
|
if (result == TNC_RESULT_SUCCESS)
|
||||||
if (result != TNC_RESULT_SUCCESS)
|
|
||||||
{
|
{
|
||||||
return result;
|
result = this->agent->provide_recommendation(this->agent, state);
|
||||||
}
|
}
|
||||||
return this->agent->provide_recommendation(this->agent, state);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* send PA-TNC message with the EXCL flag set */
|
||||||
|
result = out_msg->send(out_msg, TRUE);
|
||||||
|
}
|
||||||
|
out_msg->destroy(out_msg);
|
||||||
|
|
||||||
return TNC_RESULT_SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
METHOD(imv_agent_if_t, receive_message, TNC_Result,
|
||||||
|
|||||||
Reference in New Issue
Block a user