From patchwork Tue Feb 28 17:28:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 124588 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 6C77E41D9F; Tue, 28 Feb 2023 18:30:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBBE64114B; Tue, 28 Feb 2023 18:29:37 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D7F6F42D12 for ; Tue, 28 Feb 2023 18:29:23 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31SGu5E4023933; Tue, 28 Feb 2023 09:29:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=h75LEOtcItMpS8SSLzQIbKFRUC560K844WVi1ir3Tjg=; b=guGyZeat70D1fvhof9ck/7o9NtX2R4YVc4cYMdzqWeBBRalwbuD4oqlWyRDucIOQTU0G w0/zK6VYSal5GcSbo9VVza8y8rKtJUcAZxeBQ9fKJjz0nNmh3wyhT/9QIK3stDGfrurK 5dFLy6tNo1ZgJhQmiJhU0LLg65IFs3Glm80A2dbC212BNjBddjHkV4DCv9ERLmHJ8OeY bgSPmORIuMh/9An/ESSYZsfHSyquj23WfwUMDb71WOPSfPHEI+PjcYU2nMcIx5SID9zG t/i8+XEOS5R99uXO1KzF+oYzdSIQhY+Ib1HP6onTgQCfOi3hG1cQRv6Tz+tn5pIAKH4i zA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nyjqty0qf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 28 Feb 2023 09:29:23 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 28 Feb 2023 09:29:21 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 28 Feb 2023 09:29:21 -0800 Received: from localhost.localdomain (unknown [10.28.34.38]) by maili.marvell.com (Postfix) with ESMTP id 353365B6942; Tue, 28 Feb 2023 09:29:18 -0800 (PST) From: Gowrishankar Muthukrishnan To: CC: Anoob Joseph , , Akhil Goyal , Brian Dooley , "Gowrishankar Muthukrishnan" Subject: [v2, 08/10] examples/fips_validation: fix AES GCM validation tests Date: Tue, 28 Feb 2023 22:58:54 +0530 Message-ID: <2827bb16bdf09d4ab432860bf3b56a537399b11b.1677604524.git.gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: cPZJGMoz0VrkarsbDCHGrtwokPsgVO-8 X-Proofpoint-GUID: cPZJGMoz0VrkarsbDCHGrtwokPsgVO-8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-02-28_15,2023-02-28_03,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org AES GCM validation tests fail in FIPS validation due to incorrect fields populated in response file. This patch fixes them. Fixes: 5b540bebac8e ("examples/fips_validation: fix GMAC decryption output") Signed-off-by: Gowrishankar Muthukrishnan --- examples/fips_validation/fips_validation_gcm.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/fips_validation/fips_validation_gcm.c b/examples/fips_validation/fips_validation_gcm.c index a80d8b3e4d..bf08d1b995 100644 --- a/examples/fips_validation/fips_validation_gcm.c +++ b/examples/fips_validation/fips_validation_gcm.c @@ -79,7 +79,7 @@ parser_read_gcm_pt_len(const char *key, char *src, if (ret < 0) return ret; - if (vec.pt.len == 0) { + if (info.algo == FIPS_TEST_ALGO_AES_GMAC && vec.pt.len == 0) { info.interim_info.gcm_data.is_gmac = 1; test_ops.prepare_sym_op = prepare_auth_op; test_ops.prepare_sym_xform = prepare_gmac_xform; @@ -296,6 +296,7 @@ parse_test_gcm_json_writeback(struct fips_val *val) tmp_val.val = val->val; tmp_val.len = vec.pt.len; + info.one_line_text[0] = '\0'; writeback_hex_str("", info.one_line_text, &tmp_val); ct = json_string(info.one_line_text); json_object_set_new(json_info.json_write_case, CT_JSON_STR, ct); @@ -326,6 +327,7 @@ parse_test_gcm_json_writeback(struct fips_val *val) tmp_val.val = val->val; tmp_val.len = vec.pt.len; + info.one_line_text[0] = '\0'; writeback_hex_str("", info.one_line_text, &tmp_val); json_object_set_new(json_info.json_write_case, PT_JSON_STR, json_string(info.one_line_text)); @@ -334,12 +336,8 @@ parse_test_gcm_json_writeback(struct fips_val *val) json_true()); } } else { - if (!info.interim_info.gcm_data.is_gmac) - json_object_set_new(json_info.json_write_case, PT_JSON_STR, - json_string("")); - else - json_object_set_new(json_info.json_write_case, "testPassed", - json_false()); + json_object_set_new(json_info.json_write_case, "testPassed", + json_false()); } }