mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-18 00:40:26 +00:00
tresor_tester: check uninitialized vba data
Adds a new command attribute "uninitialized_data" to the Tresor Tester configuration. If a <request op="read"> command has this attribute set to "yes" it assumes the read blocks to be uninitialized and therefore contain only 0's. Note, that a command that has "uninitialized_data" set to "yes" cannot have the attribute "salt". Ref #5077
This commit is contained in:
parent
4a68f6bf75
commit
81b17ba1e4
repos/gems
@ -257,6 +257,8 @@ append config {
|
|||||||
|
|
||||||
<log string="Step 2: test synchronous write, read"/>
|
<log string="Step 2: test synchronous write, read"/>
|
||||||
|
|
||||||
|
|
||||||
|
<request op="read" vba="1" num_blocks="1" uninitialized_data="yes"/>
|
||||||
<request op="write" vba="1" num_blocks="1" salt="1234"/>
|
<request op="write" vba="1" num_blocks="1" salt="1234"/>
|
||||||
<request op="read" vba="1" num_blocks="1" salt="1234"/>
|
<request op="read" vba="1" num_blocks="1" salt="1234"/>
|
||||||
<request op="write" vba="12" num_blocks="10" />
|
<request op="write" vba="12" num_blocks="10" />
|
||||||
@ -402,6 +404,7 @@ append config {
|
|||||||
|
|
||||||
<log string="Step 9: test synchronous rekeying"/>
|
<log string="Step 9: test synchronous rekeying"/>
|
||||||
|
|
||||||
|
<request op="read" vba="30" num_blocks="10" uninitialized_data="yes"/>
|
||||||
<request op="write" vba="0" num_blocks="1" salt="4359"/>
|
<request op="write" vba="0" num_blocks="1" salt="4359"/>
|
||||||
<request op="rekey" sync="yes"/>
|
<request op="rekey" sync="yes"/>
|
||||||
<request op="read" vba="0" num_blocks="1" salt="4359"/>
|
<request op="read" vba="0" num_blocks="1" salt="4359"/>
|
||||||
|
@ -214,6 +214,7 @@ struct Tresor_tester::Request_node : Noncopyable
|
|||||||
bool const salt_avail;
|
bool const salt_avail;
|
||||||
Salt const salt;
|
Salt const salt;
|
||||||
Snapshot_id const snap_id;
|
Snapshot_id const snap_id;
|
||||||
|
bool const uninitialized_data;
|
||||||
|
|
||||||
Operation read_op_attr(Xml_node const &node)
|
Operation read_op_attr(Xml_node const &node)
|
||||||
{
|
{
|
||||||
@ -238,7 +239,8 @@ struct Tresor_tester::Request_node : Noncopyable
|
|||||||
sync(node.attribute_value("sync", false)),
|
sync(node.attribute_value("sync", false)),
|
||||||
salt_avail(node.has_attribute("salt")),
|
salt_avail(node.has_attribute("salt")),
|
||||||
salt(node.attribute_value("salt", (Salt)0)),
|
salt(node.attribute_value("salt", (Salt)0)),
|
||||||
snap_id(node.attribute_value("id", (Snapshot_id)0))
|
snap_id(node.attribute_value("id", (Snapshot_id)0)),
|
||||||
|
uninitialized_data { node.attribute_value("uninitialized_data", false) }
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1010,14 +1012,17 @@ class Tresor_tester::Main : Vfs::Env::User, Client_data_interface, Crypto_key_fi
|
|||||||
_with_command(attr.in_req_tag, [&] (Command &cmd) {
|
_with_command(attr.in_req_tag, [&] (Command &cmd) {
|
||||||
ASSERT(cmd.type == Command::REQUEST);
|
ASSERT(cmd.type == Command::REQUEST);
|
||||||
Request_node const &node { *cmd.request_node };
|
Request_node const &node { *cmd.request_node };
|
||||||
if (node.salt_avail) {
|
Tresor::Block gen_blk_data { };
|
||||||
Tresor::Block gen_blk_data { };
|
if (node.salt_avail)
|
||||||
_generate_blk_data(gen_blk_data, attr.in_vba, node.salt);
|
_generate_blk_data(gen_blk_data, attr.in_vba, node.salt);
|
||||||
|
else if (node.uninitialized_data)
|
||||||
|
memset(&gen_blk_data, 0, BLOCK_SIZE);
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
if (memcmp(&attr.in_blk, &gen_blk_data, BLOCK_SIZE)) {
|
if (memcmp(&attr.in_blk, &gen_blk_data, BLOCK_SIZE)) {
|
||||||
warning("client data mismatch: vba=", attr.in_vba, " req_tag=", attr.in_req_tag);
|
warning("client data mismatch: vba=", attr.in_vba, " req_tag=", attr.in_req_tag);
|
||||||
_num_errors++;
|
_num_errors++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (_benchmark.constructed())
|
if (_benchmark.constructed())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user