Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/110520/?format=api
http://patches.dpdk.org/api/patches/110520/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220429161559.415645-4-blo@iol.unh.edu/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220429161559.415645-4-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220429161559.415645-4-blo@iol.unh.edu", "date": "2022-04-29T16:15:54", "name": "[v4,3/8] examples/fips_validation: add json parsing", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5b32ab6afef7a5b4a68de333fe69c26b7b92f9db", "submitter": { "id": 1678, "url": "http://patches.dpdk.org/api/people/1678/?format=api", "name": "Brandon Lo", "email": "blo@iol.unh.edu" }, "delegate": { "id": 6690, "url": "http://patches.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220429161559.415645-4-blo@iol.unh.edu/mbox/", "series": [ { "id": 22738, "url": "http://patches.dpdk.org/api/series/22738/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22738", "date": "2022-04-29T16:15:51", "name": "Add JSON vector set support to fips validation", "version": 4, "mbox": "http://patches.dpdk.org/series/22738/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/110520/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/110520/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id D2952A04FF;\n\tFri, 29 Apr 2022 18:16:24 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0D78F4282F;\n\tFri, 29 Apr 2022 18:16:08 +0200 (CEST)", "from mail-qt1-f173.google.com (mail-qt1-f173.google.com\n [209.85.160.173])\n by mails.dpdk.org (Postfix) with ESMTP id C04014281C\n for <dev@dpdk.org>; Fri, 29 Apr 2022 18:16:05 +0200 (CEST)", "by mail-qt1-f173.google.com with SMTP id p4so5557484qtq.12\n for <dev@dpdk.org>; Fri, 29 Apr 2022 09:16:05 -0700 (PDT)", "from blo.iol.unh.edu ([2606:4100:3880:1270:ec49:26fa:daa6:229d])\n by smtp.gmail.com with ESMTPSA id\n k20-20020a05622a03d400b002ec16d2694fsm2081188qtx.39.2022.04.29.09.16.04\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 29 Apr 2022 09:16:04 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu;\n s=unh-iol;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=vYACZHkBG57qbDzvpGr47m7X+Om0OW6b0K4jZpDxuHQ=;\n b=b5pjXMbWh3pJYWh3a+pczI6CEgJOZxYHp+iSbRfrIYKtqxI6LiQR47jkmdSwa3n+tk\n XkEiwDYxlUh9QHZ4+7TY/TODoF5M+vbCbGS+0vb/h9rsmLBEPaztmvDlxewQrA+irGde\n 6EPUJi+y4+tGRP4Isbyp4NvAIm9vb0PkbGYeQ=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=vYACZHkBG57qbDzvpGr47m7X+Om0OW6b0K4jZpDxuHQ=;\n b=EsWukRdQr8iknRYzdGFIosSyVVJAm79TnQZ+vIXc4vY3uasIPpZ41Yy3vzmpu6v4wZ\n tCha9EfLrOqH/cES+SMpfGgUzBBsGyxnhq9KwFY8cqWL/skYwYOrMLTUqKmazXb+KXaz\n ws2tEsmz9xTwcL8lDuhZuvZ/NxjIxU2kD/ltJkf7IuLsWRVlv2o0Xhrv3jVX+vZ4SUFq\n 08f9nMTHMmMMrmnKtP5sjXYdFI+LdeZz1g4OjsbUEJs9xpYS5SKRNSnKZkMANkCto85E\n aaagnY0iYsOSudwFMP5GzBUImkwLq0CIEAd39oNw/teS7n6ka8ojFVuuTC1iDMhTFg7U\n GZGA==", "X-Gm-Message-State": "AOAM530RpeE8T5DkYD/Su3NWjmzi/A1WUTILDnB5jwyt+IZ9VCuRGo1v\n zO4zQogeZE08wCZq9dHYTDAqVQ==", "X-Google-Smtp-Source": "\n ABdhPJzjBPNHQi2YRBHnJu6DWmwZ0R3y9GLl8I/VnfhOjzoL875K1OgUhNxI7XGBaGVNxFdxk9niiQ==", "X-Received": "by 2002:ac8:5cc1:0:b0:2f3:86e0:c8b1 with SMTP id\n s1-20020ac85cc1000000b002f386e0c8b1mr139227qta.99.1651248965219;\n Fri, 29 Apr 2022 09:16:05 -0700 (PDT)", "From": "Brandon Lo <blo@iol.unh.edu>", "To": "roy.fan.zhang@intel.com,\n\tciara.power@intel.com", "Cc": "dev@dpdk.org,\n\tBrandon Lo <blo@iol.unh.edu>", "Subject": "[PATCH v4 3/8] examples/fips_validation: add json parsing", "Date": "Fri, 29 Apr 2022 12:15:54 -0400", "Message-Id": "<20220429161559.415645-4-blo@iol.unh.edu>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220429161559.415645-1-blo@iol.unh.edu>", "References": "<20220129175514.746925-1-blo@iol.unh.edu>\n <20220429161559.415645-1-blo@iol.unh.edu>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "Added functions to parse the required information from a vector set\ngiven in the new json format.\n\nSigned-off-by: Brandon Lo <blo@iol.unh.edu>\n---\nv3:\n* fix checkpatch warnings\n\nv2:\n* fix for loop initialization\n\n examples/fips_validation/fips_validation.c | 92 ++++++++++++++++++++++\n 1 file changed, 92 insertions(+)", "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex 94253eaee8..d220dcab1f 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -276,6 +276,8 @@ parse_file_type(const char *path)\n \t\tinfo.file_type = FIPS_TYPE_RSP;\n \telse if (strstr(path, FAX_FILE_PERFIX))\n \t\tinfo.file_type = FIPS_TYPE_FAX;\n+\telse if (strstr(path, JSON_FILE_PERFIX))\n+\t\tinfo.file_type = FIPS_TYPE_JSON;\n \telse\n \t\treturn -EINVAL;\n \n@@ -311,6 +313,21 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path,\n \t\treturn -EINVAL;\n \t}\n \n+\tif (info.file_type == FIPS_TYPE_JSON) {\n+#ifdef RTE_HAS_JANSSON\n+\t\tjson_error_t error;\n+\t\tjson_info.json_root = json_loadf(info.fp_rd, 0, &error);\n+\t\tif (!json_info.json_root) {\n+\t\t\tRTE_LOG(ERR, USER1, \"Cannot parse json file %s (line %d, column %d)\\n\",\n+\t\t\t\treq_file_path, error.line, error.column);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+#else /* RTE_HAS_JANSSON */\n+\t\tRTE_LOG(ERR, USER1, \"No json library configured.\\n\");\n+\t\treturn -EINVAL;\n+#endif /* RTE_HAS_JANSSON */\n+\t}\n+\n \tinfo.fp_wr = fopen(rsp_file_path, \"w\");\n \tif (!info.fp_wr) {\n \t\tRTE_LOG(ERR, USER1, \"Cannot open file %s\\n\", rsp_file_path);\n@@ -329,6 +346,9 @@ fips_test_init(const char *req_file_path, const char *rsp_file_path,\n \t\treturn -EINVAL;\n \t}\n \n+\tif (info.file_type == FIPS_TYPE_JSON)\n+\t\treturn 0;\n+\n \tif (fips_test_parse_header() < 0) {\n \t\tRTE_LOG(ERR, USER1, \"Failed parsing header\\n\");\n \t\treturn -1;\n@@ -428,6 +448,78 @@ fips_test_write_one_case(void)\n \t\tfprintf(info.fp_wr, \"%s\\n\", info.vec[i]);\n }\n \n+#ifdef RTE_HAS_JANSSON\n+int\n+fips_test_parse_one_json_vector_set(void)\n+{\n+\tjson_t *algo_obj = json_object_get(json_info.json_vector_set, \"algorithm\");\n+\tconst char *algo_str = json_string_value(algo_obj);\n+\n+\t/* Vector sets contain the algorithm type, and nothing else we need. */\n+\tif (strstr(algo_str, \"AES-GCM\"))\n+\t\tinfo.algo = FIPS_TEST_ALGO_AES_GCM;\n+\telse\n+\t\treturn -EINVAL;\n+\n+\treturn 0;\n+}\n+\n+int\n+fips_test_parse_one_json_group(void)\n+{\n+\tint ret, i;\n+\tjson_int_t val;\n+\tjson_t *param;\n+\n+\tif (info.interim_callbacks) {\n+\t\tchar json_value[256];\n+\t\tfor (i = 0; info.interim_callbacks[i].key != NULL; i++) {\n+\t\t\tparam = json_object_get(json_info.json_test_group,\n+\t\t\t\t\tinfo.interim_callbacks[i].key);\n+\t\t\tval = json_integer_value(param);\n+\t\t\tsnprintf(json_value, 255, \"%\"JSON_INTEGER_FORMAT, val);\n+\t\t\t/* First argument is blank because the key\n+\t\t\t * is not included in the string being parsed.\n+\t\t\t */\n+\t\t\tret = info.interim_callbacks[i].cb(\n+\t\t\t\t\"\", json_value,\n+\t\t\t\tinfo.interim_callbacks[i].val\n+\t\t\t);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+fips_test_parse_one_json_case(void)\n+{\n+\tuint32_t i;\n+\tint ret = 0;\n+\tjson_t *param;\n+\n+\tfor (i = 0; info.callbacks[i].key != NULL; i++) {\n+\t\tparam = json_object_get(json_info.json_test_case, info.callbacks[i].key);\n+\t\tif (param) {\n+\t\t\tstrcpy(info.one_line_text, json_string_value(param));\n+\t\t\t/* First argument is blank because the key\n+\t\t\t * is not included in the string being parsed.\n+\t\t\t */\n+\t\t\tret = info.callbacks[i].cb(\n+\t\t\t\t\"\", info.one_line_text,\n+\t\t\t\tinfo.callbacks[i].val\n+\t\t\t);\n+\t\t\tif (ret < 0)\n+\t\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+#endif /* RTE_HAS_JANSSON */\n+\n static int\n parser_read_uint64_hex(uint64_t *value, const char *p)\n {\n", "prefixes": [ "v4", "3/8" ] }{ "id": 110520, "url": "