blob: 829071aca88894a16a4605973a0f4c59e476a9c1 [file] [log] [blame]
Karl Zhang3de5ab12021-05-31 11:45:48 +08001/*
2 * Copyright (c) 2019-2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#include "class_forwards.hpp"
9
10#include "boilerplate.hpp"
11#include "gibberish.hpp"
12#include "compute.hpp"
13#include "data_blocks.hpp"
14#include "psa_asset.hpp"
15#include "find_or_create_asset.hpp"
16#include "template_line.hpp"
17#include "tf_fuzz.hpp"
18#include "crypto_asset.hpp"
19#include "psa_call.hpp"
20#include "sst_call.hpp"
21#include "sst_template_line.hpp"
22#include "sst_asset.hpp"
23
24
25/**********************************************************************************
26 Methods of class set_sst_template_line follow:
27**********************************************************************************/
28
29//**************** set_sst_template_line methods ****************
30
31set_sst_template_line::set_sst_template_line (tf_fuzz_info *resources)
32 : sst_template_line (resources) // constructor)
33{
34 return; // just to have something to pin a breakpoint onto
35}
36
37
38// Default destructor:
39set_sst_template_line::~set_sst_template_line (void)
40{
41 return; // just to have something to pin a breakpoint onto
42}
43
44// (Default constructor not used)
45
46
47
48/**********************************************************************************
49 End of methods of class set_sst_template_line.
50**********************************************************************************/
51
52
53/**********************************************************************************
54 Methods of class read_sst_template_line follow:
55**********************************************************************************/
56
57read_sst_template_line::read_sst_template_line (tf_fuzz_info *resources)
58 : sst_template_line (resources) // (constructor)
59{
60 char gibberish_buffer[4096]; string databuff;
61 int data_length;
62 set_data.string_specified = (rand()%2) == 1? true : false;
63
64 // Go ahead and create a literal-data string even if not needed:
65 data_length = test_state->gibbergen.pick_sentence_len();
66 test_state->gibbergen.sentence (gibberish_buffer, gibberish_buffer + data_length);
67 databuff = gibberish_buffer; set_data.set (databuff);
68
69 set_data.file_specified
70 = (!set_data.string_specified && (rand()%2) == 1)? true : false;
71 set_data.file_path = ""; // can't really devise a random path
72}
73
74// Default destructor:
75read_sst_template_line::~read_sst_template_line (void)
76{
77 return; // just to have something to pin a breakpoint onto
78}
79
80// (Default constructor not used)
81
82
83/**********************************************************************************
84 End of methods of class read_sst_template_line.
85**********************************************************************************/
86
87
88/**********************************************************************************
89 Methods of class remove_sst_template_line follow:
90**********************************************************************************/
91
92remove_sst_template_line::remove_sst_template_line (tf_fuzz_info *resources)
93 : sst_template_line (resources) // (constructor)
94{
95 is_remove = true; // template_line's constructor defaults this to false
96}
97
98// Default destructor:
99remove_sst_template_line::~remove_sst_template_line (void)
100{
101 return; // just to have something to pin a breakpoint onto
102}
103
104// (Default constructor not used)
105
106
107/**********************************************************************************
108 End of methods of class remove_sst_template_line.
109**********************************************************************************/
110