summaryrefslogtreecommitdiff
path: root/src/libimcv/ietf/ietf_attr_pa_tnc_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libimcv/ietf/ietf_attr_pa_tnc_error.c')
-rw-r--r--src/libimcv/ietf/ietf_attr_pa_tnc_error.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/libimcv/ietf/ietf_attr_pa_tnc_error.c b/src/libimcv/ietf/ietf_attr_pa_tnc_error.c
index 0dbb4aaef..966c095e2 100644
--- a/src/libimcv/ietf/ietf_attr_pa_tnc_error.c
+++ b/src/libimcv/ietf/ietf_attr_pa_tnc_error.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2014 Andreas Steffen
+ * Copyright (C) 2011-2017 Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -20,13 +20,23 @@
#include <bio/bio_reader.h>
#include <utils/debug.h>
-ENUM(pa_tnc_error_code_names, PA_ERROR_RESERVED,
- PA_ERROR_ATTR_TYPE_NOT_SUPPORTED,
+ENUM_BEGIN(pa_tnc_error_code_names, PA_ERROR_RESERVED,
+ PA_ERROR_ATTR_TYPE_NOT_SUPPORTED,
"Reserved",
"Invalid Parameter",
"Version Not Supported",
"Attribute Type Not Supported"
);
+ENUM_NEXT(pa_tnc_error_code_names, PA_ERROR_SW,
+ PA_ERROR_SW_SUBSCRIPTION_ID_REUSE,
+ PA_ERROR_ATTR_TYPE_NOT_SUPPORTED,
+ "SW Error",
+ "SW Subscription Denied",
+ "SW Response Too Large",
+ "SW Subscription Fulfillment Error",
+ "SW Subscription ID Reuse"
+);
+ENUM_END(pa_tnc_error_code_names, PA_ERROR_SW_SUBSCRIPTION_ID_REUSE);
typedef struct private_ietf_attr_pa_tnc_error_t private_ietf_attr_pa_tnc_error_t;
@@ -246,7 +256,8 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint24(reader, &this->error_code.vendor_id);
reader->read_uint32(reader, &this->error_code.type);
- if (this->error_code.vendor_id == PEN_IETF)
+ if (this->error_code.vendor_id == PEN_IETF &&
+ this->error_code.type <= PA_ERROR_PA_TNC_MSG_ROOF)
{
if (!reader->read_data(reader, PA_ERROR_MSG_INFO_SIZE, &this->msg_info))
{
@@ -396,7 +407,8 @@ pa_tnc_attr_t *ietf_attr_pa_tnc_error_create(pen_type_t error_code,
{
private_ietf_attr_pa_tnc_error_t *this;
- if (error_code.vendor_id == PEN_IETF)
+ if (error_code.vendor_id == PEN_IETF &&
+ error_code.type <= PA_ERROR_PA_TNC_MSG_ROOF)
{
msg_info.len = PA_ERROR_MSG_INFO_SIZE;
}