]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
make sending of IETF Assessment Result attributes configurable
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Sep 2012 21:24:23 +0000 (23:24 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Sep 2012 21:24:23 +0000 (23:24 +0200)
src/libimcv/imv/imv_agent.c
testing/tests/tnc/tnccs-11-radius-block/hosts/alice/etc/strongswan.conf
testing/tests/tnc/tnccs-11-radius/hosts/alice/etc/strongswan.conf

index 1ec5ba00293f19c9446ee85ae0b76b24b20f38be..d098595629e41711b7aa153a62177cc033fae997 100644 (file)
@@ -734,18 +734,20 @@ METHOD(imv_agent_t, provide_recommendation, TNC_Result,
                }
        }
 
-       /* Send and IETF Assessment Result attribute */
-       attr = ietf_attr_assess_result_create(eval);
-       attr_list = linked_list_create();
-       attr_list->insert_last(attr_list, attr);
-       result = send_message(this, connection_id, FALSE, this->id, dst_imc_id,
-                                                 attr_list);
-       attr_list->destroy(attr_list);
-       if (result != TNC_RESULT_SUCCESS)
-       {
-               return result;
+       /* Send an IETF Assessment Result attribute if enabled */
+       if (lib->settings->get_bool(lib->settings, "libimcv.assessment_result", TRUE))
+       {
+               attr = ietf_attr_assess_result_create(eval);
+               attr_list = linked_list_create();
+               attr_list->insert_last(attr_list, attr);
+               result = send_message(this, connection_id, FALSE, this->id, dst_imc_id,
+                                                         attr_list);
+               attr_list->destroy(attr_list);
+               if (result != TNC_RESULT_SUCCESS)
+               {
+                       return result;
+               }
        }
-
        return this->provide_recommendation(this->id, connection_id, rec, eval);
 }
 
index acd4630d278786216c84a5978fbf27b7f0b7927e..06c34ed9a545d24c08fce7faffa19662989f7be0 100644 (file)
@@ -2,6 +2,7 @@
 
 libimcv {
   debug_level = 3
+  assessment_result = no
   plugins {
     imv-scanner {
       closed_port_policy = no
index 5d586066b6e1d516a2668fa5694f2fc3a9bc6dec..3d7f6c6a4720565fb8d794f559e59253488151bc 100644 (file)
@@ -2,6 +2,7 @@
 
 libimcv {
   debug_level = 3 
+  assessment_result = no
   plugins {
     imv-test {
       rounds = 1