aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libpts/plugins/imv_attestation/imv_attestation_build.c7
-rw-r--r--src/libpts/plugins/imv_attestation/imv_attestation_state.c9
-rw-r--r--src/libpts/plugins/imv_attestation/imv_attestation_state.h7
3 files changed, 19 insertions, 4 deletions
diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_build.c b/src/libpts/plugins/imv_attestation/imv_attestation_build.c
index 4f2cc1e95..a44e93351 100644
--- a/src/libpts/plugins/imv_attestation/imv_attestation_build.c
+++ b/src/libpts/plugins/imv_attestation/imv_attestation_build.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Sansar Choinyambuu
+ * Copyright (C) 2011-2012 Sansar Choinyambuu, Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -290,8 +290,11 @@ bool imv_attestation_build(linked_list_t *attr_list,
break;
}
case IMV_ATTESTATION_STATE_EVID_FINAL:
- attestation_state->set_handshake_state(attestation_state,
+ if (attestation_state->components_finalized(attestation_state))
+ {
+ attestation_state->set_handshake_state(attestation_state,
IMV_ATTESTATION_STATE_END);
+ }
break;
case IMV_ATTESTATION_STATE_END:
break;
diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_state.c b/src/libpts/plugins/imv_attestation/imv_attestation_state.c
index 00ec14690..a093e63e3 100644
--- a/src/libpts/plugins/imv_attestation/imv_attestation_state.c
+++ b/src/libpts/plugins/imv_attestation/imv_attestation_state.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Sansar Choinyambuu
+ * Copyright (C) 2011-2012 Sansar Choinyambuu, Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -360,6 +360,12 @@ 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.
*/
@@ -392,6 +398,7 @@ imv_state_t *imv_attestation_state_create(TNC_ConnectionID connection_id)
.add_component = _add_component,
.get_component = _get_component,
.finalize_components = _finalize_components,
+ .components_finalized = _components_finalized,
.get_measurement_error = _get_measurement_error,
.set_measurement_error = _set_measurement_error,
},
diff --git a/src/libpts/plugins/imv_attestation/imv_attestation_state.h b/src/libpts/plugins/imv_attestation/imv_attestation_state.h
index 3e08f46a3..1fd983b0f 100644
--- a/src/libpts/plugins/imv_attestation/imv_attestation_state.h
+++ b/src/libpts/plugins/imv_attestation/imv_attestation_state.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Sansar Choinyambuu
+ * Copyright (C) 2011-2012 Sansar Choinyambuu, Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
@@ -127,6 +127,11 @@ struct imv_attestation_state_t {
void (*finalize_components)(imv_attestation_state_t *this);
/**
+ * Have the Functional Component measurements been finalized?
+ */
+ bool (*components_finalized)(imv_attestation_state_t *this);
+
+ /**
* Indicates if a file measurement error occurred
*
* @return TRUE in case of measurement error