renamed tls_reader|writer to bio_* and moved to libstrongswan
This commit is contained in:
@@ -8,7 +8,6 @@ if MONOLITHIC
|
||||
noinst_LTLIBRARIES = libstrongswan-tnccs-20.la
|
||||
else
|
||||
plugin_LTLIBRARIES = libstrongswan-tnccs-20.la
|
||||
libstrongswan_tnccs_20_la_LIBADD = $(top_builddir)/src/libtls/libtls.la
|
||||
endif
|
||||
|
||||
libstrongswan_tnccs_20_la_SOURCES = \
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
#include <debug.h>
|
||||
#include <utils/linked_list.h>
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <tnc/tnccs/tnccs.h>
|
||||
#include <tnc/pen/pen.h>
|
||||
|
||||
@@ -143,7 +143,7 @@ METHOD(pb_tnc_batch_t, build, void,
|
||||
enumerator_t *enumerator;
|
||||
pb_tnc_msg_type_t msg_type;
|
||||
pb_tnc_msg_t *msg;
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* compute total PB-TNC batch size by summing over all messages */
|
||||
batch_len = PB_TNC_BATCH_HEADER_SIZE;
|
||||
@@ -157,7 +157,7 @@ METHOD(pb_tnc_batch_t, build, void,
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
/* build PB-TNC batch header */
|
||||
writer = tls_writer_create(batch_len);
|
||||
writer = bio_writer_create(batch_len);
|
||||
writer->write_uint8 (writer, PB_TNC_VERSION);
|
||||
writer->write_uint8 (writer, this->is_server ?
|
||||
PB_TNC_BATCH_FLAG_D : PB_TNC_BATCH_FLAG_NONE);
|
||||
@@ -193,7 +193,7 @@ METHOD(pb_tnc_batch_t, build, void,
|
||||
static status_t process_batch_header(private_pb_tnc_batch_t *this,
|
||||
pb_tnc_state_machine_t *state_machine)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
pb_tnc_msg_t *msg;
|
||||
pb_error_msg_t *err_msg;
|
||||
u_int8_t version, flags, reserved, type;
|
||||
@@ -209,7 +209,7 @@ static status_t process_batch_header(private_pb_tnc_batch_t *this,
|
||||
goto fatal;
|
||||
}
|
||||
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint8 (reader, &version);
|
||||
reader->read_uint8 (reader, &flags);
|
||||
reader->read_uint8 (reader, &reserved);
|
||||
@@ -278,7 +278,7 @@ fatal:
|
||||
|
||||
static status_t process_tnc_msg(private_pb_tnc_batch_t *this)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
pb_tnc_msg_t *pb_tnc_msg, *msg;
|
||||
u_int8_t flags;
|
||||
u_int32_t vendor_id, msg_type, msg_len, offset;
|
||||
@@ -297,7 +297,7 @@ static status_t process_tnc_msg(private_pb_tnc_batch_t *this)
|
||||
goto fatal;
|
||||
}
|
||||
|
||||
reader = tls_reader_create(data);
|
||||
reader = bio_reader_create(data);
|
||||
reader->read_uint8 (reader, &flags);
|
||||
reader->read_uint24(reader, &vendor_id);
|
||||
reader->read_uint32(reader, &msg_type);
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
#include "pb_access_recommendation_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <debug.h>
|
||||
|
||||
ENUM(pb_access_recommendation_code_names, PB_REC_ACCESS_ALLOWED, PB_REC_QUARANTINED,
|
||||
@@ -80,10 +80,10 @@ METHOD(pb_tnc_msg_t, get_encoding, chunk_t,
|
||||
METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_access_recommendation_msg_t *this)
|
||||
{
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message */
|
||||
writer = tls_writer_create(ACCESS_RECOMMENDATION_MSG_SIZE);
|
||||
writer = bio_writer_create(ACCESS_RECOMMENDATION_MSG_SIZE);
|
||||
writer->write_uint16(writer, ACCESS_RECOMMENDATION_RESERVED);
|
||||
writer->write_uint16(writer, this->recommendation);
|
||||
free(this->encoding.ptr);
|
||||
@@ -95,11 +95,11 @@ METHOD(pb_tnc_msg_t, build, void,
|
||||
METHOD(pb_tnc_msg_t, process, status_t,
|
||||
private_pb_access_recommendation_msg_t *this, u_int32_t *offset)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
u_int16_t reserved;
|
||||
|
||||
/* process message */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint16(reader, &reserved);
|
||||
reader->read_uint16(reader, &this->recommendation);
|
||||
reader->destroy(reader);
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
#include "pb_assessment_result_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <tnc/tncifimv.h>
|
||||
#include <debug.h>
|
||||
|
||||
@@ -75,10 +75,10 @@ METHOD(pb_tnc_msg_t, get_encoding, chunk_t,
|
||||
METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_assessment_result_msg_t *this)
|
||||
{
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message */
|
||||
writer = tls_writer_create(ASSESSMENT_RESULT_MSG_SIZE);
|
||||
writer = bio_writer_create(ASSESSMENT_RESULT_MSG_SIZE);
|
||||
writer->write_uint32(writer, this->assessment_result);
|
||||
free(this->encoding.ptr);
|
||||
this->encoding = writer->get_buf(writer);
|
||||
@@ -89,10 +89,10 @@ METHOD(pb_tnc_msg_t, build, void,
|
||||
METHOD(pb_tnc_msg_t, process, status_t,
|
||||
private_pb_assessment_result_msg_t *this, u_int32_t *offset)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
|
||||
/* process message */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint32(reader, &this->assessment_result);
|
||||
reader->destroy(reader);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
#include "pb_error_msg.h"
|
||||
|
||||
#include <debug.h>
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <tnc/tnccs/tnccs.h>
|
||||
#include <tnc/pen/pen.h>
|
||||
|
||||
@@ -117,10 +117,10 @@ METHOD(pb_tnc_msg_t, get_encoding, chunk_t,
|
||||
METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_error_msg_t *this)
|
||||
{
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message header */
|
||||
writer = tls_writer_create(ERROR_HEADER_SIZE);
|
||||
writer = bio_writer_create(ERROR_HEADER_SIZE);
|
||||
writer->write_uint8 (writer, this->fatal ?
|
||||
ERROR_FLAG_FATAL : ERROR_FLAG_NONE);
|
||||
writer->write_uint24(writer, this->vendor_id);
|
||||
@@ -153,7 +153,7 @@ METHOD(pb_tnc_msg_t, process, status_t,
|
||||
{
|
||||
u_int8_t flags, max_version, min_version;
|
||||
u_int16_t reserved;
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
|
||||
if (this->encoding.len < ERROR_HEADER_SIZE)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ METHOD(pb_tnc_msg_t, process, status_t,
|
||||
}
|
||||
|
||||
/* process message header */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint8 (reader, &flags);
|
||||
reader->read_uint24(reader, &this->vendor_id);
|
||||
reader->read_uint16(reader, &this->error_code);
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
#include "pb_language_preference_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <debug.h>
|
||||
|
||||
typedef struct private_pb_language_preference_msg_t private_pb_language_preference_msg_t;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
#include "pb_pa_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <tnc/tnccs/tnccs.h>
|
||||
#include <tnc/pen/pen.h>
|
||||
#include <debug.h>
|
||||
@@ -125,10 +125,10 @@ METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_pa_msg_t *this)
|
||||
{
|
||||
chunk_t msg_header;
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message header */
|
||||
writer = tls_writer_create(64);
|
||||
writer = bio_writer_create(64);
|
||||
writer->write_uint8 (writer, this->excl ? PA_FLAG_EXCL : PA_FLAG_NONE);
|
||||
writer->write_uint24(writer, this->vendor_id);
|
||||
writer->write_uint32(writer, this->subtype);
|
||||
@@ -147,10 +147,10 @@ METHOD(pb_tnc_msg_t, process, status_t,
|
||||
{
|
||||
u_int8_t flags;
|
||||
size_t msg_body_len;
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
|
||||
/* process message header */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint8 (reader, &flags);
|
||||
reader->read_uint24(reader, &this->vendor_id);
|
||||
reader->read_uint32(reader, &this->subtype);
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
#include "pb_reason_string_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <debug.h>
|
||||
|
||||
typedef struct private_pb_reason_string_msg_t private_pb_reason_string_msg_t;
|
||||
@@ -81,10 +81,10 @@ METHOD(pb_tnc_msg_t, get_encoding, chunk_t,
|
||||
METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_reason_string_msg_t *this)
|
||||
{
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message */
|
||||
writer = tls_writer_create(64);
|
||||
writer = bio_writer_create(64);
|
||||
writer->write_data32(writer, this->reason_string);
|
||||
writer->write_data8 (writer, this->language_code);
|
||||
|
||||
@@ -97,10 +97,10 @@ METHOD(pb_tnc_msg_t, build, void,
|
||||
METHOD(pb_tnc_msg_t, process, status_t,
|
||||
private_pb_reason_string_msg_t *this, u_int32_t *offset)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
|
||||
/* process message */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
if (!reader->read_data32(reader, &this->reason_string))
|
||||
{
|
||||
DBG1(DBG_TNC, "could not parse reason string");
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
#include "pb_remediation_parameters_msg.h"
|
||||
|
||||
#include <tls_writer.h>
|
||||
#include <tls_reader.h>
|
||||
#include <bio/bio_writer.h>
|
||||
#include <bio/bio_reader.h>
|
||||
#include <debug.h>
|
||||
|
||||
ENUM(pb_tnc_remed_param_type_names, PB_REMEDIATION_URI, PB_REMEDIATION_STRING,
|
||||
@@ -106,10 +106,10 @@ METHOD(pb_tnc_msg_t, get_encoding, chunk_t,
|
||||
METHOD(pb_tnc_msg_t, build, void,
|
||||
private_pb_remediation_parameters_msg_t *this)
|
||||
{
|
||||
tls_writer_t *writer;
|
||||
bio_writer_t *writer;
|
||||
|
||||
/* build message */
|
||||
writer = tls_writer_create(64);
|
||||
writer = bio_writer_create(64);
|
||||
writer->write_uint32(writer, this->vendor_id);
|
||||
writer->write_uint32(writer, this->parameters_type);
|
||||
writer->write_data32(writer, this->remediation_string);
|
||||
@@ -124,10 +124,10 @@ METHOD(pb_tnc_msg_t, build, void,
|
||||
METHOD(pb_tnc_msg_t, process, status_t,
|
||||
private_pb_remediation_parameters_msg_t *this, u_int32_t *offset)
|
||||
{
|
||||
tls_reader_t *reader;
|
||||
bio_reader_t *reader;
|
||||
|
||||
/* process message */
|
||||
reader = tls_reader_create(this->encoding);
|
||||
reader = bio_reader_create(this->encoding);
|
||||
reader->read_uint32(reader, &this->vendor_id);
|
||||
reader->read_uint32(reader, &this->parameters_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user