common/iavf: support raw packet in protocol header
[dpdk.git] / examples / fips_validation / fips_validation.c
index 6594a15..8cec172 100644 (file)
@@ -120,7 +120,7 @@ fips_test_parse_header(void)
 
        for (i = 0; i < info.nb_vec_lines; i++) {
                if (!algo_parsed) {
-                       if (strstr(info.vec[i], "AESVS")) {
+                       if (strstr(info.vec[i], "AES")) {
                                algo_parsed = 1;
                                info.algo = FIPS_TEST_ALGO_AES;
                                ret = parse_test_aes_init();
@@ -458,6 +458,12 @@ fips_test_parse_one_json_vector_set(void)
        /* Vector sets contain the algorithm type, and nothing else we need. */
        if (strstr(algo_str, "AES-GCM"))
                info.algo = FIPS_TEST_ALGO_AES_GCM;
+       else if (strstr(algo_str, "HMAC"))
+               info.algo = FIPS_TEST_ALGO_HMAC;
+       else if (strstr(algo_str, "CMAC"))
+               info.algo = FIPS_TEST_ALGO_AES_CMAC;
+       else if (strstr(algo_str, "AES-CBC"))
+               info.algo = FIPS_TEST_ALGO_AES;
        else
                return -EINVAL;
 
@@ -468,7 +474,6 @@ int
 fips_test_parse_one_json_group(void)
 {
        int ret, i;
-       json_int_t val;
        json_t *param;
 
        if (info.interim_callbacks) {
@@ -476,8 +481,20 @@ fips_test_parse_one_json_group(void)
                for (i = 0; info.interim_callbacks[i].key != NULL; i++) {
                        param = json_object_get(json_info.json_test_group,
                                        info.interim_callbacks[i].key);
-                       val = json_integer_value(param);
-                       snprintf(json_value, 255, "%"JSON_INTEGER_FORMAT, val);
+                       switch (json_typeof(param)) {
+                       case JSON_STRING:
+                               snprintf(json_value, 256, "%s", json_string_value(param));
+                               break;
+
+                       case JSON_INTEGER:
+                               snprintf(json_value, 255, "%"JSON_INTEGER_FORMAT,
+                                               json_integer_value(param));
+                               break;
+
+                       default:
+                               return -EINVAL;
+                       }
+
                        /* First argument is blank because the key
                         * is not included in the string being parsed.
                         */