diff --git a/src/libimcv/plugins/imv_attestation/data.sql b/src/libimcv/plugins/imv_attestation/data.sql index 28116a5e4..c6e09a049 100644 --- a/src/libimcv/plugins/imv_attestation/data.sql +++ b/src/libimcv/plugins/imv_attestation/data.sql @@ -405,27 +405,27 @@ INSERT INTO product_file ( /* Product Component */ INSERT INTO product_component ( - product, component + product, component, sequence ) VALUES ( - 4, 1 + 4, 1, 1 ); INSERT INTO product_component ( - product, component + product, component, sequence ) VALUES ( - 4, 2 + 4, 2, 2 ); INSERT INTO product_component ( - product, component + product, component, sequence ) VALUES ( - 7, 1 + 7, 1, 1 ); INSERT INTO product_component ( - product, component + product, component, sequence ) VALUES ( - 7, 2 + 7, 2, 2 ); /* File Hashes */ @@ -1296,13 +1296,13 @@ INSERT INTO file_hashes ( ); INSERT INTO component_hashes ( - component, product, sequence, algo, hash + component, product, algo, hash ) VALUES ( - 2, 4, 1, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902' + 2, 4, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902' ); INSERT INTO component_hashes ( - component, product, sequence, algo, hash + component, product, algo, hash ) VALUES ( - 2, 4, 2, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0' + 2, 4, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0' ); diff --git a/src/libimcv/plugins/imv_attestation/tables.sql b/src/libimcv/plugins/imv_attestation/tables.sql index e7b58a5de..a8da57ee6 100644 --- a/src/libimcv/plugins/imv_attestation/tables.sql +++ b/src/libimcv/plugins/imv_attestation/tables.sql @@ -39,7 +39,7 @@ CREATE TABLE product_component ( product INTEGER NOT NULL, component INTEGER NOT NULL, sequence INTEGER DEFAULT 0, - PRIMARY KEY (product, component, sequence) + PRIMARY KEY (product, component) ); DROP TABLE IF EXISTS file_hashes; @@ -56,9 +56,8 @@ DROP TABLE IF EXISTS component_hashes; CREATE TABLE component_hashes ( component INTEGER NOT NULL, product INTEGER NOT NULL, - sequence INTEGER DEFAULT 0, algo INTEGER NOT NULL, hash BLOB NOT NULL, - PRIMARY KEY(component, product, sequence, algo) + PRIMARY KEY(component, product, algo) ); diff --git a/src/libpts/pts/pts_funct_comp_evid_req.h b/src/libpts/pts/pts_func_comp_evid_req.h similarity index 100% rename from src/libpts/pts/pts_funct_comp_evid_req.h rename to src/libpts/pts/pts_func_comp_evid_req.h diff --git a/src/libpts/pts/pts_funct_comp_evid_req.c b/src/libpts/pts/pts_funct_comp_evid_req.c deleted file mode 100644 index 47641fe40..000000000 --- a/src/libpts/pts/pts_funct_comp_evid_req.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2011 Sansar Choinyambuu - * HSR Hochschule fuer Technik Rapperswil - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. See . - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#include "pts_funct_comp_evid_req.h" - -#include -#include - -typedef struct private_pts_funct_comp_evid_req_t private_pts_funct_comp_evid_req_t; - -/** - * Private data of a private_pts_funct_comp_evid_req_t object. - * - */ -struct private_pts_funct_comp_evid_req_t { - - /** - * Public pts_funct_comp_evid_req_t interface. - */ - pts_funct_comp_evid_req_t public; - - /** - * List of Functional Component Evidence Requests - */ - linked_list_t *list; -}; - -METHOD(pts_funct_comp_evid_req_t, get_req_count, int, - private_pts_funct_comp_evid_req_t *this) -{ - return this->list->get_count(this->list); -} - -METHOD(pts_funct_comp_evid_req_t, add, void, - private_pts_funct_comp_evid_req_t *this, - funct_comp_evid_req_entry_t *entry) -{ - this->list->insert_last(this->list, entry); -} - -METHOD(pts_funct_comp_evid_req_t, create_enumerator, enumerator_t*, - private_pts_funct_comp_evid_req_t *this) -{ - return this->list->create_enumerator(this->list); -} - -METHOD(pts_funct_comp_evid_req_t, destroy, void, - private_pts_funct_comp_evid_req_t *this) -{ - this->list->destroy(this->list); - free(this); -} - -/** - * See header - */ -pts_funct_comp_evid_req_t *pts_funct_comp_evid_req_create() -{ - private_pts_funct_comp_evid_req_t *this; - - INIT(this, - .public = { - .get_req_count = _get_req_count, - .add = _add, - .create_enumerator = _create_enumerator, - .destroy = _destroy, - }, - .list = linked_list_create(), - ); - - return &this->public; -} - diff --git a/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c similarity index 100% rename from src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.c rename to src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c diff --git a/src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.h b/src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h similarity index 100% rename from src/libpts/tcg/tcg_pts_attr_req_funct_comp_evid.h rename to src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.h