diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2012-08-07 15:05:59 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2012-08-07 15:06:12 +0200 |
commit | fa1baac31565ea247a89dc4c73a0055e1459422a (patch) | |
tree | f007c139e7a2ba38a6899a19f1df35fa72619f30 /src | |
parent | 9c2f08860da03ceb614125ed969df6ab1caa3784 (diff) | |
download | strongswan-fa1baac31565ea247a89dc4c73a0055e1459422a.tar.bz2 strongswan-fa1baac31565ea247a89dc4c73a0055e1459422a.tar.xz |
implemented deletion of product_file database entries
Diffstat (limited to 'src')
-rw-r--r-- | src/libpts/plugins/imv_attestation/attest_db.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/libpts/plugins/imv_attestation/attest_db.c b/src/libpts/plugins/imv_attestation/attest_db.c index 0235aaf86..6f9b4add1 100644 --- a/src/libpts/plugins/imv_attestation/attest_db.c +++ b/src/libpts/plugins/imv_attestation/attest_db.c @@ -1273,19 +1273,6 @@ METHOD(attest_db_t, delete, bool, { bool success; - /* delete key/component pair */ - if (this->kid && this->cid) - { - success = this->db->execute(this->db, NULL, - "DELETE FROM key_component " - "WHERE key = ? AND component = ?", - DB_UINT, this->kid, DB_UINT, this->cid) > 0; - - printf("key/component pair (%d/%d) %sdeleted from database\n", - this->kid, this->cid, success ? "" : "could not be "); - return success; - } - /* delete a file measurement hash for a given product */ if (this->algo && this->pid && this->fid) { @@ -1305,12 +1292,23 @@ METHOD(attest_db_t, delete, bool, return success; } + /* delete product/file entries */ if (this->pid && (this->fid || this->did)) { - printf("deletion of product/file entries not supported yet\n"); - return FALSE; + success = this->db->execute(this->db, NULL, + "DELETE FROM product_file " + "WHERE product = ? AND file = ?", + DB_UINT, this->pid, + DB_UINT, this->fid ? this->fid : this->did) > 0; + + printf("product/file pair (%d/%d) %sdeleted from database\n", + this->pid, this->fid ? this->fid : this->did, + success ? "" : "could not be "); + + return success; } + /* delete key/component pair */ if (this->kid && this->cid) { success = this->db->execute(this->db, NULL, |