Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/110523/?format=api
http://patches.dpdk.org/api/patches/110523/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220429161559.415645-7-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-7-blo@iol.unh.edu>", "list_archive_url": "https://inbox.dpdk.org/dev/20220429161559.415645-7-blo@iol.unh.edu", "date": "2022-04-29T16:15:57", "name": "[v4,6/8] examples/fips_validation: add json to hmac", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "553c151069abbf3c16fee8c0fa86aa218d5436f5", "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-7-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/110523/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/110523/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 0C5F9A04FF;\n\tFri, 29 Apr 2022 18:16:43 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D057B4283B;\n\tFri, 29 Apr 2022 18:16:11 +0200 (CEST)", "from mail-qt1-f182.google.com (mail-qt1-f182.google.com\n [209.85.160.182])\n by mails.dpdk.org (Postfix) with ESMTP id 7260742832\n for <dev@dpdk.org>; Fri, 29 Apr 2022 18:16:08 +0200 (CEST)", "by mail-qt1-f182.google.com with SMTP id x9so6114763qts.6\n for <dev@dpdk.org>; Fri, 29 Apr 2022 09:16:08 -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.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 29 Apr 2022 09:16:07 -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=EzJ3kxPq37sIG+M3jBZ4BC1iiJ1GgCH/+Bj2xldNKe0=;\n b=JWcVgv51UoF7Sbeew2Kc4oS/cpM6nVI/JV68RkZ5SnKSOhe/t6qxa/yDD4wvXQ3tY1\n AI7w0r4RbzEVMKbT6KB8jtby0esjNqy0iOL32bxG/kmddrbA/NNmakUKgQLHl7hCX7xX\n GzgpmhD6kWwqrWK5xykFZ8lorNi6FQQhya/pQ=", "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=EzJ3kxPq37sIG+M3jBZ4BC1iiJ1GgCH/+Bj2xldNKe0=;\n b=oEIdAqIm8UWNh80ubSfrGr7m74q5jGVPkQpB4MF21aXcefniMwiEbT8qMiq0pulMPk\n yhgS7v0fF3fxcskJ7MEWtmb7U+MFz0aZvZbHfzJuHIE+Od8QbnYoqT3Cuig36mB68Mfo\n lOKKOHSt+A/6c1AQbTbE6jdLKcqlxDH1EWu0qgQiaDW2XluT6jMP3cQlnqOtZV6PXi0V\n g/PAIccBSNPfFsRcK0jlIDQTfVEXw/3aK11ehGEvynkXfPNl7FTIVDvYpblzOxN9qTap\n xEaKumWpTT0NuIidw+qzz24h8fDPzWRbFyIXYpH4WtERR5A0m0He6Jc0tKs2Hy8jcW+X\n f9Gw==", "X-Gm-Message-State": "AOAM532fQyGCzojlbPMUtnj7CO7YU2XrPiEKxTWG33f92hYE7v1z/JBx\n fh+fkLB+B+WwZsmGTpKLYyKaiIUsH3NrAQ==", "X-Google-Smtp-Source": "\n ABdhPJznNCCrefIWk3NTCgNjwpNsxI4k31EQIz6nf6rVCU388unHVNJsO9v67tkW7NgrdW6oMS/nUw==", "X-Received": "by 2002:ac8:5dd4:0:b0:2f3:8801:856f with SMTP id\n e20-20020ac85dd4000000b002f38801856fmr138288qtx.107.1651248967870;\n Fri, 29 Apr 2022 09:16:07 -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 6/8] examples/fips_validation: add json to hmac", "Date": "Fri, 29 Apr 2022 12:15:57 -0400", "Message-Id": "<20220429161559.415645-7-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": "Adds JSON support for the HMAC algorithm.\n\nSigned-off-by: Brandon Lo <blo@iol.unh.edu>\n---\n examples/fips_validation/fips_validation.c | 2 +\n examples/fips_validation/fips_validation.h | 6 ++\n .../fips_validation/fips_validation_hmac.c | 93 +++++++++++++++++++\n examples/fips_validation/main.c | 3 +\n 4 files changed, 104 insertions(+)", "diff": "diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c\nindex d220dcab1f..04dfb85262 100644\n--- a/examples/fips_validation/fips_validation.c\n+++ b/examples/fips_validation/fips_validation.c\n@@ -458,6 +458,8 @@ fips_test_parse_one_json_vector_set(void)\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+\tif (strstr(algo_str, \"HMAC\"))\n+\t\tinfo.algo = FIPS_TEST_ALGO_HMAC;\n \telse\n \t\treturn -EINVAL;\n \ndiff --git a/examples/fips_validation/fips_validation.h b/examples/fips_validation/fips_validation.h\nindex 8d7af99e04..2c65d838b0 100644\n--- a/examples/fips_validation/fips_validation.h\n+++ b/examples/fips_validation/fips_validation.h\n@@ -253,6 +253,12 @@ fips_test_parse_one_json_case(void);\n \n int\n parse_test_gcm_json_init(void);\n+\n+int\n+parse_test_hmac_json_init(void);\n+\n+int\n+parse_test_hmac_json_algorithm(void);\n #endif /* RTE_HAS_JANSSON */\n \n int\ndiff --git a/examples/fips_validation/fips_validation_hmac.c b/examples/fips_validation/fips_validation_hmac.c\nindex 1285c9d283..4cd1b1ac07 100644\n--- a/examples/fips_validation/fips_validation_hmac.c\n+++ b/examples/fips_validation/fips_validation_hmac.c\n@@ -19,6 +19,15 @@\n #define PT_STR\t\t\"Msg = \"\n #define TAG_STR\t\t\"Mac = \"\n \n+#define ALGO_JSON_STR\t\"algorithm\"\n+\n+#define KEYLEN_JSON_STR\t\"keyLen\"\n+#define TAGLEN_JSON_STR\t\"macLen\"\n+\n+#define KEY_JSON_STR\t\"key\"\n+#define PT_JSON_STR\t\t\"msg\"\n+#define TAG_JSON_STR\t\"mac\"\n+\n struct hash_size_conversion {\n \tconst char *str;\n \tenum rte_crypto_auth_algorithm algo;\n@@ -65,6 +74,29 @@ struct fips_test_callback hmac_tests_interim_vectors[] = {\n \t\t{NULL, NULL, NULL} /**< end pointer */\n };\n \n+#ifdef RTE_HAS_JANSSON\n+struct hash_size_conversion json_algorithms[] = {\n+\t\t{\"HMAC-SHA-1\", RTE_CRYPTO_AUTH_SHA1_HMAC},\n+\t\t{\"HMAC-SHA2-224\", RTE_CRYPTO_AUTH_SHA224_HMAC},\n+\t\t{\"HMAC-SHA2-256\", RTE_CRYPTO_AUTH_SHA256_HMAC},\n+\t\t{\"HMAC-SHA2-384\", RTE_CRYPTO_AUTH_SHA384_HMAC},\n+\t\t{\"HMAC-SHA2-512\", RTE_CRYPTO_AUTH_SHA512_HMAC},\n+};\n+\n+struct fips_test_callback hmac_tests_json_vectors[] = {\n+\t\t{KEY_JSON_STR, parse_uint8_hex_str, &vec.cipher_auth.key},\n+\t\t{PT_JSON_STR, parse_uint8_hex_str, &vec.pt},\n+\t\t{TAG_JSON_STR, parse_uint8_hex_str, &vec.cipher_auth.digest},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+\n+struct fips_test_callback hmac_tests_interim_json_vectors[] = {\n+\t\t{KEYLEN_JSON_STR, parser_read_uint32_val, &vec.cipher_auth.key},\n+\t\t{TAGLEN_JSON_STR, parser_read_uint32_bit_val, &vec.cipher_auth.digest},\n+\t\t{NULL, NULL, NULL} /**< end pointer */\n+};\n+#endif /* RTE_HAS_JANSSON */\n+\n static int\n parse_test_hmac_writeback(struct fips_val *val)\n {\n@@ -103,3 +135,64 @@ parse_test_hmac_init(void)\n \n \treturn 0;\n }\n+\n+#ifdef RTE_HAS_JANSSON\n+static int\n+parse_test_hmac_json_writeback(struct fips_val *val)\n+{\n+\tstruct fips_val val_local;\n+\tjson_t *tcId, *mac;\n+\n+\ttcId = json_object_get(json_info.json_test_case, \"tcId\");\n+\n+\tjson_info.json_write_case = json_object();\n+\tjson_object_set(json_info.json_write_case, \"tcId\", tcId);\n+\n+\n+\tval_local.val = val->val + vec.pt.len;\n+\tval_local.len = vec.cipher_auth.digest.len;\n+\n+\twriteback_hex_str(\"\", info.one_line_text, &val_local);\n+\n+\tmac = json_string(info.one_line_text);\n+\tjson_object_set_new(json_info.json_write_case, TAG_JSON_STR, mac);\n+\n+\treturn 0;\n+}\n+\n+int\n+parse_test_hmac_json_algorithm(void)\n+{\n+\tjson_t *algorithm_object;\n+\tconst char *algorithm_str;\n+\tuint32_t i;\n+\n+\talgorithm_object = json_object_get(json_info.json_vector_set, \"algorithm\");\n+\talgorithm_str = json_string_value(algorithm_object);\n+\n+\tfor (i = 0; i < RTE_DIM(json_algorithms); i++) {\n+\t\tif (strstr(algorithm_str, json_algorithms[i].str)) {\n+\t\t\tinfo.interim_info.hmac_data.algo = json_algorithms[i].algo;\n+\t\t\treturn 0;\n+\t\t}\n+\t}\n+\n+\treturn -1;\n+}\n+\n+int\n+parse_test_hmac_json_init(void)\n+{\n+\tinfo.op = FIPS_TEST_ENC_AUTH_GEN;\n+\tinfo.parse_writeback = parse_test_hmac_json_writeback;\n+\tinfo.callbacks = hmac_tests_json_vectors;\n+\tinfo.writeback_callbacks = NULL;\n+\tinfo.kat_check = rsp_test_hmac_check;\n+\tinfo.interim_callbacks = hmac_tests_interim_json_vectors;\n+\n+\tif (parse_test_hmac_json_algorithm() < 0)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+#endif /* RTE_HAS_JANSSON */\ndiff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c\nindex a1d8a1d758..de6dedaf75 100644\n--- a/examples/fips_validation/main.c\n+++ b/examples/fips_validation/main.c\n@@ -1943,6 +1943,9 @@ fips_test_one_test_group(void)\n \tcase FIPS_TEST_ALGO_AES_GCM:\n \t\tret = parse_test_gcm_json_init();\n \t\tbreak;\n+\tcase FIPS_TEST_ALGO_HMAC:\n+\t\tret = parse_test_hmac_json_init();\n+\t\tbreak;\n \tdefault:\n \t\treturn -EINVAL;\n \t}\n", "prefixes": [ "v4", "6/8" ] }{ "id": 110523, "url": "