MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fips_test_parse_header

Function fips_test_parse_header

dpdk/examples/fips_validation/fips_validation.c:106–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106static int
107fips_test_parse_header(void)
108{
109 uint32_t i;
110 char *tmp;
111 int ret;
112 int algo_parsed = 0;
113 time_t t = time(NULL);
114 struct tm *tm_now = localtime(&t);
115
116 ret = fips_test_fetch_one_block();
117 if (ret < 0)
118 return ret;
119
120 if (info.nb_vec_lines)
121 fips_test_parse_version();
122
123 for (i = 0; i < info.nb_vec_lines; i++) {
124 if (!algo_parsed) {
125 if (strstr(info.vec[i], "AES")) {
126 algo_parsed = 1;
127 info.algo = FIPS_TEST_ALGO_AES;
128 ret = parse_test_aes_init();
129 if (ret < 0)
130 return ret;
131 } else if (strstr(info.vec[i], "GCM")) {
132 algo_parsed = 1;
133 info.algo = FIPS_TEST_ALGO_AES_GCM;
134 ret = parse_test_gcm_init();
135 if (ret < 0)
136 return ret;
137 } else if (strstr(info.vec[i], "CMAC")) {
138 algo_parsed = 1;
139 info.algo = FIPS_TEST_ALGO_AES_CMAC;
140 ret = parse_test_cmac_init();
141 if (ret < 0)
142 return 0;
143 } else if (strstr(info.vec[i], "CCM")) {
144 algo_parsed = 1;
145 info.algo = FIPS_TEST_ALGO_AES_CCM;
146 ret = parse_test_ccm_init();
147 if (ret < 0)
148 return 0;
149 } else if (strstr(info.vec[i], "HMAC")) {
150 algo_parsed = 1;
151 info.algo = FIPS_TEST_ALGO_HMAC;
152 ret = parse_test_hmac_init();
153 if (ret < 0)
154 return ret;
155 } else if (strstr(info.vec[i], "TDES")) {
156 algo_parsed = 1;
157 info.algo = FIPS_TEST_ALGO_TDES;
158 ret = parse_test_tdes_init();
159 if (ret < 0)
160 return 0;
161 } else if (strstr(info.vec[i], "PERMUTATION")) {
162 algo_parsed = 1;
163 info.algo = FIPS_TEST_ALGO_TDES;

Callers 1

fips_test_initFunction · 0.85

Calls 12

fips_test_parse_versionFunction · 0.85
strstrFunction · 0.85
parse_test_aes_initFunction · 0.85
parse_test_gcm_initFunction · 0.85
parse_test_cmac_initFunction · 0.85
parse_test_ccm_initFunction · 0.85
parse_test_hmac_initFunction · 0.85
parse_test_tdes_initFunction · 0.85
parse_test_sha_initFunction · 0.85
parse_test_xts_initFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected