diff options
author | Sansar Choinyambuu <schoinya@hsr.ch> | 2011-08-26 14:14:43 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-09-08 12:08:14 +0200 |
commit | 86f1cd15b8a8e2ed0c64cb3d79c43c5f6e002b28 (patch) | |
tree | b83123ecf4d4fba7858be8e22afd179c5abca55b /src/libimcv/tcg/pts | |
parent | 2db719a50920bb77d6f445a339c24b84931533fe (diff) | |
download | strongswan-86f1cd15b8a8e2ed0c64cb3d79c43c5f6e002b28.tar.bz2 strongswan-86f1cd15b8a8e2ed0c64cb3d79c43c5f6e002b28.tar.xz |
Deleted switch statement for hashing algorithms, using the integer field directly for the query
Diffstat (limited to 'src/libimcv/tcg/pts')
-rw-r--r-- | src/libimcv/tcg/pts/pts_database.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/libimcv/tcg/pts/pts_database.c b/src/libimcv/tcg/pts/pts_database.c index 00ec97739..ea2fa1192 100644 --- a/src/libimcv/tcg/pts/pts_database.c +++ b/src/libimcv/tcg/pts/pts_database.c @@ -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; } |