tf_fuzz: fix ps teardown boilerplate and disable teardown for write once assets

Fix failing demos 14,16,35 by fixing the teardown boilerplate and no
longer generating asset teardown code for Protected Storage assets with
the WRITE_ONCE flag.

Protected Storage assets with the WRITE_ONCE flag set cannot be removed
after creation. However, all Protected Storage assets, including those
with WRITE_ONCE, currently have teardown code that removes the asset
and ensures that this happened sucessfully. This causes test failures
for WRITE_ONCE assets.

As WRITE_ONCE assets now persist between tests, there is a possibility
that asset UIDs in different tests could collide. Because of this,
WRITE_ONCE can no longer be given to a PS asset during random flag
selection, and must be explicitly specified in the test template.

Change-Id: I4fa79f33851b6e580109acd4e40238c04e7ea773
Signed-off-by: Nik Dewally <Nik.Dewally@arm.com>
diff --git a/tf_fuzz/lib/tfm_boilerplate.txt b/tf_fuzz/lib/tfm_boilerplate.txt
index 5b65684..952d4ad 100644
--- a/tf_fuzz/lib/tfm_boilerplate.txt
+++ b/tf_fuzz/lib/tfm_boilerplate.txt
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -127,14 +127,14 @@
 `015
     TEST_LOG($message);
 `016
-    psa_ps_remove($uid);
+    sst_status = psa_ps_remove($uid);
 `017
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
 `018
