handling of missing component measurement
authorSansar Choinyambuu <schoinya@hsr.ch>
Wed, 23 Nov 2011 14:12:18 +0000 (15:12 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 20:22:51 +0000 (21:22 +0100)
src/libpts/pts/components/ita/ita_comp_tboot.c

index 5ab6dc8..c27401b 100644 (file)
@@ -191,6 +191,16 @@ METHOD(pts_component_t, verify, status_t,
        /* check measurement in database */
        enumerator = pts_db->create_comp_hash_enumerator(pts_db, file,
                                                                platform_info, this->name, TRUSTED_HASH_ALGO);
+       if (!enumerator->enumerate(enumerator, &hash))
+       {
+               DBG1(DBG_PTS, "No Measurement found in database for component:%s ,"
+                       " on platform: %s with hashing algorithm: %N",
+                       file, platform_info, pts_meas_algorithm_names, TRUSTED_HASH_ALGO);
+       }
+       enumerator->destroy(enumerator);
+
+       enumerator = pts_db->create_comp_hash_enumerator(pts_db, file,
+                                                               platform_info, this->name, TRUSTED_HASH_ALGO);
        while (enumerator->enumerate(enumerator, &hash))
        {
                if (!chunk_equals(hash, measurement))