get_attribute() and set_attribute() are not allowed to use TNC_CONNECTIONID_ANY
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 16 Nov 2010 21:43:48 +0000 (22:43 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 16 Nov 2010 21:43:48 +0000 (22:43 +0100)
src/libcharon/tnc/tnccs/tnccs_manager.c

index c1ba452..14c6480 100644 (file)
@@ -308,7 +308,8 @@ METHOD(tnccs_manager_t, get_attribute, TNC_Result,
        tnccs_connection_entry_t *entry;
        recommendations_t *recs = NULL;
 
-       if (attribute_id != TNC_ATTRIBUTEID_PREFERRED_LANGUAGE)
+       if (id == TNC_CONNECTIONID_ANY ||
+               attribute_id != TNC_ATTRIBUTEID_PREFERRED_LANGUAGE)
        {
                return TNC_RESULT_INVALID_PARAMETER;
        }
@@ -356,8 +357,9 @@ METHOD(tnccs_manager_t, set_attribute, TNC_Result,
        tnccs_connection_entry_t *entry;
        recommendations_t *recs = NULL;
 
-       if (attribute_id != TNC_ATTRIBUTEID_REASON_STRING &&
-               attribute_id != TNC_ATTRIBUTEID_REASON_LANGUAGE)
+       if (id == TNC_CONNECTIONID_ANY ||
+               (attribute_id != TNC_ATTRIBUTEID_REASON_STRING &&
+                attribute_id != TNC_ATTRIBUTEID_REASON_LANGUAGE))
        {
                return TNC_RESULT_INVALID_PARAMETER;
        }