Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106717/?format=api
http://patches.dpdk.org/api/patches/106717/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220129175514.746925-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": "<20220129175514.746925-4-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220129175514.746925-4-blo@iol.unh.edu", "date": "2022-01-29T17:55:12", "name": "[v3,3/5] examples/fips_validation: add json parsing", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0699422b353ad8e7da136ffcacf664025a71e996", "submitter": { "id": 1678, "url": "http://patches.dpdk.org/api/people/1678/?format=api", "name": "Brandon Lo", "email": "blo@iol.unh.edu" }, "delegate": null, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220129175514.746925-4-blo@iol.unh.edu/mbox/", "series": [ { "id": 21426, "url": "http://patches.dpdk.org/api/series/21426/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21426", "date": "2022-01-29T17:55:09", "name": "Add JSON vector set support to fips validation", "version": 3, "mbox": "http://patches.dpdk.org/series/21426/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/106717/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/106717/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 8E37AA00C4;\n\tSat, 29 Jan 2022 18:55:32 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 91309410F7;\n\tSat, 29 Jan 2022 18:55:23 +0100 (CET)", "from mail-qk1-f174.google.com (mail-qk1-f174.google.com\n [209.85.222.174])\n by mails.dpdk.org (Postfix) with ESMTP id EB462410F1\n for <dev@dpdk.org>; Sat, 29 Jan 2022 18:55:20 +0100 (CET)", "by mail-qk1-f174.google.com with SMTP id w8so8392458qkw.8\n for <dev@dpdk.org>; Sat, 29 Jan 2022 09:55:20 -0800 (PST)", "from blo.hsd1.nh.comcast.net\n ([2601:187:807e:37c0:8f3:b5b9:6ccc:8a5c])\n by smtp.gmail.com with ESMTPSA id 195sm5423654qkf.30.2022.01.29.09.55.19\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 29 Jan 2022 09:55:19 -0800 (PST)" ], "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=XSGv7FdmdF/Loly4IgpZ0yQfwKax+bk05xiSvsUPsFg=;\n b=gTYchceErv8qhTu1yyzl4yQP5LsjuXFhul2SKZfxI7YUrm6BqP/zK5Dcns94FsYC3y\n JRjy2dxuAldX78r1rczLQMLBBPoDfkHI5PFr87lUYSOCUNX9iEOlZKyI4JN1nzbZ/DO8\n PNYOeD+fA8fDb8V8nomlUa22SkZJHmGKXuMas=", "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=XSGv7FdmdF/Loly4IgpZ0yQfwKax+bk05xiSvsUPsFg=;\n b=zHZzCUHgQRuORsp61jv7Glbb4W4876Ke5SnvpzctEN5/el5J7c0JzaDXRQDUPPq9lT\n LlafZZMsSnPUf34/VrZeqDtXrOLHtGqQlZlRnr991sF+YUg+hlbnrfRtlqDoXhHvmcwz\n ai0Fkw0pPnmftwTlRpim2NVXGBNoy8cNJm0kj+cCJaFHXj8Or3AI2MsRCJArsjk1LJA5\n IM2DJD1+FAnam/venx12YxzXI7CXCbVQV7K3cWZ3T/3vADUFIP2+Q8qMAmMjGuqfTZ7c\n 5atneFPHoIK0h24cMp8i3Vu/bxatLAU5730zB3ln5azFnRXR0vcdVYUpCQ7Dn/j2Fl5M\n nCAw==", "X-Gm-Message-State": "AOAM531VoG2YUrLzUcz/pdDQXC0G+l4hK3J3YFG2/ZV+7R3ZSSINuPsY\n jxiNVZM+djVmO05L/UfEvceMRL7ZfWT1I+fcMSI=", "X-Google-Smtp-Source": "\n ABdhPJyLiFNLaHgc8A0Jc6J9VxdsRLekFSMdn65j0gNTmTT4tm81PO47RUFXXQV+7rQ3zbHT9n/m9w==", "X-Received": "by 2002:a37:5345:: with SMTP id h66mr8730794qkb.40.1643478920060;\n Sat, 29 Jan 2022 09:55:20 -0800 (PST)", "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 v3 3/5] examples/fips_validation: add json parsing", "Date": "Sat, 29 Jan 2022 12:55:12 -0500", "Message-Id": "<20220129175514.746925-4-blo@iol.unh.edu>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220129175514.746925-1-blo@iol.unh.edu>", "References": "<20220129170313.489986-1-blo@iol.unh.edu>\n <20220129175514.746925-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 | 96 +++++++++++++++++++++-\n 1 file changed, 93 insertions(+), 3 deletions(-)", "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex 52a7bf952d..198cdb5688 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -270,12 +270,14 @@ parse_file_type(const char *path)\n {\n \tconst char *tmp = path + strlen(path) - 3;\n \n-\tif (strstr(tmp, REQ_FILE_PERFIX))\n+\tif (strstr(tmp, REQ_FILE_SUFFIX))\n \t\tinfo.file_type = FIPS_TYPE_REQ;\n-\telse if (strstr(tmp, RSP_FILE_PERFIX))\n+\telse if (strstr(tmp, RSP_FILE_SUFFIX))\n \t\tinfo.file_type = FIPS_TYPE_RSP;\n-\telse if (strstr(path, FAX_FILE_PERFIX))\n+\telse if (strstr(path, FAX_FILE_SUFFIX))\n \t\tinfo.file_type = FIPS_TYPE_FAX;\n+\telse if (strstr(path, JSON_FILE_SUFFIX))\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@@ -429,6 +449,76 @@ 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+\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\tjson_t *param = json_object_get(json_info.json_test_group,\n+\t\t\t\tinfo.interim_callbacks[i].key);\n+\t\t\tjson_int_t val = 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+\n+\tfor (i = 0; info.callbacks[i].key != NULL; i++) {\n+\t\tjson_t *param = json_object_get(json_info.json_test_case, info.callbacks[i].key);\n+\t\tif (param) {\n+\t\t\tconst char *json_string = json_string_value(param);\n+\t\t\tstrcpy(info.one_line_text, json_string);\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": [ "v3", "3/5" ] }{ "id": 106717, "url": "