#include <tls_writer.h>
#include <tls_reader.h>
#include <tnc/tnccs/tnccs.h>
+#include <tnc/pen/pen.h>
ENUM(pb_tnc_batch_type_names, PB_BATCH_CDATA, PB_BATCH_CLOSE,
"CDATA",
flags |= PB_TNC_FLAG_NOSKIP;
}
writer->write_uint8 (writer, flags);
- writer->write_uint24(writer, IETF_VENDOR_ID);
+ writer->write_uint24(writer, PEN_IETF);
writer->write_uint32(writer, msg_type);
writer->write_uint32(writer, msg_len);
writer->write_data (writer, msg_value);
{
DBG1(DBG_TNC, "%u bytes insufficient to parse PB-TNC batch header",
this->encoding.len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, 0);
goto fatal;
}
if (version != PB_TNC_VERSION)
{
DBG1(DBG_TNC, "unsupported TNCCS batch version 0x%01x", version);
- msg = pb_error_msg_create(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create(TRUE, PEN_IETF,
PB_ERROR_VERSION_NOT_SUPPORTED);
err_msg = (pb_error_msg_t*)msg;
err_msg->set_bad_version(err_msg, version);
{
DBG1(DBG_TNC, "wrong Directionality: batch is from a PB %s",
directionality ? "server" : "client");
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, 1);
goto fatal;
}
if (this->type > PB_BATCH_ROOF)
{
DBG1(DBG_TNC, "unknown PB-TNC batch type: %d", this->type);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, 3);
goto fatal;
}
{
DBG1(DBG_TNC, "unexpected PB-TNC batch type: %N",
pb_tnc_batch_type_names, this->type);
- msg = pb_error_msg_create(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create(TRUE, PEN_IETF,
PB_ERROR_UNEXPECTED_BATCH_TYPE);
goto fatal;
}
{
DBG1(DBG_TNC, "%u bytes of data is not equal to batch length of %u bytes",
this->encoding.len, batch_len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, 4);
goto fatal;
}
{
DBG1(DBG_TNC, "%u bytes insufficient to parse PB-TNC message header",
data.len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset);
goto fatal;
}
if (msg_len > data.len)
{
DBG1(DBG_TNC, "%u bytes insufficient to parse PB-TNC message", data.len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset + 8);
goto fatal;
}
- if (vendor_id == RESERVED_VENDOR_ID)
+ if (vendor_id == PEN_RESERVED)
{
- DBG1(DBG_TNC, "Vendor ID 0x%06x is reserved", RESERVED_VENDOR_ID);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ DBG1(DBG_TNC, "Vendor ID 0x%06x is reserved", PEN_RESERVED);
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset + 1);
goto fatal;
{
DBG1(DBG_TNC, "PB-TNC message Type 0x%08x is reserved",
PB_TNC_RESERVED_MSG_TYPE);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset + 4);
goto fatal;
}
- if (vendor_id != IETF_VENDOR_ID || msg_type > PB_MSG_ROOF)
+ if (vendor_id != PEN_IETF || msg_type > PB_MSG_ROOF)
{
if (msg_len < PB_TNC_HEADER_SIZE)
{
DBG1(DBG_TNC, "%u bytes too small for PB-TNC message length",
msg_len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset + 8);
goto fatal;
}
{
DBG1(DBG_TNC, "reject PB-TNC message (Vendor ID 0x%06x / "
"Type 0x%08x)", vendor_id, msg_type);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_UNSUPPORTED_MANDATORY_MSG, this->offset);
goto fatal;
}
DBG1(DBG_TNC, "%N message must%s have NOSKIP flag set",
pb_tnc_msg_type_names, msg_type,
pb_tnc_msg_infos[msg_type].has_noskip_flag ? "" : " not");
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset);
goto fatal;
}
pb_tnc_msg_type_names, msg_type,
pb_tnc_msg_infos[msg_type].exact_size ? "exactly" : "at least",
pb_tnc_msg_infos[msg_type].min_size, msg_len);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset);
goto fatal;
}
{
DBG1(DBG_TNC,"reject %N message received from a PB-TNC client",
pb_tnc_msg_type_names, msg_type);
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset);
goto fatal;
}
status = pb_tnc_msg->process(pb_tnc_msg, &offset);
if (status == FAILED || status == VERIFY_ERROR)
{
- msg = pb_error_msg_create_with_offset(TRUE, IETF_VENDOR_ID,
+ msg = pb_error_msg_create_with_offset(TRUE, PEN_IETF,
PB_ERROR_INVALID_PARAMETER, this->offset);
this->errors->insert_last(this->errors, msg);
}