Deleted switch statement for hashing algorithms, using the integer field directly...
authorSansar Choinyambuu <schoinya@hsr.ch>
Fri, 26 Aug 2011 12:14:43 +0000 (14:14 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Thu, 8 Sep 2011 10:08:14 +0000 (12:08 +0200)
src/libimcv/tcg/pts/pts_database.c

index 00ec977..ea2fa11 100644 (file)
@@ -58,20 +58,6 @@ METHOD(pts_database_t, create_meas_enumerator, enumerator_t*,
        private_pts_database_t *this, char *product, int id, pts_meas_algorithms_t algorithm)
 {
        enumerator_t *e;
-       int algo = 0;
-       
-       switch(algorithm)
-       {
-               case PTS_MEAS_ALGO_SHA1:
-                       algo = 32768;
-                       break;
-               case PTS_MEAS_ALGO_SHA256:
-                       algo = 16384;
-                       break;
-               case PTS_MEAS_ALGO_SHA384:
-                       algo = 8192;
-                       break;
-       }
        
        /* look for all entries belonging to a product and file in file_hashes table */
        e = this->db->query(this->db,
@@ -79,7 +65,7 @@ METHOD(pts_database_t, create_meas_enumerator, enumerator_t*,
                                "JOIN files AS f ON fh.file = f.id "
                                "JOIN products AS p ON fh.product = p.id "
                                "WHERE p.name = ? AND f.id = ? AND fh.algo = ?",
-                               DB_TEXT, product, DB_INT, id, DB_INT, algo, DB_BLOB);
+                               DB_TEXT, product, DB_INT, id, DB_INT, algorithm, DB_BLOB);
        return e;
 }