From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB2D2C3A5A6 for ; Thu, 19 Sep 2019 11:55:02 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 7F71421924 for ; Thu, 19 Sep 2019 11:55:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="NICFHPq6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F71421924 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 727E51EF9A; Thu, 19 Sep 2019 13:54:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 266AF1EF5F; Thu, 19 Sep 2019 13:54:18 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8JBohmP028440; Thu, 19 Sep 2019 04:54:17 -0700 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=pfpt0818; bh=75MXO6014ZprzrBoYSTGffwYOE+Pdcf7PmJm6PgPoSI=; b=NICFHPq60A0JCxpThmrpGW6nn6GbAvpX6kjKnZdSef/RAqJ+lp36jyayiNQvv+plZC7n SQwpSHJnt7hLn5QeXwDkqy4k07kET031/7b5D6+3tZFjC2EbThX41EbO1lD3Yfka22Ho rPvAGuqwc7wYsuIrOt/pPAERjX4rQ/Onwzb5R/02v6cvGSsVs7QRZlQESVNJkXbpSb65 4Y0ju6bgdHpb+0xJ3Jt5Xd18+7qtQYopMUNaJyGk7IGkUjc0/7wKoTFBdg9G7+6T6ERy SnL1KKfXm4zyTuiTht32yPfgUCVkfhjnOfwEyJ7eH+kn4ewf2gdAUYxbLR6BPBvcBNY9 0g== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2v3vcfjn55-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 19 Sep 2019 04:54:17 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 19 Sep 2019 04:54:15 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 19 Sep 2019 04:54:15 -0700 Received: from vvenus375.il.marvell.com (unknown [10.5.120.75]) by maili.marvell.com (Postfix) with ESMTP id F365B3F7040; Thu, 19 Sep 2019 04:54:13 -0700 (PDT) From: To: CC: , , , , Date: Thu, 19 Sep 2019 15:12:30 +0300 Message-ID: <20190919121232.4864-7-michaelsh@marvell.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190919121232.4864-1-michaelsh@marvell.com> References: <20190919121232.4864-1-michaelsh@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-19_04:2019-09-19,2019-09-19 signatures=0 Subject: [dpdk-dev] [PATCH 6/8] examples/fips_validation: fix overwrite of KEY line in TDES X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Michael Shamis Fix for TCBCMonte2, TCBCMonte3 and TECBMonte2: application overwrites key1 line in output file so comparision with sample files failed Signed-off-by: Michael Shamis --- examples/fips_validation/fips_validation.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/fips_validation/fips_validation.c b/examples/fips_validation/fips_validation.c index 80fd482a1..9aa423b0f 100644 --- a/examples/fips_validation/fips_validation.c +++ b/examples/fips_validation/fips_validation.c @@ -11,6 +11,10 @@ #include "fips_validation.h" +#define COUNT0_STR "COUNT = 0 " +#define KEY_STR "KEY" +#define NK_STR "NumKey" + #define skip_white_spaces(pos) \ ({ \ __typeof__(pos) _p = (pos); \ @@ -68,6 +72,22 @@ fips_test_fetch_one_block(void) if (size == 0) break; + /* if first line is KEY-line then insert COUNT-line */ + if (i == 0) { + if (strstr(info.one_line_text, KEY_STR)) { + info.vec[0] = calloc(1, sizeof(COUNT0_STR)); + strlcpy(info.vec[0], + COUNT0_STR, + sizeof(COUNT0_STR)); + i = 1; + info.nb_vec_lines = 1; + } + } + + /* don't copy NumKey-line */ + if (strstr(info.one_line_text, NK_STR)) + break; + info.vec[i] = calloc(1, size + 5); if (info.vec[i] == NULL) goto error_exit; -- 2.23.0