fixed measurement rollback
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 00:13:23 +0000 (01:13 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 20:24:00 +0000 (21:24 +0100)
src/libpts/pts/components/ita/ita_comp_ima.c
src/libpts/pts/components/ita/ita_comp_tboot.c
src/libpts/pts/pts_database.c

index 2c9b66a..d7613b2 100644 (file)
@@ -369,6 +369,8 @@ METHOD(pts_component_t, destroy, void,
        pts_ita_comp_ima_t *this)
 {
        int i, count;
+       u_int32_t vid, name;
+       enum_name_t *names;
 
        for (i = 0; i < IMA_PCR_MAX; i++)
        {
@@ -378,7 +380,11 @@ METHOD(pts_component_t, destroy, void,
        {
                count = this->pts_db->delete_comp_measurements(this->pts_db, this->name,
                                                                                                           this->keyid);
-               DBG1(DBG_PTS, "  deleted %d measurements", count);
+               vid = this->name->get_vendor_id(this->name);
+               name = this->name->get_name(this->name);
+               names = pts_components->get_comp_func_names(pts_components, vid);
+               DBG1(DBG_PTS, "deleted %d registered %N '%N' functional component "
+                        "evidence measurements", count, pen_names, vid, names, name);
        }
        this->list->destroy_function(this->list, (void *)free_entry);
        this->name->destroy(this->name);
index c611325..57b8091 100644 (file)
@@ -272,12 +272,18 @@ METHOD(pts_component_t, destroy, void,
           pts_ita_comp_tboot_t *this)
 {
        int count;
+       u_int32_t vid, name;
+       enum_name_t *names;
 
        if (this->is_registering)
        {
                count = this->pts_db->delete_comp_measurements(this->pts_db, this->name,
                                                                                                           this->keyid);
-               DBG1(DBG_PTS, "  deleted %d measurements", count);
+               vid = this->name->get_vendor_id(this->name);
+               name = this->name->get_name(this->name);
+               names = pts_components->get_comp_func_names(pts_components, vid);
+               DBG1(DBG_PTS, "deleted %d registered %N '%N' functional component "
+                        "evidence measurements", count, pen_names, vid, names, name);
        }
        this->name->destroy(this->name);
        free(this->keyid.ptr);
index c34b12c..1b7b00e 100644 (file)
@@ -200,7 +200,7 @@ METHOD(pts_database_t, delete_comp_measurements, int,
                                "DELETE FROM component_hashes WHERE "
                                "component = (SELECT id FROM components"
                                " WHERE vendor_id = ?  AND name = ? AND qualifier = ?) AND "
-                               "key = (SELECT id FROM keys WHERE keyid = ?))",
+                               "key = (SELECT id FROM keys WHERE keyid = ?)",
                                DB_INT, comp_name->get_vendor_id(comp_name),
                                DB_INT, comp_name->get_name(comp_name),
                                DB_INT, comp_name->get_qualifier(comp_name),