sub-component depth from pts database on component evidence request

component hashes are entries in file_hashes table
implemented verify function of tboot component
This commit is contained in:
Sansar Choinyambuu
2011-11-28 21:22:51 +01:00
committed by Andreas Steffen
parent a169fe7793
commit 824a7824dc
13 changed files with 154 additions and 60 deletions
@@ -377,7 +377,7 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, linked_list_t *attr_list,
"support sub component measurements");
return FALSE;
}
comp = pts_components->create(pts_components, name);
comp = pts_components->create(pts_components, name, depth);
if (!comp)
{
DBG2(DBG_IMC, " not registered: no evidence provided");
+46 -22
View File
@@ -176,6 +176,18 @@ INSERT INTO files (
0, '/etc/tnc_config', 1
);
INSERT INTO files (
type, path
) VALUES (
0, 'tboot_pcr17'
);
INSERT INTO files (
type, path
) VALUES (
0, 'tboot_pcr18'
);
/* Components */
INSERT INTO components (
@@ -306,6 +318,18 @@ INSERT INTO product_file (
4, 22
);
INSERT INTO product_file (
product, file
) VALUES (
4, 23
);
INSERT INTO product_file (
product, file
) VALUES (
4, 24
);
INSERT INTO product_file (
product, file
) VALUES (
@@ -402,30 +426,30 @@ INSERT INTO product_file (
7, 22
);
INSERT INTO product_file (
product, file
) VALUES (
7, 23
);
INSERT INTO product_file (
product, file
) VALUES (
7, 24
);
/* Product Component */
INSERT INTO product_component (
product, component, sequence
product, component, depth, sequence
) VALUES (
4, 1, 1
4, 2, 0, 2
);
INSERT INTO product_component (
product, component, sequence
product, component, depth, sequence
) VALUES (
4, 2, 2
);
INSERT INTO product_component (
product, component, sequence
) VALUES (
7, 1, 1
);
INSERT INTO product_component (
product, component, sequence
) VALUES (
7, 2, 2
7, 2, 0, 2
);
/* File Hashes */
@@ -1295,14 +1319,14 @@ INSERT INTO file_hashes (
20, 7, 7, 8192, X'84200bd318bb022915150842ddf4002e061ef593604ad0d07021dc662cc40bfa749cce084ddf25d0e5137f6380f613d8'
);
INSERT INTO component_hashes (
component, product, algo, hash
INSERT INTO file_hashes (
file, product, component, algo, hash
) VALUES (
2, 4, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902'
23, 4, 2, 32768, X'9704353630674bfe21b86b64a7b0f99c297cf902'
);
INSERT INTO component_hashes (
component, product, algo, hash
INSERT INTO file_hashes (
file, product, component, algo, hash
) VALUES (
2, 4, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0'
24, 4, 2, 32768, X'8397d8048ee36d7955e38da16fc33e86ef61d6b0'
);
@@ -215,6 +215,7 @@ bool imv_attestation_build(pa_tnc_msg_t *msg,
pts_comp_func_name_t *comp_name;
int vid, name, qualifier;
u_int8_t flags;
u_int32_t depth;
bool first = TRUE;
attestation_state->set_handshake_state(attestation_state,
@@ -237,12 +238,13 @@ bool imv_attestation_build(pa_tnc_msg_t *msg,
break;
}
DBG2(DBG_IMV, "evidence request by");
while (enumerator->enumerate(enumerator, &vid, &name, &qualifier))
while (enumerator->enumerate(enumerator, &vid, &name,
&qualifier, &depth))
{
comp_name = pts_comp_func_name_create(vid, name, qualifier);
comp_name->log(comp_name, " ");
comp = pts_components->create(pts_components, comp_name);
comp = pts_components->create(pts_components, comp_name, depth);
if (!comp)
{
DBG2(DBG_IMV, " not registered: removed from request");
@@ -259,7 +261,7 @@ bool imv_attestation_build(pa_tnc_msg_t *msg,
flags = comp->get_evidence_flags(comp);
/* TODO check flags against negotiated_caps */
attr_cast = (tcg_pts_attr_req_func_comp_evid_t *)attr;
attr_cast->add_component(attr_cast, flags, 0, comp_name);
attr_cast->add_component(attr_cast, flags, depth, comp_name);
}
enumerator->destroy(enumerator);
+3 -11
View File
@@ -38,6 +38,7 @@ DROP TABLE IF EXISTS product_component;
CREATE TABLE product_component (
product INTEGER NOT NULL,
component INTEGER NOT NULL,
depth INTEGER DEFAULT 0,
sequence INTEGER DEFAULT 0,
PRIMARY KEY (product, component)
);
@@ -47,17 +48,8 @@ CREATE TABLE file_hashes (
file INTEGER NOT NULL,
directory INTEGER DEFAULT 0,
product INTEGER NOT NULL,
component INTEGER DEFAULT 0,
algo INTEGER NOT NULL,
hash BLOB NOT NULL,
PRIMARY KEY(file, directory, product, algo)
PRIMARY KEY(file, directory, product, component, algo)
);
DROP TABLE IF EXISTS component_hashes;
CREATE TABLE component_hashes (
component INTEGER NOT NULL,
product INTEGER NOT NULL,
algo INTEGER NOT NULL,
hash BLOB NOT NULL,
PRIMARY KEY(component, product, algo)
);