use base IMC ID if src IMC ID is not supported
authorAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Sep 2012 22:07:54 +0000 (00:07 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Sun, 9 Sep 2012 22:07:54 +0000 (00:07 +0200)
src/libimcv/plugins/imc_scanner/imc_scanner.c
src/libimcv/plugins/imc_test/imc_test.c
src/libpts/plugins/imc_attestation/imc_attestation.c

index 7f8b047..58533ea 100644 (file)
@@ -282,6 +282,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        imc_state_t *state;
        enumerator_t *enumerator;
        TNC_Result result;
+       TNC_UInt32 target_imc_id;
        bool fatal_error;
 
        if (!imc_scanner)
@@ -305,6 +306,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        {
                return result;
        }
+       target_imc_id = (dst_imc_id == TNC_IMCID_ANY) ? imc_id : dst_imc_id;
 
        /* preprocess any IETF standard error attributes */
        fatal_error = pa_tnc_msg->process_ietf_std_errors(pa_tnc_msg);
@@ -321,7 +323,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
                        ietf_attr_assess_result_t *ietf_attr;
 
                        ietf_attr = (ietf_attr_assess_result_t*)attr;
-                       state->set_result(state, dst_imc_id,
+                       state->set_result(state, target_imc_id,
                                                          ietf_attr->get_result(ietf_attr));
                }
        }
@@ -334,7 +336,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        }
 
        /* if no assessment result is known then repeat the measurement */
-       return state->get_result(state, dst_imc_id, NULL) ?
+       return state->get_result(state, target_imc_id, NULL) ?
                   TNC_RESULT_SUCCESS : send_message(connection_id);
 }
 
index 6283309..ee8e5b2 100644 (file)
@@ -284,6 +284,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        imc_state_t *state;
        enumerator_t *enumerator;
        TNC_Result result;
+       TNC_UInt32 target_imc_id;
        bool fatal_error = FALSE;
 
        if (!imc_test)
@@ -307,6 +308,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        {
                return result;
        }
+       target_imc_id = (dst_imc_id == TNC_IMCID_ANY) ? imc_id : dst_imc_id;
 
        /* preprocess any IETF standard error attributes */
        fatal_error = pa_tnc_msg->process_ietf_std_errors(pa_tnc_msg);
@@ -322,7 +324,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
                        ietf_attr_assess_result_t *ietf_attr;
 
                        ietf_attr = (ietf_attr_assess_result_t*)attr;
-                       state->set_result(state, dst_imc_id,
+                       state->set_result(state, target_imc_id,
                                                          ietf_attr->get_result(ietf_attr));
                }
                else if (attr_type.vendor_id == PEN_ITA)
@@ -354,7 +356,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        }
 
        /* if no assessment result is known then repeat the measurement */
-       return state->get_result(state, dst_imc_id, NULL) ?
+       return state->get_result(state, target_imc_id, NULL) ?
                   TNC_RESULT_SUCCESS : send_message(state, dst_imc_id, src_imv_id);
 }
 
index c3df278..7cb2a06 100644 (file)
@@ -189,6 +189,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        imc_attestation_state_t *attestation_state;
        enumerator_t *enumerator;
        TNC_Result result;
+       TNC_UInt32 target_imc_id;
 
        if (!imc_attestation)
        {
@@ -212,6 +213,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
        {
                return result;
        }
+       target_imc_id = (dst_imc_id == TNC_IMCID_ANY) ? imc_id : dst_imc_id;
        
        /* preprocess any IETF standard error attributes */
        result = pa_tnc_msg->process_ietf_std_errors(pa_tnc_msg) ?
@@ -252,7 +254,7 @@ static TNC_Result receive_message(TNC_IMCID imc_id,
                                ietf_attr_assess_result_t *ietf_attr;
 
                                ietf_attr = (ietf_attr_assess_result_t*)attr;
-                               state->set_result(state, dst_imc_id,
+                               state->set_result(state, target_imc_id,
                                                                  ietf_attr->get_result(ietf_attr));
                        }
                }