implemented first TCG-PTS error attribute
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include <ietf/ietf_attr_pa_tnc_error.h>
|
||||
|
||||
#include <tcg/pts/pts_database.h>
|
||||
#include <tcg/pts/pts_error.h>
|
||||
|
||||
#include <tcg/tcg_attr.h>
|
||||
#include <tcg/tcg_pts_attr_proto_caps.h>
|
||||
@@ -331,28 +332,40 @@ TNC_Result TNC_IMV_ReceiveMessage(TNC_IMVID imv_id,
|
||||
attr->get_type(attr) == IETF_ATTR_PA_TNC_ERROR)
|
||||
{
|
||||
ietf_attr_pa_tnc_error_t *error_attr;
|
||||
pen_t error_vendor_id;
|
||||
pa_tnc_error_code_t error_code;
|
||||
chunk_t msg_info, attr_info;
|
||||
u_int32_t offset;
|
||||
|
||||
error_attr = (ietf_attr_pa_tnc_error_t*)attr;
|
||||
error_vendor_id = error_attr->get_vendor_id(error_attr);
|
||||
error_code = error_attr->get_error_code(error_attr);
|
||||
msg_info = error_attr->get_msg_info(error_attr);
|
||||
|
||||
DBG1(DBG_IMV, "received PA-TNC error '%N' concerning message %#B",
|
||||
pa_tnc_error_code_names, error_code, &msg_info);
|
||||
switch (error_code)
|
||||
if (error_vendor_id == PEN_IETF)
|
||||
{
|
||||
case PA_ERROR_INVALID_PARAMETER:
|
||||
offset = error_attr->get_offset(error_attr);
|
||||
DBG1(DBG_IMV, " occurred at offset of %u bytes", offset);
|
||||
break;
|
||||
case PA_ERROR_ATTR_TYPE_NOT_SUPPORTED:
|
||||
attr_info = error_attr->get_attr_info(error_attr);
|
||||
DBG1(DBG_IMV, " unsupported attribute %#B", &attr_info);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
DBG1(DBG_IMV, "received PA-TNC error '%N' concerning message %#B",
|
||||
pa_tnc_error_code_names, error_code, &msg_info);
|
||||
|
||||
switch (error_code)
|
||||
{
|
||||
case PA_ERROR_INVALID_PARAMETER:
|
||||
offset = error_attr->get_offset(error_attr);
|
||||
DBG1(DBG_IMV, " occurred at offset of %u bytes", offset);
|
||||
break;
|
||||
case PA_ERROR_ATTR_TYPE_NOT_SUPPORTED:
|
||||
attr_info = error_attr->get_attr_info(error_attr);
|
||||
DBG1(DBG_IMV, " unsupported attribute %#B", &attr_info);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (error_vendor_id == PEN_TCG)
|
||||
{
|
||||
DBG1(DBG_IMV, "received TCG-PTS error '%N'",
|
||||
pts_error_code_names, error_code);
|
||||
DBG1(DBG_IMV, "error information: %B", &msg_info);
|
||||
}
|
||||
fatal_error = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user