tf_fuzz: remove duplicate crypto policy fields
Remove unused fields from policy_asset and key_asset that are duplicates
of information in the superclass, crypto_asset::policy.
Change-Id: I233b3ddedf87d0a2903e554121b91200fd1ec4ce
Signed-off-by: Nik Dewally <Nik.Dewally@arm.com>
diff --git a/tf_fuzz/tfz-cpp/assets/crypto_asset.cpp b/tf_fuzz/tfz-cpp/assets/crypto_asset.cpp
index e1efdb1..7c493af 100644
--- a/tf_fuzz/tfz-cpp/assets/crypto_asset.cpp
+++ b/tf_fuzz/tfz-cpp/assets/crypto_asset.cpp
@@ -7,7 +7,6 @@
#include <stdlib.h>
-#include "randomization.hpp"
#include "gibberish.hpp"
#include "crypto_asset.hpp"
@@ -39,10 +38,7 @@
policy_asset::policy_asset (void) // (default constructor)
{
- // Randomize key-policy usage and algorithm:
- policy_usage = rand_key_usage();
- policy_algorithm = rand_key_algorithm();
- // keys: Should automatically come up as empby.
+ return; // just to have something to pin a breakpoint onto
}
@@ -80,11 +76,6 @@
*end = '\0';
buffer[buf_len] = '\0';
handle_str = buffer;
- // Randomize key type:
- key_type = rand_key_type();
- // Randomize lifetime:
- lifetime_str = ((rand() % 2) == 1)?
- "PSA_KEY_LIFETIME_VOLATILE" : "PSA_KEY_LIFETIME_PERSISTENT";
}
diff --git a/tf_fuzz/tfz-cpp/assets/crypto_asset.hpp b/tf_fuzz/tfz-cpp/assets/crypto_asset.hpp
index 525f026..ab939fc 100644
--- a/tf_fuzz/tfz-cpp/assets/crypto_asset.hpp
+++ b/tf_fuzz/tfz-cpp/assets/crypto_asset.hpp
@@ -8,9 +8,7 @@
#ifndef CRYPTO_ASSET_HPP
#define CRYPTO_ASSET_HPP
-#include <string>
#include <vector>
-#include <cstddef>
#include <cstdint>
#include "data_blocks.hpp"
@@ -42,9 +40,6 @@
{
public:
// Data members:
- string policy_usage; // for now just strings; maybe future tap TF-M(?) value list
- string key_type; // DES, AES, RAW, vendor, none, etc.
- string policy_algorithm;
vector<key_asset*> keys; // keys that use this policy
// Methods:
policy_asset (void); // (constructor)
@@ -62,17 +57,6 @@
class key_asset : public crypto_asset
{
public:
- // Data members:
- vector<policy_asset*>::iterator the_policy_asset;
- /* The policy for this key. Note that psa_make_key() lets us create
- a key without associating a policy with it. In that case, this will
- be null, and the attributes below apply. Later, psa_set_key_policy
- lets us associate a policy with a key, at which point this becomes
- non-null and the following attributes no longer apply. */
- string key_type; // DES, AES, RAW, vendor, none, etc.
- string usage; // for now just strings; maybe future tap TF-M(?) value list
- string alg; // these only apply if the string was created without a policy
- string lifetime_str; // similarly, the text representation of the key's lifetime
// Methods:
bool set_key_id (int id_n); // checks key-ID value, returns true==success
key_asset (void); // (constructor)