-    psa_destroy_key($handle);
+    crypto_status = psa_destroy_key($handle);
 `019
     if (crypto_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down a crypto asset upon test completion");
diff --git a/tf_fuzz/tfz-cpp/assets/psa_asset.hpp b/tf_fuzz/tfz-cpp/assets/psa_asset.hpp
index 9eb4d3f..9f6a328 100644
--- a/tf_fuzz/tfz-cpp/assets/psa_asset.hpp
+++ b/tf_fuzz/tfz-cpp/assets/psa_asset.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -8,6 +8,7 @@
 #ifndef PSA_ASSET_HPP
 #define PSA_ASSET_HPP
 
+#include "class_forwards.hpp"
 #include <string>
 #include <vector>
 #include <cstdint>
diff --git a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_stdout_stderr
index 1976f7b..4a3b39b 100644
--- a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_stdout_stderr
@@ -8,6 +8,11 @@
 SST-asset UID list:  "data"
 LITERAL string:  "Very simple test"
 Create from literal data:  ""Very simple test""
+SST no storage flag:  none"
+SST creation flag
+expect"
+SST creation flags
+expect"
 Set SST command:  "expect"
 Appended to end of call sequence:  SST-set call.
 Set command:  "expect"
diff --git a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_test.c b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_test.c
index 0b597f4..bc4cc05 100644
--- a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/exp_test.c
@@ -47,7 +47,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove(104);
+    sst_status = psa_ps_remove(104);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/template b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/template
index 7b84f11..2c18941 100644
--- a/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/template
+++ b/tf_fuzz/tfz-cpp/regression/000001_set_sst_uid_data_expect_pass/template
@@ -1,2 +1,2 @@
 purpose to create an SST asset;
-set sst uid 104 data "Very simple test" expect pass;
+set sst uid 104 data "Very simple test" flag none expect pass;
diff --git a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_stdout_stderr
index 97c20e8..f39070a 100644
--- a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_stdout_stderr
@@ -8,6 +8,11 @@
 Asset identifier list:  "data"
 LITERAL string:  "sunny with a 30% chance of weather!"
 Create from literal data:  ""sunny with a 30% chance of weather!""
+SST no storage flag:  none"
+SST creation flag
+expect"
+SST creation flags
+expect"
 Set SST command:  "expect"
 Appended to end of call sequence:  SST-set call.
 Set command:  "expect"
diff --git a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_test.c b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_test.c
index aa2e7eb..f4377a1 100644
--- a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/exp_test.c
@@ -44,7 +44,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/template b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/template
index 7292031..53714fc 100644
--- a/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/template
+++ b/tf_fuzz/tfz-cpp/regression/000002_set_sst_name_data_expect_nothing/template
@@ -1,2 +1,2 @@
 purpose to give assets a human name;
-set sst name forecast data "sunny with a 30% chance of weather!" expect nothing;
+set sst name forecast data "sunny with a 30% chance of weather!" flag none expect nothing;
diff --git a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_stdout_stderr
index 19a9bdb..5bc3242 100644
--- a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_stdout_stderr
@@ -8,6 +8,11 @@
 Asset identifier list:  "data"
 LITERAL string:  "I am the man"
 Create from literal data:  ""I am the man""
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_test.c b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_test.c
index f2b90f0..f000d80 100644
--- a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/exp_test.c
@@ -47,7 +47,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/template b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/template
index 820e3ab..f1b82a5 100644
--- a/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/template
+++ b/tf_fuzz/tfz-cpp/regression/000003_set_sst_name_data/template
@@ -1,2 +1,2 @@
 purpose to show that TF-Fuzz can "infer" \"results\";
-set sst name jonathan data "I am the man";
+set sst name jonathan data "I am the man" flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_stdout_stderr
index 916f354..fb3a455 100644
--- a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_stdout_stderr
@@ -7,9 +7,14 @@
 ASSET_IDENTIFIER:  "gibberish"
 Asset identifier list:  "data"
 Create from random data
-Set SST command:  "*"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
+Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
-Set command:  "*"
+Set command:  ";"
 Command with no expect:  ";"
 Lines:  Line number 3.
 Lines:  Line number 3.
diff --git a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_test.c b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_test.c
index 057ab2b..e2edc02 100644
--- a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/exp_test.c
@@ -47,7 +47,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/template b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/template
index 912c23a..d1df36c 100644
--- a/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/template
+++ b/tf_fuzz/tfz-cpp/regression/000004_set_sst_name_rand_data/template
@@ -1,2 +1,2 @@
 purpose to show how to randomize data;
-set sst name gibberish data *;
+set sst name gibberish data * flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_stdout_stderr
index 5ead6c6..bd26ec7 100644
--- a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_stdout_stderr
@@ -6,9 +6,14 @@
 Purpose line:  to show how to randomize name and data
 Asset random identifier:  "*"
 Create from random data
-Set SST command:  "*"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
+Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
-Set command:  "*"
+Set command:  ";"
 Command with no expect:  ";"
 Lines:  Line number 3.
 Lines:  Line number 3.
diff --git a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_test.c b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_test.c
index bdc3ef8..9868812 100644
--- a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/exp_test.c
@@ -47,7 +47,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/template b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/template
index 5290f27..4f94b63 100644
--- a/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/template
+++ b/tf_fuzz/tfz-cpp/regression/000005_set_sst_rand_name_rand_data/template
@@ -1,2 +1,2 @@
 purpose to show how to randomize name and data;
-set sst name * data *;
+set sst name * data * flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_stdout_stderr
index 4e76308..95f043f 100644
--- a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_stdout_stderr
@@ -11,13 +11,18 @@
 ASSET_IDENTIFIER:  "ringo"
 Asset identifier list:  "data"
 Create from random data
-Set SST command:  "*"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
+Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
-Set command:  "*"
+Set command:  ";"
 Command with no expect:  ";"
 Lines:  Line number 3.
 Lines:  Line number 3.
diff --git a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_test.c b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_test.c
index e296957..0821cb6 100644
--- a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/exp_test.c
@@ -83,27 +83,27 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@002@@@\);
+    sst_status = psa_ps_remove\(@@@002@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@003@@@\);
+    sst_status = psa_ps_remove\(@@@003@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@004@@@\);
+    sst_status = psa_ps_remove\(@@@004@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@005@@@\);
+    sst_status = psa_ps_remove\(@@@005@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/template b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/template
index 2e86d75..4e7a4f6 100644
--- a/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/template
+++ b/tf_fuzz/tfz-cpp/regression/000006_set_sst_multi_name_rand_data/template
@@ -1,2 +1,2 @@
 purpose to show a nice party trick;
-set sst name john paul george and ringo data *;
+set sst name john paul george and ringo data * flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_stdout_stderr
index 5e9e362..092f7eb 100644
--- a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_stdout_stderr
@@ -12,7 +12,12 @@
 ASSET_NUMBER:  "41"
 SST-asset UID list:  "data"
 Create from random data
-Set SST command:  "*"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
+Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
 Appended to end of call sequence:  SST-set call.
diff --git a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_test.c b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_test.c
index a3ec7f7..3516c14 100644
--- a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/exp_test.c
@@ -92,32 +92,32 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove(17);
+    sst_status = psa_ps_remove(17);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove(19);
+    sst_status = psa_ps_remove(19);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove(24);
+    sst_status = psa_ps_remove(24);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove(31);
+    sst_status = psa_ps_remove(31);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove(34);
+    sst_status = psa_ps_remove(34);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove(41);
+    sst_status = psa_ps_remove(41);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/template b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/template
index 903027e..71da75b 100644
--- a/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/template
+++ b/tf_fuzz/tfz-cpp/regression/000007_set_sst_multi_uid_rand_data/template
@@ -1,2 +1,2 @@
 purpose same with UIDs;
-set sst uid 17 19 24 31 34 41 data *;
+set sst uid 17 19 24 31 34 41 data * flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_stdout_stderr
index a138dc4..12674a0 100644
--- a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "snortwaggle"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_test.c b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_test.c
index 974b2ca..0084b1f 100644
--- a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/exp_test.c
@@ -62,7 +62,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/template b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/template
index 03b22d9..73ae19e 100644
--- a/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/template
+++ b/tf_fuzz/tfz-cpp/regression/000008_set_sst_name_rand_data_read_check_wrong/template
@@ -1,3 +1,3 @@
 purpose to create and show an asset;
-set sst name snortwaggle data *;
+set sst name snortwaggle data * flag none;
 read sst name snortwaggle check "almost certainly not *this*" expect fail;
diff --git a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_stdout_stderr
index 844cb17..e371754 100644
--- a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "greebledorf"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_test.c b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_test.c
index b387a1a..610f051 100644
--- a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/exp_test.c
@@ -70,7 +70,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/template b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/template
index a1a4d61..1871c4f 100644
--- a/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/template
+++ b/tf_fuzz/tfz-cpp/regression/000009_set_sst_name_rand_data_read_check_var_read_print/template
@@ -1,4 +1,4 @@
 purpose to check against a variable or dump into the log;
-set sst name greebledorf data *;
+set sst name greebledorf data * flag none;
 read sst name greebledorf chk a_variable;
 read sst name greebledorf print;
diff --git a/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/exp_stdout_stderr
index f10b04d..10c6f7e 100644
--- a/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "george"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/template b/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/template
index 7edb72e..dd33c31 100644
--- a/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/template
+++ b/tf_fuzz/tfz-cpp/regression/000013_set_sst_name_rand_data_remove_twice/template
@@ -1,4 +1,4 @@
 purpose to illustrate deleting assets;
-set sst name george data *;
+set sst name george data * flag none;
 remove sst name george;
 rm sst name george;
diff --git a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_stdout_stderr
index 1c447b7..66013c3 100644
--- a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "george"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_test.c b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_test.c
index 236c3bd..5e93196 100644
--- a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/exp_test.c
@@ -52,7 +52,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/template b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/template
index 5b9485c..2c511b1 100644
--- a/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/template
+++ b/tf_fuzz/tfz-cpp/regression/000014_set_sst_name_rand_data_remove_other/template
@@ -1,3 +1,3 @@
 purpose to remove something that doesn't exist;
-set sst name george data *;
+set sst name george data * flag none;
 remove sst name ringo;
diff --git a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_stdout_stderr
index 318a125..929b4a3 100644
--- a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_stdout_stderr
@@ -5,14 +5,24 @@
 Using seed value of \d+ \(0x[a-f\d]+\).
 Purpose line:  to show that if you don't have say anything about data to randomize it
 ASSET_IDENTIFIER:  "random"
-Asset identifier list:  ";"
+Asset identifier list:  "flag"
 SST-create from random data (no 'data *')
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
 Command with no expect:  ";"
 Asset random identifier:  "*"
 SST-create from random data (no 'data *')
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_test.c b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_test.c
index 9be60fb..082816a 100644
--- a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/exp_test.c
@@ -56,12 +56,12 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@004@@@\);
+    sst_status = psa_ps_remove\(@@@004@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/template b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/template
index 63220db..ec81319 100644
--- a/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/template
+++ b/tf_fuzz/tfz-cpp/regression/000015_set_sst_name_only/template
@@ -1,3 +1,3 @@
 purpose to show that if you don't have say anything about data to randomize it;
-set sst name random;
-set sst name *;
+set sst name random flag none;
+set sst name * flag none;
diff --git a/tf_fuzz/tfz-cpp/regression/000016_set_sst_single_asset_set_multiple_times/exp_test.c b/tf_fuzz/tfz-cpp/regression/000016_set_sst_single_asset_set_multiple_times/exp_test.c
index eb3291c..709c28e 100644
--- a/tf_fuzz/tfz-cpp/regression/000016_set_sst_single_asset_set_multiple_times/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000016_set_sst_single_asset_set_multiple_times/exp_test.c
@@ -83,7 +83,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_stdout_stderr
index 990480d..2bad4e7 100644
--- a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "just_checking"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_test.c b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_test.c
index a251a42..609d8e9 100644
--- a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/exp_test.c
@@ -95,7 +95,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/template b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/template
index 9f10122..6714a4a 100644
--- a/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/template
+++ b/tf_fuzz/tfz-cpp/regression/000017_read_sst_check_single_asset_multiple_times/template
@@ -1,5 +1,5 @@
 purpose to read the value of a single asset multiple times;
-set sst name just_checking data *;
+set sst name just_checking data * flag none;
 // TF-Fuzz needs enhancements to correctly predict the "expect" values below:
 read sst name just_checking check "Not this" expect fail;
 read sst name just_checking check "Not this either" expect fail;
diff --git a/tf_fuzz/tfz-cpp/regression/000018_000016_and_000017/exp_test.c b/tf_fuzz/tfz-cpp/regression/000018_000016_and_000017/exp_test.c
index 06b82b4..6f04987 100644
--- a/tf_fuzz/tfz-cpp/regression/000018_000016_and_000017/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000018_000016_and_000017/exp_test.c
@@ -140,7 +140,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_stdout_stderr
index ca4b2ed..f9c27b6 100644
--- a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_stdout_stderr
@@ -5,8 +5,13 @@
 Using seed value of \d+ \(0x[a-f\d]+\).
 Purpose line:  to read an asset into a named variable the set another asset from that variable
 ASSET_IDENTIFIER:  "source"
-Asset identifier list:  ";"
+Asset identifier list:  "flag"
 SST-create from random data (no 'data *')
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
@@ -24,6 +29,11 @@
 Asset identifier list:  "var"
 IDENTIFIER:  "transfer"
 SST-set set from variable:  "transfer"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
@@ -41,6 +51,11 @@
 Asset identifier list:  "var"
 IDENTIFIER:  "transfer"
 SST-set set from variable:  "transfer"
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_test.c b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_test.c
index f22c575..a235358 100644
--- a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/exp_test.c
@@ -103,17 +103,17 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@002@@@\);
+    sst_status = psa_ps_remove\(@@@002@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@003@@@\);
+    sst_status = psa_ps_remove\(@@@003@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/template b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/template
index 0111ba2..224f247 100644
--- a/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/template
+++ b/tf_fuzz/tfz-cpp/regression/000019_read_asset_to_variable_set_other_asset/template
@@ -1,7 +1,7 @@
 purpose to read an asset into a named variable the set another asset from that variable;
-set sst name source;  // shorthand for random data
+set sst name source flag none;  // shorthand for random data
 read sst name source var transfer;
-set sst name intermediate var transfer;
+set sst name intermediate var transfer flag none;
 read sst name intermediate var transfer;
-set sst name destination var transfer;
+set sst name destination var transfer flag none;
 read sst name destination check transfer;
diff --git a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_stdout_stderr b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_stdout_stderr
index c9d1a0f..c36160d 100644
--- a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_stdout_stderr
+++ b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_stdout_stderr
@@ -7,6 +7,11 @@
 ASSET_IDENTIFIER:  "whoNose"
 Asset identifier list:  "data"
 Create from random data
+SST no storage flag:  none"
+SST creation flag
+;"
+SST creation flags
+;"
 Set SST command:  ";"
 Appended to end of call sequence:  SST-set call.
 Set command:  ";"
diff --git a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_test.c b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_test.c
index 93a169a..4bc8e80 100644
--- a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/exp_test.c
@@ -56,7 +56,7 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@001@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/template b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/template
index 9fa46e9..aa01867 100644
--- a/tf_fuzz/tfz-cpp/regression/000022_SST_offset/template
+++ b/tf_fuzz/tfz-cpp/regression/000022_SST_offset/template
@@ -1,3 +1,3 @@
 purpose to set an offset on psa_ps_get();
-set sst name whoNose data *;
+set sst name whoNose data * flag none;
 read sst name whoNose print offset 10;
diff --git a/tf_fuzz/tfz-cpp/regression/000023_SST_creation_flags/exp_test.c b/tf_fuzz/tfz-cpp/regression/000023_SST_creation_flags/exp_test.c
index 45cecbc..805495d 100644
--- a/tf_fuzz/tfz-cpp/regression/000023_SST_creation_flags/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000023_SST_creation_flags/exp_test.c
@@ -83,27 +83,17 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
+    sst_status = psa_ps_remove\(@@@003@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@002@@@\);
+    sst_status = psa_ps_remove\(@@@004@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
     }
-    psa_ps_remove\(@@@003@@@\);
-    if (sst_status != PSA_SUCCESS) {
-        TEST_FAIL("Failed to tear down an SST asset upon test completion.");
-        return;
-    }
-    psa_ps_remove\(@@@004@@@\);
-    if (sst_status != PSA_SUCCESS) {
-        TEST_FAIL("Failed to tear down an SST asset upon test completion.");
-        return;
-    }
-    psa_ps_remove\(@@@005@@@\);
+    sst_status = psa_ps_remove\(@@@005@@@\);
     if (sst_status != PSA_SUCCESS) {
         TEST_FAIL("Failed to tear down an SST asset upon test completion.");
         return;
diff --git a/tf_fuzz/tfz-cpp/regression/000024_SST_write_once/exp_test.c b/tf_fuzz/tfz-cpp/regression/000024_SST_write_once/exp_test.c
index 2139ad9..0683390 100644
--- a/tf_fuzz/tfz-cpp/regression/000024_SST_write_once/exp_test.c
+++ b/tf_fuzz/tfz-cpp/regression/000024_SST_write_once/exp_test.c
@@ -65,11 +65,6 @@
 
 
     /* Removing assets left over from testing: */
-    psa_ps_remove\(@@@001@@@\);
-    if (sst_status != PSA_SUCCESS) {
-        TEST_FAIL("Failed to tear down an SST asset upon test completion.");
-        return;
-    }
 
     /* Test completed */
     ret->val = TEST_PASSED;
diff --git a/tf_fuzz/tfz-cpp/tf_fuzz.cpp b/tf_fuzz/tfz-cpp/tf_fuzz.cpp
index 3d52685..17c1881 100644
--- a/tf_fuzz/tfz-cpp/tf_fuzz.cpp
+++ b/tf_fuzz/tfz-cpp/tf_fuzz.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -157,6 +157,16 @@
     string call;
     // Traverse through the SST-assets list, writing out remove commands:
     for (auto &asset : active_sst_asset) {
+      //  write once assets cannot be removed
+
+      //  NOTE: As write once assets persist across tests, there is as
+      //  chance of UID collisions between tests. There is no technical solution
+      //  for this - test authors just have to be careful in their use of
+      //  WRITE_ONCE.
+      if (asset->set_data.flags_string.find("PSA_STORAGE_FLAG_WRITE_ONCE") !=
+          std::string::npos) {
+            continue;
+      }
         call = bplate->bplate_string[teardown_sst];
         find_replace_1st ("$uid", to_string(asset->asset_info.id_n), call);
         call.append (bplate->bplate_string[teardown_sst_check]);
diff --git a/tf_fuzz/tfz-cpp/utility/data_blocks.cpp b/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
index 09a25e9..c84d4d2 100644
--- a/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
+++ b/tf_fuzz/tfz-cpp/utility/data_blocks.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -105,30 +105,19 @@
 
 string set_data_info::rand_creation_flags (void)
 {
-    return ((rand() % 2) == 1)?
-        "PSA_STORAGE_FLAG_WRITE_ONCE" : "PSA_STORAGE_FLAG_NONE";
-
-    /* TODO:  There are also PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION and
-              PSA_STORAGE_FLAG_NO_CONFIDENTIALITY, but they don't seem to appear
-              in any test suites, so it's iffy as to whether they really exist.
-              We'll not routinely initialize to them, for now at least, but if
-              we want to enable them, then uncomment the following:
     string result = "";
-    const int most_flags = 2,
+    const int most_flags = 2;
     int n_flags = (rand() % most_flags);
 
-    for (int i = 0;  i < ;  i < n_flags;  ++i) {
-        switch (rand() % 4) {
+    for (int i = 0; i < n_flags;  ++i) {
+        switch (rand() % 3) {
             case 0:
                 result += "PSA_STORAGE_FLAG_NONE";
                 break;
             case 1:
-                result += "PSA_STORAGE_FLAG_WRITE_ONCE";
-                break;
-            case 2:
                 result += "PSA_STORAGE_FLAG_NO_REPLAY_PROTECTION";
                 break;
-            case 3:
+            case 2:
                 result += "PSA_STORAGE_FLAG_NO_CONFIDENTIALITY";
                 break;
         }
@@ -136,7 +125,8 @@
             result += " | ";
     }
     if (result == "") result = "PSA_STORAGE_FLAG_NONE";
-*/
+
+    return result;
 }
 
 set_data_info::set_data_info (void)  // (default constructor)