aboutsummaryrefslogtreecommitdiffstats
path: root/src/libimcv
diff options
context:
space:
mode:
authorAndreas Steffen <andreas.steffen@strongswan.org>2017-05-22 15:46:44 +0200
committerAndreas Steffen <andreas.steffen@strongswan.org>2017-07-08 23:19:51 +0200
commit0cc0b53b2fca90700d66c89863bc0636b3846bda (patch)
tree5c19ecd8bbd947b2b2308ac578fbfc291ab14c7e /src/libimcv
parent8c4c824706da39ea05ec2f9f76e45968396195de (diff)
downloadstrongswan-0cc0b53b2fca90700d66c89863bc0636b3846bda.tar.bz2
strongswan-0cc0b53b2fca90700d66c89863bc0636b3846bda.tar.xz
libimcv: Added IETF Software PA-TNC attributes
Diffstat (limited to 'src/libimcv')
-rw-r--r--src/libimcv/ietf/ietf_attr.c29
-rw-r--r--src/libimcv/ietf/ietf_attr.h18
-rw-r--r--src/libimcv/ietf/ietf_attr_pa_tnc_error.c16
-rw-r--r--src/libimcv/ietf/ietf_attr_pa_tnc_error.h20
4 files changed, 70 insertions, 13 deletions
diff --git a/src/libimcv/ietf/ietf_attr.c b/src/libimcv/ietf/ietf_attr.c
index cfac6ed17..074bd11c7 100644
--- a/src/libimcv/ietf/ietf_attr.c
+++ b/src/libimcv/ietf/ietf_attr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2015 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
@@ -28,7 +28,8 @@
#include "generic/generic_attr_bool.h"
-ENUM(ietf_attr_names, IETF_ATTR_TESTING, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
+ENUM_BEGIN(ietf_attr_names, IETF_ATTR_TESTING,
+ IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
"Testing",
"Attribute Request",
"Product Information",
@@ -43,6 +44,20 @@ ENUM(ietf_attr_names, IETF_ATTR_TESTING, IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
"Forwarding Enabled",
"Factory Default Password Enabled",
);
+ENUM_NEXT(ietf_attr_names, IETF_ATTR_SW_REQUEST,
+ IETF_ATTR_SRC_METADATA_RESP,
+ IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
+ "SW Request",
+ "SW Identifier Inventory",
+ "SW Identifier Events",
+ "SW Inventory",
+ "SW Events",
+ "SW Subscription Status Request",
+ "SW Subscription Status Response",
+ "SW Source Metadata Request",
+ "SW Source Metadata Response",
+);
+ENUM_END(ietf_attr_names, IETF_ATTR_SRC_METADATA_RESP);
/**
* See header
@@ -81,6 +96,16 @@ pa_tnc_attr_t* ietf_attr_create_from_data(uint32_t type, size_t length,
pen_type_create(PEN_IETF, type));
case IETF_ATTR_TESTING:
case IETF_ATTR_RESERVED:
+ /* unsupported IETF/SWIMA attributes */
+ case IETF_ATTR_SW_REQUEST:
+ case IETF_ATTR_SW_ID_INVENTORY:
+ case IETF_ATTR_SW_ID_EVENTS:
+ case IETF_ATTR_SW_INVENTORY:
+ case IETF_ATTR_SW_EVENTS:
+ case IETF_ATTR_SUBSCRIPTION_STATUS_REQ:
+ case IETF_ATTR_SUBSCRIPTION_STATUS_RESP:
+ case IETF_ATTR_SRC_METADATA_REQ:
+ case IETF_ATTR_SRC_METADATA_RESP:
default:
return NULL;
}
diff --git a/src/libimcv/ietf/ietf_attr.h b/src/libimcv/ietf/ietf_attr.h
index 7154674af..d2ea98201 100644
--- a/src/libimcv/ietf/ietf_attr.h
+++ b/src/libimcv/ietf/ietf_attr.h
@@ -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
@@ -28,9 +28,11 @@
typedef enum ietf_attr_t ietf_attr_t;
/**
- * IETF standard PA-TNC attribute types defined by RFC 5792
+ * IETF standard PA-TNC attribute types
*/
enum ietf_attr_t {
+
+ /* RFC 5792 */
IETF_ATTR_TESTING = 0,
IETF_ATTR_ATTRIBUTE_REQUEST = 1,
IETF_ATTR_PRODUCT_INFORMATION = 2,
@@ -44,6 +46,18 @@ enum ietf_attr_t {
IETF_ATTR_REMEDIATION_INSTRUCTIONS = 10,
IETF_ATTR_FORWARDING_ENABLED = 11,
IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED = 12,
+
+ /* draft-ietf-sacm-nea-swid-patnc */
+ IETF_ATTR_SW_REQUEST = 17,
+ IETF_ATTR_SW_ID_INVENTORY = 18,
+ IETF_ATTR_SW_ID_EVENTS = 19,
+ IETF_ATTR_SW_INVENTORY = 20,
+ IETF_ATTR_SW_EVENTS = 21,
+ IETF_ATTR_SUBSCRIPTION_STATUS_REQ = 22,
+ IETF_ATTR_SUBSCRIPTION_STATUS_RESP = 23,
+ IETF_ATTR_SRC_METADATA_REQ = 24,
+ IETF_ATTR_SRC_METADATA_RESP = 25,
+
IETF_ATTR_RESERVED = 0xffffffff,
};
diff --git a/src/libimcv/ietf/ietf_attr_pa_tnc_error.c b/src/libimcv/ietf/ietf_attr_pa_tnc_error.c
index 0dbb4aaef..8f216282a 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;
diff --git a/src/libimcv/ietf/ietf_attr_pa_tnc_error.h b/src/libimcv/ietf/ietf_attr_pa_tnc_error.h
index b1df1945a..9a882763e 100644
--- a/src/libimcv/ietf/ietf_attr_pa_tnc_error.h
+++ b/src/libimcv/ietf/ietf_attr_pa_tnc_error.h
@@ -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
@@ -27,15 +27,23 @@ typedef enum pa_tnc_error_code_t pa_tnc_error_code_t;
#include "ietf_attr.h"
#include "pa_tnc/pa_tnc_attr.h"
-
/**
* IETF Standard PA-TNC Error Codes as defined in section 4.2.8 of RFC 5792
*/
enum pa_tnc_error_code_t {
- PA_ERROR_RESERVED = 0,
- PA_ERROR_INVALID_PARAMETER = 1,
- PA_ERROR_VERSION_NOT_SUPPORTED = 2,
- PA_ERROR_ATTR_TYPE_NOT_SUPPORTED = 3,
+
+ /* RFC 5792 PA-TNC */
+ PA_ERROR_RESERVED = 0,
+ PA_ERROR_INVALID_PARAMETER = 1,
+ PA_ERROR_VERSION_NOT_SUPPORTED = 2,
+ PA_ERROR_ATTR_TYPE_NOT_SUPPORTED = 3,
+
+ /* draft-ietf-sacm-nea-swid-patnc (SWIMA) */
+ PA_ERROR_SW = 32,
+ PA_ERROR_SW_SUBSCRIPTION_DENIED = 33,
+ PA_ERROR_SW_RESPONSE_TOO_LARGE = 34,
+ PA_ERROR_SW_SUBSCRIPTION_FULFILLMENT = 35,
+ PA_ERROR_SW_SUBSCRIPTION_ID_REUSE = 36
};
/**