Catch AIK errors
[strongswan.git] / src / libpts / plugins / imv_attestation / imv_attestation_state.c
index c2adbf5..9304b9a 100644 (file)
@@ -162,6 +162,12 @@ static imv_lang_string_t reason_file_meas_pend[] = {
        { NULL, NULL }
 };
 
+static imv_lang_string_t reason_no_trusted_aik[] = {
+       { "en", "No trusted AIK available" },
+       { "de", "Kein vetrauensw├╝rdiger AIK verf├╝gbar" },
+       { NULL, NULL }
+};
+
 static imv_lang_string_t reason_comp_evid_fail[] = {
        { "en", "Incorrect component evidence" },
        { "de", "Falsche Komponenten-Evidenz" },
@@ -307,6 +313,10 @@ METHOD(imv_attestation_state_t, add_file_meas_reasons, void,
 METHOD(imv_attestation_state_t, add_comp_evid_reasons, void,
        private_imv_attestation_state_t *this, imv_reason_string_t *reason_string)
 {
+       if (this->measurement_error & IMV_ATTESTATION_ERROR_NO_TRUSTED_AIK)
+       {
+               reason_string->add_reason(reason_string, reason_no_trusted_aik);
+       }
        if (this->measurement_error & IMV_ATTESTATION_ERROR_COMP_EVID_FAIL)
        {
                reason_string->add_reason(reason_string, reason_comp_evid_fail);
@@ -501,12 +511,6 @@ METHOD(imv_attestation_state_t, finalize_components, void,
        }
 }
 
-METHOD(imv_attestation_state_t, components_finalized, bool,
-       private_imv_attestation_state_t *this)
-{
-       return this->components->get_count(this->components) == 0;
-}
-
 /**
  * Described in header.
  */
@@ -544,7 +548,6 @@ imv_state_t *imv_attestation_state_create(TNC_ConnectionID connection_id)
                        .create_component_enumerator = _create_component_enumerator,
                        .get_component = _get_component,
                        .finalize_components = _finalize_components,
-                       .components_finalized = _components_finalized,
                        .get_measurement_error = _get_measurement_error,
                        .set_measurement_error = _set_measurement_error,
                        .add_file_meas_reasons = _add_file_meas_reasons,