Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/106709/?format=api
http://patches.dpdk.org/api/patches/106709/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220129170313.489986-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": "<20220129170313.489986-4-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220129170313.489986-4-blo@iol.unh.edu", "date": "2022-01-29T17:03:11", "name": "[v2,3/5] examples/fips_validation: add json parsing", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "38aac75ff35d2fca38ac1461dd9c029ddd810b43", "submitter": { "id": 1678, "url": "http://patches.dpdk.org/api/people/1678/?format=api", "name": "Brandon Lo", "email": "blo@iol.unh.edu" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220129170313.489986-4-blo@iol.unh.edu/mbox/", "series": [ { "id": 21423, "url": "http://patches.dpdk.org/api/series/21423/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21423", "date": "2022-01-29T17:03:08", "name": "Add JSON vector set support to fips validation", "version": 2, "mbox": "http://patches.dpdk.org/series/21423/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/106709/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/106709/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 017FDA00C4;\n\tSat, 29 Jan 2022 18:03:36 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 20B5A410F3;\n\tSat, 29 Jan 2022 18:03:22 +0100 (CET)", "from mail-qk1-f181.google.com (mail-qk1-f181.google.com\n [209.85.222.181])\n by mails.dpdk.org (Postfix) with ESMTP id 6571840E0F\n for <dev@dpdk.org>; Sat, 29 Jan 2022 18:03:19 +0100 (CET)", "by mail-qk1-f181.google.com with SMTP id j24so6039270qkk.10\n for <dev@dpdk.org>; Sat, 29 Jan 2022 09:03:19 -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 f9sm5411879qkp.94.2022.01.29.09.03.18\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 29 Jan 2022 09:03:18 -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=hwcYX4lJA6/XOID/5tWwgZ1VPVelIB/PLcuK90R4zug=;\n b=LVuMcNmorCdGWPZcr5Jw2iFxjar1432D1C8Ube1+XxNKd9thCfm+I0W4o5u3hjPmNH\n 2FFedqaxK3zxfHcHRLPnIcV6Ii26MCp1RFtM0ITsuyjLJsbG74GHH8CJYMyy6uoNwn0t\n 7YUCggp53FH3fQTvpioFg1AB+NUwZjjkPa6VY=", "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=hwcYX4lJA6/XOID/5tWwgZ1VPVelIB/PLcuK90R4zug=;\n b=M+CzV1yylEHJFGoi3m3tYDr07W/nGB01PbkBkg/gLJDmKeeU/R/kIby6TTEM7SHv2v\n kpKqtaHce6fOx2HfLAJuL1EsGAWYWA9dhZHz6P4KUmrdLfpFhopmJncNi+mA1wEdRpXz\n vIFV+q/kS8aHxtgwyX2fbQniCWolZBjlHMrmltBWcIbxMGme03sHB9XsnmlrOtjOTzFM\n 7mE1FiVk1lJBn5+5RXHAbJp0Tw+ELfjaLi9Cd3W0X3RQlCNG8FeFY7qRsWOfKSVr6Hl2\n eV03TD/rNnLAXhWLcoiwyFH/R4xNPPNBsFswDZu4+rW28V223YpC9cH72LwM1IKGUJdl\n U7Uw==", "X-Gm-Message-State": "AOAM532Dc5NDH0t7EkzeaxWnUaCjo1Lb/n9nrJoVmAVaeiCxHLbfHihh\n qMSA70t3Z/Rw4XfZ4yTRALV7kA==", "X-Google-Smtp-Source": "\n ABdhPJy23d22EfZdd+gx/ZFDiNwKF3yUih5BJ/tSaUmu9bcVsOJ6xMlwlLr06JsXqAS8gpm+auNo2w==", "X-Received": "by 2002:a05:620a:1511:: with SMTP id\n i17mr9227979qkk.77.1643475798813;\n Sat, 29 Jan 2022 09:03:18 -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 v2 3/5] examples/fips_validation: add json parsing", "Date": "Sat, 29 Jan 2022 12:03:11 -0500", "Message-Id": "<20220129170313.489986-4-blo@iol.unh.edu>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220129170313.489986-1-blo@iol.unh.edu>", "References": "<20220127145142.86742-1-blo@iol.unh.edu>\n <20220129170313.489986-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---\nv2:\n* fix for loop initialization\n\n examples/fips_validation/fips_validation.c | 90 +++++++++++++++++++++-\n 1 file changed, 87 insertions(+), 3 deletions(-)", "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex 52a7bf952d..6f83cb7fc4 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,8 @@ 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) return 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 +448,71 @@ 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\")) info.algo = FIPS_TEST_ALGO_AES_GCM;\n+\telse return -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, info.interim_callbacks[i].key);\n+\t\t\tjson_int_t val = json_integer_value(param);\n+\t\t\tsprintf(json_value, \"%lld\", 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\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\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": [ "v2", "3/5" ] }{ "id": 106709, "url": "