]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
deleted newly constructed attributes in send_assessment
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 24 Dec 2012 11:06:07 +0000 (12:06 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 24 Dec 2012 11:06:12 +0000 (12:06 +0100)
src/libimcv/imv/imv_msg.c
src/libimcv/imv/imv_msg.h
src/libpts/plugins/imv_attestation/imv_attestation.c

index 81209ce57f27b7a424b69194505b2c4e0fc19299..4ed19dd13fde12698dfe3ae11f445374d8e1994a 100644 (file)
@@ -195,6 +195,12 @@ METHOD(imv_msg_t, send_assessment, TNC_Result,
        char *lang_code = NULL, *uri = NULL;
        enumerator_t *e;
 
+       /* Remove any attributes that have already been constructed */
+       while (this->attr_list->remove_last(this->attr_list, (void**)&attr) == SUCCESS)
+       {
+               attr->destroy(attr);
+       }
+
        /* Send an IETF Assessment Result attribute if enabled */
        if (lib->settings->get_bool(lib->settings, "libimcv.assessment_result",
                                                                TRUE))
@@ -306,17 +312,6 @@ METHOD(imv_msg_t, receive, TNC_Result,
        return TNC_RESULT_SUCCESS;
 }
 
-METHOD(imv_msg_t, delete_attributes, void,
-       private_imv_msg_t *this)
-{
-       pa_tnc_attr_t *attr;
-
-       while (this->attr_list->remove_last(this->attr_list, (void**)&attr) == SUCCESS)
-       {
-               attr->destroy(attr);
-       }
-}
-
 METHOD(imv_msg_t, create_attribute_enumerator, enumerator_t*,
        private_imv_msg_t *this)
 {
@@ -361,7 +356,6 @@ imv_msg_t *imv_msg_create(imv_agent_t *agent, imv_state_t *state,
                        .send_assessment = _send_assessment,
                        .receive = _receive,
                        .add_attribute = _add_attribute,
-                       .delete_attributes = _delete_attributes,
                        .create_attribute_enumerator = _create_attribute_enumerator,
                        .get_encoding = _get_encoding,
                        .destroy = _destroy,
index 92347934f0399c87cc65649006a36e7fdf527ce8..b639712e88779e9c411e7e6fc78a0dd86f0c3635 100644 (file)
@@ -84,12 +84,6 @@ struct imv_msg_t {
         */
        void (*add_attribute)(imv_msg_t *this, pa_tnc_attr_t *attr);
 
-       /**
-        * Delete all PA-TNC attributes in the send queue
-        *
-        */
-       void (*delete_attributes)(imv_msg_t *this);
-
        /**
         * Enumerator over PA-TNC attributes contained in the PA-TNC message
         *
index 237300f312964471665f709f328077659ed90bcc..3c5488ebaa2561cf7e4bc163e4f5a26b925b6096 100644 (file)
@@ -285,9 +285,8 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
 
        if (fatal_error || result != TNC_RESULT_SUCCESS)
        {
-               out_msg->delete_attributes(out_msg);
                state->set_recommendation(state,
-                                                               TNC_IMV_ACTION_RECOMMENDATION_ISOLATE,
+                                                               TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
                                                                TNC_IMV_EVALUATION_RESULT_ERROR);
                result = out_msg->send_assessment(out_msg);
                out_msg->destroy(out_msg);
@@ -315,7 +314,6 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
                state->set_recommendation(state,
                                                                TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
                                                                TNC_IMV_EVALUATION_RESULT_ERROR);
-               out_msg->delete_attributes(out_msg);
                result = out_msg->send_assessment(out_msg);
                out_msg->destroy(out_msg);
                if (result != TNC_RESULT_SUCCESS)