centralized processing of assessment information

This commit is contained in:
Andreas Steffen
2012-11-12 10:45:38 +01:00
parent 6782bf3722
commit 3de9a31a49
10 changed files with 104 additions and 90 deletions
+15 -5
View File
@@ -191,7 +191,7 @@ METHOD(imv_msg_t, send_assessment, TNC_Result,
TNC_IMV_Action_Recommendation rec;
TNC_IMV_Evaluation_Result eval;
pa_tnc_attr_t *attr;
char *string, *lang_code;
char *string = NULL, *lang_code = NULL, *uri = NULL;
enumerator_t *e;
/* Send an IETF Assessment Result attribute if enabled */
@@ -202,17 +202,27 @@ METHOD(imv_msg_t, send_assessment, TNC_Result,
attr = ietf_attr_assess_result_create(eval);
add_attribute(this, attr);
/* Send IETF Remediation Instructions if available */
if (eval != TNC_IMV_EVALUATION_RESULT_COMPLIANT)
{
e = this->agent->create_language_enumerator(this->agent,
this->state);
this->state);
if (this->state->get_remediation_instructions(this->state,
e, &string, &lang_code))
e, &string, &lang_code, &uri))
{
attr = ietf_attr_remediation_instr_create_from_string(
if (string && lang_code)
{
attr = ietf_attr_remediation_instr_create_from_string(
chunk_create(string, strlen(string)),
chunk_create(lang_code, strlen(lang_code)));
add_attribute(this, attr);
add_attribute(this, attr);
}
if (uri)
{
attr = ietf_attr_remediation_instr_create_from_uri(
chunk_create(uri, strlen(uri)));
add_attribute(this, attr);
}
}
e->destroy(e);
}