]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
SWIMA attribute name changes
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sat, 23 Sep 2017 13:22:52 +0000 (15:22 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 26 Sep 2017 18:35:39 +0000 (20:35 +0200)
draft-ietf-sacm-nea-swima-patnc-01 changes some SWIMA attribute
names.

src/libimcv/ietf/ietf_attr.c
src/libimcv/ietf/ietf_attr.h
src/libimcv/ietf/ietf_attr_pa_tnc_error.c
src/libimcv/ietf/ietf_attr_pa_tnc_error.h
src/libimcv/ietf/swima/ietf_swima_attr_req.c
src/libimcv/plugins/imc_swima/imc_swima.c
src/libimcv/plugins/imv_swima/imv_swima_agent.c
src/libimcv/suites/test_imcv_swima.c
src/libimcv/swima/swima_error.c
src/libtncif/tncif_pa_subtypes.c
src/libtncif/tncif_pa_subtypes.h

index 9e3e83d4dd1ec827a0f0819352d98a88e8ce4c2a..f55884df335c4afc4a17ba457866e7bf22442a10 100644 (file)
@@ -47,7 +47,7 @@ ENUM_BEGIN(ietf_attr_names, IETF_ATTR_TESTING,
        "Forwarding Enabled",
        "Factory Default Password Enabled",
 );
-ENUM_NEXT(ietf_attr_names,  IETF_ATTR_SW_REQUEST,
+ENUM_NEXT(ietf_attr_names,  IETF_ATTR_SWIMA_REQUEST,
                                                        IETF_ATTR_SRC_METADATA_RESP,
                                                        IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED,
        "SW Request",
@@ -97,7 +97,7 @@ pa_tnc_attr_t* ietf_attr_create_from_data(uint32_t type, size_t length,
                case IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED:
                        return generic_attr_bool_create_from_data(length, value,
                                                                        pen_type_create(PEN_IETF, type));
-               case IETF_ATTR_SW_REQUEST:
+               case IETF_ATTR_SWIMA_REQUEST:
                        return ietf_swima_attr_req_create_from_data(length, value);
                case IETF_ATTR_SW_ID_INVENTORY:
                        return ietf_swima_attr_sw_inv_create_from_data(length, value, TRUE);
index d2ea982017a60d123a46b2ed4148a38836576609..cbf4a49a24dc23f67c57bdbd3b87eea2abe7c6fa 100644 (file)
@@ -48,7 +48,7 @@ enum ietf_attr_t {
        IETF_ATTR_FACTORY_DEFAULT_PWD_ENABLED =       12,
 
        /* draft-ietf-sacm-nea-swid-patnc */
-       IETF_ATTR_SW_REQUEST =                        17,
+       IETF_ATTR_SWIMA_REQUEST =                     17,
        IETF_ATTR_SW_ID_INVENTORY =                   18,
        IETF_ATTR_SW_ID_EVENTS =                      19,
        IETF_ATTR_SW_INVENTORY =                      20,
index 966c095e227df96133b92585f817d9d879e6fafe..75f279298bfd46f28a706667cff2bc17c856cba9 100644 (file)
@@ -27,16 +27,16 @@ ENUM_BEGIN(pa_tnc_error_code_names, PA_ERROR_RESERVED,
        "Version Not Supported",
        "Attribute Type Not Supported"
 );
-ENUM_NEXT(pa_tnc_error_code_names,     PA_ERROR_SW,
-                                                                       PA_ERROR_SW_SUBSCRIPTION_ID_REUSE,
+ENUM_NEXT(pa_tnc_error_code_names,     PA_ERROR_SWIMA,
+                                                                       PA_ERROR_SWIMA_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"
+       "SWIMA Error",
+       "SWIMA Subscription Denied",
+       "SWIMA Response Too Large",
+       "SWIMA Subscription Fulfillment Error",
+       "SWIMA Subscription ID Reuse"
 );
-ENUM_END(pa_tnc_error_code_names,      PA_ERROR_SW_SUBSCRIPTION_ID_REUSE);
+ENUM_END(pa_tnc_error_code_names,      PA_ERROR_SWIMA_SUBSCRIPTION_ID_REUSE);
 
 typedef struct private_ietf_attr_pa_tnc_error_t private_ietf_attr_pa_tnc_error_t;
 
index 7dbc3382848ac142065f7c46597fa007b0b45d5d..dd0be72ffc6cc4d31af15fa7cf1b88832b3b7504 100644 (file)
@@ -33,18 +33,18 @@ typedef enum pa_tnc_error_code_t pa_tnc_error_code_t;
 enum  pa_tnc_error_code_t {
 
        /* 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,
-       PA_ERROR_PA_TNC_MSG_ROOF =               3,
+       PA_ERROR_RESERVED =                         0,
+       PA_ERROR_INVALID_PARAMETER =                1,
+       PA_ERROR_VERSION_NOT_SUPPORTED =            2,
+       PA_ERROR_ATTR_TYPE_NOT_SUPPORTED =          3,
+       PA_ERROR_PA_TNC_MSG_ROOF =                  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
+       PA_ERROR_SWIMA =                           32,
+       PA_ERROR_SWIMA_SUBSCRIPTION_DENIED =       33,
+       PA_ERROR_SWIMA_RESPONSE_TOO_LARGE =        34,
+       PA_ERROR_SWIMA_SUBSCRIPTION_FULFILLMENT =  35,
+       PA_ERROR_SWIMA_SUBSCRIPTION_ID_REUSE =     36
 };
 
 /**
index 07d0b0c5fd326e64952ec17621b30c42387d1a1a..d67497373fa303556a228c426c1ee7f344c576a2 100644 (file)
@@ -274,7 +274,7 @@ pa_tnc_attr_t *ietf_swima_attr_req_create(uint8_t flags, uint32_t request_id)
                        .set_targets = _set_targets,
                        .get_targets = _get_targets,
                },
-               .type = { PEN_IETF, IETF_ATTR_SW_REQUEST },
+               .type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST },
                .flags = flags & SW_REQ_RESERVED_MASK,
                .request_id = request_id,
                .targets = swima_inventory_create(),
@@ -309,7 +309,7 @@ pa_tnc_attr_t *ietf_swima_attr_req_create_from_data(size_t length, chunk_t data)
                        .set_targets = _set_targets,
                        .get_targets = _get_targets,
                },
-               .type = { PEN_IETF, IETF_ATTR_SW_REQUEST },
+               .type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST },
                .length = length,
                .value = chunk_clone(data),
                .targets = swima_inventory_create(),
index e120cf7fca3fb7cff7a9c091824c14ff704013ef..67080e0504a5dcaa74d8cb55f8685dfda3518ece 100644 (file)
@@ -35,7 +35,7 @@
 static const char imc_name[] = "SWIMA";
 
 static pen_type_t msg_types[] = {
-       { PEN_IETF, PA_SUBTYPE_IETF_SW }
+       { PEN_IETF, PA_SUBTYPE_IETF_SWIMA }
 };
 
 static imc_agent_t *imc_swima;
@@ -180,7 +180,7 @@ static void fulfill_request(imc_state_t *state, imc_msg_t *msg,
                {
                        snprintf(error_msg, msg_len, "failed to collect SW%s events, "
                                         "fallback to SW%s inventory", id_str, id_str);
-                       attr = swima_error_create(PA_ERROR_SW, request_id, 0, error_msg);
+                       attr = swima_error_create(PA_ERROR_SWIMA, request_id, 0, error_msg);
                        msg->add_attribute(msg, attr);
                }
                else {
@@ -207,7 +207,7 @@ static void fulfill_request(imc_state_t *state, imc_msg_t *msg,
                {
                        snprintf(error_msg, msg_len, "failed to collect SW%s inventory",
                                         id_str);
-                       attr = swima_error_create(PA_ERROR_SW, request_id, 0, error_msg);
+                       attr = swima_error_create(PA_ERROR_SWIMA, request_id, 0, error_msg);
                }
                else
                {
@@ -258,7 +258,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
 
                type = attr->get_type(attr);
 
-               if (type.vendor_id != PEN_IETF || type.type != IETF_ATTR_SW_REQUEST)
+               if (type.vendor_id != PEN_IETF || type.type != IETF_ATTR_SWIMA_REQUEST)
                {
                        continue;
                }
@@ -270,7 +270,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
 
                if (flags & (IETF_SWIMA_ATTR_REQ_FLAG_S | IETF_SWIMA_ATTR_REQ_FLAG_C))
                {
-                       attr = swima_error_create(PA_ERROR_SW_SUBSCRIPTION_DENIED,
+                       attr = swima_error_create(PA_ERROR_SWIMA_SUBSCRIPTION_DENIED,
                                                request_id, 0, "no subscription available yet");
                        out_msg->add_attribute(out_msg, attr);
                        break;
index efa2b11059b1b0c480ce38360821987b9eff0e6f..1d9944200e782f0b83cb42ac1bf256160e1a0365 100644 (file)
@@ -44,7 +44,7 @@ typedef struct private_imv_swima_agent_t private_imv_swima_agent_t;
 
 /* Subscribed PA-TNC message subtypes */
 static pen_type_t msg_types[] = {
-       { PEN_IETF, PA_SUBTYPE_IETF_SW }
+       { PEN_IETF, PA_SUBTYPE_IETF_SWIMA }
 };
 
 /**
@@ -175,7 +175,7 @@ static TNC_Result receive_msg(private_imv_swima_agent_t *this,
                                        reader->destroy(reader);
                                        continue;
                                }
-                               if (error_code.type == PA_ERROR_SW_RESPONSE_TOO_LARGE)
+                               if (error_code.type == PA_ERROR_SWIMA_RESPONSE_TOO_LARGE)
                                {
                                        if (!reader->read_uint32(reader, &max_attr_size))
                                        {
index c54669d1d9b07e54f0340deb26c49b4604475bb8..a579f73789ff4b997a3b0712e9ea6b4bb1e66ec9 100644 (file)
@@ -124,7 +124,7 @@ static req_data_t req_data[] = {
 START_TEST(test_imcv_swima_sw_req)
 {
        pen_type_t type;
-       pen_type_t pen_type = { PEN_IETF, IETF_ATTR_SW_REQUEST };
+       pen_type_t pen_type = { PEN_IETF, IETF_ATTR_SWIMA_REQUEST };
        pa_tnc_attr_t *attr, *attr1, *attr2;
        ietf_swima_attr_req_t *c_attr;
        swima_record_t *target;
index 2aed2966bbb635c6fa8eddca6dc7ab32029a889f..bce4645f017aeb1850592a75bb6d8e9c4ce06f1f 100644 (file)
@@ -59,7 +59,7 @@ pa_tnc_attr_t* swima_error_create(pa_tnc_error_code_t code, uint32_t request_id,
        writer = bio_writer_create(4);
        writer->write_uint32(writer, request_id);
 
-       if (code == PA_ERROR_SW_RESPONSE_TOO_LARGE)
+       if (code == PA_ERROR_SWIMA_RESPONSE_TOO_LARGE)
        {
                writer->write_uint32(writer, max_attr_size);
        }
index 2789e7d3e152b24657efe81669e5b565943242a4..9c58944bb454a7909e7febd3b20d85a0a2ac7aa7 100644 (file)
@@ -16,7 +16,7 @@
 #include "tncif_pa_subtypes.h"
 
 /* IETF PA Subtype names */
-ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SW,
+ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SWIMA,
        "Testing",
        "Operating System",
        "Anti-Virus",
@@ -26,10 +26,10 @@ ENUM_BEGIN(pa_subtype_ietf_names, PA_SUBTYPE_IETF_TESTING, PA_SUBTYPE_IETF_SW,
        "IDPS",
        "VPN",
        "NEA Client",
-       "Software"
+       "SWIMA"
 );
 ENUM_NEXT(pa_subtype_ietf_names, PA_SUBTYPE_IETF_ANY, PA_SUBTYPE_IETF_ANY,
-                                                               PA_SUBTYPE_IETF_SW,
+                                                               PA_SUBTYPE_IETF_SWIMA,
        "ANY"
 );
 ENUM_END(pa_subtype_ietf_names, PA_SUBTYPE_IETF_ANY);
index 6964410297d3eed4fb59b6994006952b557753bc..0eef4ad17dff90ba6df83038361405cb488e3618 100644 (file)
@@ -43,7 +43,7 @@ typedef enum pa_subtype_ita_t pa_subtype_ita_t;
        PA_SUBTYPE_IETF_IDPS =                          0x06,
        PA_SUBTYPE_IETF_VPN =                           0x07,
        PA_SUBTYPE_IETF_NEA_CLIENT =            0x08,
-       PA_SUBTYPE_IETF_SW =                            0x09,
+       PA_SUBTYPE_IETF_SWIMA =                         0x09,
        PA_SUBTYPE_IETF_ANY =                           0xff
 };