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
-34
View File
@@ -25,7 +25,6 @@
#include <ietf/ietf_attr_numeric_version.h>
#include <ietf/ietf_attr_op_status.h>
#include <ietf/ietf_attr_product_info.h>
#include <ietf/ietf_attr_remediation_instr.h>
#include <ietf/ietf_attr_string_version.h>
#include <ita/ita_attr.h>
#include <ita/ita_attr_get_settings.h>
@@ -444,39 +443,6 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
}
e->destroy(e);
}
else if (type.type == IETF_ATTR_REMEDIATION_INSTRUCTIONS)
{
ietf_attr_remediation_instr_t *attr_cast;
pen_type_t parameters_type;
chunk_t parameters, string, lang_code;
attr_cast = (ietf_attr_remediation_instr_t*)attr;
parameters_type = attr_cast->get_parameters_type(attr_cast);
parameters = attr_cast->get_parameters(attr_cast);
if (parameters_type.vendor_id == PEN_IETF)
{
switch (parameters_type.type)
{
case IETF_REMEDIATION_PARAMETERS_URI:
DBG1(DBG_IMC, "remediation uri: '%.*s'",
parameters.len, parameters.ptr);
break;
case IETF_REMEDIATION_PARAMETERS_STRING:
string = attr_cast->get_string(attr_cast, &lang_code);
DBG1(DBG_IMC, "remediation string: '%.*s' [%.*s]",
string.len, string.ptr,
lang_code.len, lang_code.ptr);
break;
default:
DBG1(DBG_IMC, "remediation parameters %B", &parameters);
}
}
else
{
DBG1(DBG_IMC, "remediation parameters %B", &parameters);
}
}
}
else if (type.vendor_id == PEN_ITA && type.type == ITA_ATTR_GET_SETTINGS)
{
@@ -20,7 +20,6 @@
#include <ietf/ietf_attr.h>
#include <ietf/ietf_attr_attr_request.h>
#include <ietf/ietf_attr_port_filter.h>
#include <ietf/ietf_attr_remediation_instr.h>
#include <tncif_pa_subtypes.h>
@@ -340,39 +339,6 @@ static TNC_Result receive_message(imc_msg_t *in_msg)
}
e->destroy(e);
}
else if (attr_type.type == IETF_ATTR_REMEDIATION_INSTRUCTIONS)
{
ietf_attr_remediation_instr_t *attr_cast;
pen_type_t parameters_type;
chunk_t parameters, string, lang_code;
attr_cast = (ietf_attr_remediation_instr_t*)attr;
parameters_type = attr_cast->get_parameters_type(attr_cast);
parameters = attr_cast->get_parameters(attr_cast);
if (parameters_type.vendor_id == PEN_IETF)
{
switch (parameters_type.type)
{
case IETF_REMEDIATION_PARAMETERS_URI:
DBG1(DBG_IMC, "remediation uri: '%.*s'",
parameters.len, parameters.ptr);
break;
case IETF_REMEDIATION_PARAMETERS_STRING:
string = attr_cast->get_string(attr_cast, &lang_code);
DBG1(DBG_IMC, "remediation string: '%.*s' [%.*s]",
string.len, string.ptr,
lang_code.len, lang_code.ptr);
break;
default:
DBG1(DBG_IMC, "remediation parameters %B", &parameters);
}
}
else
{
DBG1(DBG_IMC, "remediation parameters %B", &parameters);
}
}
}
enumerator->destroy(enumerator);
+1 -1
View File
@@ -199,7 +199,7 @@ METHOD(imv_state_t, get_reason_string, bool,
METHOD(imv_state_t, get_remediation_instructions, bool,
private_imv_os_state_t *this, enumerator_t *language_enumerator,
char **string, char **lang_code)
char **string, char **lang_code, char **uri)
{
return FALSE;
}
@@ -205,7 +205,7 @@ METHOD(imv_state_t, get_reason_string, bool,
METHOD(imv_state_t, get_remediation_instructions, bool,
private_imv_scanner_state_t *this, enumerator_t *language_enumerator,
char **string, char **lang_code)
char **string, char **lang_code, char **uri)
{
bool match = FALSE;
char *lang;
@@ -241,6 +241,8 @@ METHOD(imv_state_t, get_remediation_instructions, bool,
strlen(this->violating_ports) + 1);
sprintf(this->instructions, "%s%s", *string, this->violating_ports);
*string = this->instructions;
*uri = lib->settings->get_str(lib->settings,
"libimcv.plugins.imv-scanner.remediation_uri", NULL);
return TRUE;
}
@@ -197,9 +197,9 @@ METHOD(imv_state_t, get_reason_string, bool,
METHOD(imv_state_t, get_remediation_instructions, bool,
private_imv_test_state_t *this, enumerator_t *language_enumerator,
char **string, char **lang_code)
char **string, char **lang_code, char **uri)
{
return FALSE;
}
METHOD(imv_state_t, destroy, void,