check if TNC client has a valid and registered AIK
[strongswan.git] / src / libpts / plugins / imv_attestation / imv_attestation.c
index 4aa3936..6bd5984 100644 (file)
@@ -352,6 +352,17 @@ static TNC_Result receive_message(TNC_IMVID imv_id,
        }
        attr_list->destroy(attr_list);
 
+       /* check the IMV state for the next PA-TNC attributes to send */
+       result = send_message(connection_id);
+       if (result != TNC_RESULT_SUCCESS)
+       {
+               state->set_recommendation(state,
+                                                               TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION,
+                                                               TNC_IMV_EVALUATION_RESULT_ERROR);
+               return imv_attestation->provide_recommendation(imv_attestation,
+                                                                                                          connection_id);
+       }
+
        if (attestation_state->get_handshake_state(attestation_state) ==
                IMV_ATTESTATION_STATE_END)
        {
@@ -383,7 +394,7 @@ static TNC_Result receive_message(TNC_IMVID imv_id,
                                                                                                           connection_id);
        }
 
-       return send_message(connection_id);
+       return result;
 }
 
 /**