From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 34756A04BC; Thu, 8 Oct 2020 12:24:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7CBB11BDDB; Thu, 8 Oct 2020 12:24:56 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 779021BDCB; Thu, 8 Oct 2020 12:24:54 +0200 (CEST) IronPort-SDR: oat4aXCFsyOiI4OdR0AvKerkIKi8tqmsJIX9QR4Y4PN6prEZjgn5pzd4FZ9QslwwTczsvJBRrJ Sp6Hp27xE87Q== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="153146339" X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="153146339" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 03:24:51 -0700 IronPort-SDR: h4/2IxLDKOAWE838Taw0MtZW1F8TLeuljxZle8kbYH82dyN7isyCjy+39bHju4j3iZbGGZgIeT IoNCjLm6YXXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="528439250" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 08 Oct 2020 03:24:51 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 8 Oct 2020 03:24:51 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 8 Oct 2020 03:24:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Thu, 8 Oct 2020 03:24:51 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.58) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Thu, 8 Oct 2020 03:24:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mciHU8xXANqQWFXgzo/qGydO4PdH8PZUh3dlVZ5tdbBCkZKhMcgf1Dg7jd7NP+Wb9fCRiRvL1QKmJBNc3queE+EArFjAFlMbqqMXyyhp1md/e7mQXVOcOlSkGsxk53YHT9o9HLSStfUoBKPf7UPH9udTDnbRf2WXpM1dY5SKaEuQ2LrUZuGt6E7M++Q0ZDuXibq8V9P/T4f1KXax2d8w0p4JVp/dPtDpSNTSEsgThqfaZXCQg6kOLHxfRZ+xE+33CEQAWj0EzDZbgXP4n6j5mPr/M/Q+DOnkRYHD3e3hvPx8THzcBRUxfy7rbauDuwSPXIAjJPYI8vMpBRueiKKubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I5Eqfvb0U1vUeI+uOnqNboX8kOzy2KlgQ+8665PdXQI=; b=M9CTitndPpH6BKoeKWIN6QdPJDooL3TMmfQDZqS9wlUQo7JxqsmFS/ehAVlp8mNW4EVOvNFBHfzf24VEd+dws7QRGBBnBwfI5sawyeqsGyafPiZeLL14c+Z2Vb9J2W2mTZJW9ubZGI6dOpxBbnCtEUcJpxg6ESisu9n9zk+T4rtbpC4cJi2KzzDlrwpX1fezrtQUNT8uSK3qIgaWqakyGQbcFdTj1Fv/pNqrsw9rHcoLdr1qBLXtxwQRyfC2bqSWg5EGjUOyJv/URr10tIJyriq9WEzdmo53UsFzx4oWa+V94T5K0LnVSxuSASscATfXnxa16w0FMy9gY+bfKeqM+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I5Eqfvb0U1vUeI+uOnqNboX8kOzy2KlgQ+8665PdXQI=; b=ADdhQINbmjaqA3bWztY53cCDhargDK0fDF8/fy9SXNQszvK7hr5Cfy6b//T600iEghaGJ76cOQpdtrUSVWW8Izq2oANWzPfj35nVPf9ze55YPT9juUPBzuGI/PP/pw9f9nIzzPmuQ3vV+5beS2NQtMOCkaQ+Vc/FKEcb1sqbBzE= Received: from BL0PR11MB3043.namprd11.prod.outlook.com (2603:10b6:208:33::19) by MN2PR11MB4711.namprd11.prod.outlook.com (2603:10b6:208:24e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.21; Thu, 8 Oct 2020 10:24:48 +0000 Received: from BL0PR11MB3043.namprd11.prod.outlook.com ([fe80::11fa:a7fe:329d:9239]) by BL0PR11MB3043.namprd11.prod.outlook.com ([fe80::11fa:a7fe:329d:9239%5]) with mapi id 15.20.3455.023; Thu, 8 Oct 2020 10:24:48 +0000 From: "Zhang, Roy Fan" To: Olivier Matz CC: "dev@dpdk.org" , "Kovacevic, Marko" , Akhil Goyal , "Kusztal, ArkadiuszX" , "stable@dpdk.org" , Anoob Joseph Thread-Topic: [PATCH 2/3] examples/fips_validation: ignore \r in input files Thread-Index: AQHWm7Q4Kcw8UFQAJkyqV8ey/1yPmamKQQZwgAAY/oCAAwz2AIAACm6AgAANLtA= Date: Thu, 8 Oct 2020 10:24:48 +0000 Message-ID: References: <20201006074143.31691-1-olivier.matz@6wind.com> <20201006074143.31691-3-olivier.matz@6wind.com> <20201006100901.GJ21395@platinum> <20201008092131.GU21395@platinum> In-Reply-To: <20201008092131.GU21395@platinum> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: 6wind.com; dkim=none (message not signed) header.d=none;6wind.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [95.44.220.85] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ffae83ff-da5d-4aec-4f3e-08d86b746278 x-ms-traffictypediagnostic: MN2PR11MB4711: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bm6Kpfs7reo0lMoK5TkecsNNsPjJWpFyexSjdflAytl1GLobYVBE6DKK5qQ9oMez24rYVxnHv0WVIwddkLvaOhQ/KftdbXE6U4TY/VZgb9KBwacyzvj9oNbfNhALwXfBJ8NyhSc5EgORoWUHB1yATEhn7IgDFDr9v5D8M9EhhyNdJRqORxKZrpTVyAggdh9YnTl+MbiR3RXrTpIN731zKMNQEUJdRTbcSOb6NzIPZ2nuYnKQxFMnPSO39yPOSZ7yOLE8xQM1NjSKnYQx5uRnRnqCoNl7NwXgd6Jt7cnhgFxUefwEAiyMzz6Y9Tt6mYv/yQDqpS0ZBz5P7195S6icVqgBmcPebZwLv1wmpFhQmDsT3/3dmTufzvnOrRjwwUPabEOvd+zPdBZMSv5W67aoag== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR11MB3043.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(346002)(136003)(366004)(39860400002)(376002)(64756008)(33656002)(26005)(6916009)(71200400001)(83380400001)(6506007)(55016002)(9686003)(53546011)(8676002)(8936002)(4326008)(76116006)(186003)(86362001)(54906003)(316002)(83080400001)(52536014)(66556008)(66946007)(966005)(66446008)(7696005)(5660300002)(478600001)(66476007)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: AZDJjbTRkfKgjq3YQVdTdu+VQQH1HM1Vjrtg53nVEnA7S3LDy3B+i0ACVNrhRZV+/ZqT7KqKPyXMRXqyTz+Spk6JUDx1tuw2VZxRGRL2RMlm63JZNKyOCrvDy6AsiKjfu5x0tH7ha34u0fiUIQS75hpmBvLbYSDTQSI8BMd86d6NjEGb7cLrLHXfULt0YDoB/Pdw33D3vQ8E+Wlz6M3foaL2knEhg+vhN+URFVEDWwVBvCTHo0KI+1wI9ogTnftmI5xX1a94yoKwO5Q2mdOJbdic3r9DWPRw7Q4IkWseuslDS7h6KuxDb5LcYNg5CP2BO8546xav5oQMmSpdnvcchTK9V8yjgdKlk5Y9uaXGyq+SLmda6jiW1vXXPPmseWhtOkeEFm+87mpIC5D1569sCZBSVPCpj49GtnNS2Ig1N2wwOgSCATGFI7394iJ/j38OtSCC6bPpemZm7dDq6bmql7QOwD+ZqkOdv8ZhNP9ewxNpSIgrlkAYdXEsayWPXTLnMUoeiFI+b1tMOwhySasdu5VkMchqiuEQD3nioRcIRNb8u9R0oA0ZB3YTyMsyalyWTQD4g65EPNaZkXd3Y/HbMR3s1/H3I4Wi1ZvB4py+c9PtgUzcn73fUtpkar1nvaV2H9TB/wjjdp3ec3h9BWPjwQ== Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL0PR11MB3043.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffae83ff-da5d-4aec-4f3e-08d86b746278 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2020 10:24:48.3506 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LNvj14++t3Cl2V1ONEGvLKR7MTZKVgFn5KuiADla1QG7jbZv5H6HRzuM4oaQ/sp/oo42sJKm6h5LaHGXiSs9jA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4711 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/3] examples/fips_validation: ignore \r in input files 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" Hi Olivier, Sorry I didn't state myself clear in the first place. My intention is '\r' check, or any future CAVS version specific change to t= he application should be wrapped into a branch that is checked with parsed version number. With this way the original application's behavior should remain the same. The reason for that is we are having an issue right now that the validation team is struggling with the limited test vectors and inconsistency formatti= ng between different FIPS CAVS versions. For example we still have FIPS TDES t= est failing today due to the different test file versions. https://bugs.dpdk.org/show_bug.cgi?id=3D512=20 The solution is certainly far from pretty but should help to share the maintenance effort amongst the contributors. The "FIPS_DEF_VERSION" can be removed of course. Regards, Fan > -----Original Message----- > From: Olivier Matz > Sent: Thursday, October 8, 2020 10:22 AM > To: Zhang, Roy Fan > Cc: dev@dpdk.org; Kovacevic, Marko ; Akhil > Goyal ; Kusztal, ArkadiuszX > ; stable@dpdk.org; Anoob Joseph > > Subject: Re: [PATCH 2/3] examples/fips_validation: ignore \r in input fil= es >=20 > Hi, >=20 > On Thu, Oct 08, 2020 at 08:50:25AM +0000, Zhang, Roy Fan wrote: > > Hi Olivier, > > > > Anood and us had the similar discussion. > > > > Can we change the sample application to parse version data instead, > > and for the version specific code changes we will wrap them by a > > branch to compare the parsed version and the expected version? > > (we probably should have done that long time ago). > > > > I drafted a code change to parse the version data, see if you think it > > is ok? >=20 > Thank you for your feedback. >=20 > The code that gets the version looks good to me (I just have a > small comment, see below). However I'm not sure what to do with it. >=20 > Do you mean we should return an error if the version is incorrect? Or > should we only skip '\r' for old versions? FIPS_DEF_VERSION is not used > in your patch. In that case, I think it is a bit overkill. Do you think > it is a problem to always drop '\r'? >=20 > If you think we should not support files containing '\r', I'm fine > with it, I can drop this particular patch. >=20 >=20 > > > > diff --git a/examples/fips_validation/fips_validation.c > b/examples/fips_validation/fips_validation.c > > index 9bdf257b8..9b6518c92 100644 > > --- a/examples/fips_validation/fips_validation.c > > +++ b/examples/fips_validation/fips_validation.c > > @@ -98,7 +98,7 @@ fips_test_parse_header(void) > > uint32_t i; > > char *tmp; > > int ret; > > - int algo_parsed =3D 0; > > + int algo_parsed =3D 0, version_parsed =3D 0; > > time_t t =3D time(NULL); > > struct tm *tm_now =3D localtime(&t); > > > > @@ -107,6 +107,27 @@ fips_test_parse_header(void) > > return ret; > > > > for (i =3D 0; i < info.nb_vec_lines; i++) { > > + /* parse the version info */ > > + tmp =3D strstr(info.vec[i], "CAVS "); > > + if (tmp !=3D NULL) { > > + if (version_parsed !=3D 0) { > > + RTE_LOG(ERR, USER1, > > + "Multiple version data\n"); > > + return -1; > > + } > > + > > + tmp =3D tmp + sizeof("CAVS "); >=20 > I think it should be strlen(), because sizeof() will contain > the '\0'. Or it could be sizeof() - 1. >=20 > > + > > + if (strlen(tmp) >=3D MAX_VER_STRING_SIZE) { > > + RTE_LOG(ERR, USER1, "Version (%s) too > long\n", > > + tmp); > > + return -1; > > + } > > + > > + strlcpy(info.version, tmp, MAX_VER_STRING_SIZE); > > + version_parsed =3D 1; > > + } > > + > > if (!algo_parsed) { > > if (strstr(info.vec[i], "AESVS")) { > > algo_parsed =3D 1; > > diff --git a/examples/fips_validation/fips_validation.h > b/examples/fips_validation/fips_validation.h > > index 75fa555fa..b8c60c55f 100644 > > --- a/examples/fips_validation/fips_validation.h > > +++ b/examples/fips_validation/fips_validation.h > > @@ -15,6 +15,9 @@ > > #define MAX_BUF_SIZE 2048 > > #define MAX_STRING_SIZE 64 > > #define MAX_DIGEST_SIZE 64 > > +#define MAX_VER_STRING_SIZE 8 > > + > > +#define FIPS_DEF_VERSION "21.0" > > > > #define POSITIVE_TEST 0 > > #define NEGATIVE_TEST -1 > > @@ -155,6 +158,7 @@ struct sha_interim_data { > > }; > > > > struct fips_test_interim_info { > > + char version[MAX_VER_STRING_SIZE]; > > FILE *fp_rd; > > FILE *fp_wr; > > enum file_types file_type; > > > > > > Regards, > > Fan > > > > > -----Original Message----- > > > From: Olivier Matz > > > Sent: Tuesday, October 6, 2020 11:09 AM > > > To: Zhang, Roy Fan > > > Cc: dev@dpdk.org; Kovacevic, Marko ; > Akhil > > > Goyal ; Kusztal, ArkadiuszX > > > ; stable@dpdk.org; Anoob Joseph > > > > > > Subject: Re: [PATCH 2/3] examples/fips_validation: ignore \r in input= files > > > > > > Hi Fan, > > > > > > On Tue, Oct 06, 2020 at 08:47:10AM +0000, Zhang, Roy Fan wrote: > > > > Hi Olivier, > > > > > > > > > -----Original Message----- > > > > > From: Olivier Matz > > > > > Sent: Tuesday, October 6, 2020 8:42 AM > > > > > To: dev@dpdk.org > > > > > Cc: Kovacevic, Marko ; Akhil Goyal > > > > > ; Zhang, Roy Fan ; > > > Kusztal, > > > > > ArkadiuszX ; stable@dpdk.org > > > > > Subject: [PATCH 2/3] examples/fips_validation: ignore \r in input= files > > > > > > > > > > Some test vectors contain '\r' before '\n' (see link). Ignore the= m. > > > > > > > > > > Link: https://www.openssl.org/docs/fips/testvectors-linux-2007-10= - > > > 10.tar.gz > > > > > Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FIPS > > > application") > > > > > Cc: stable@dpdk.org > > > > > > > > > > Signed-off-by: Olivier Matz > > > > > --- > > > > > examples/fips_validation/fips_validation.c | 2 ++ > > > > > 1 file changed, 2 insertions(+) > > > > > > > > > > diff --git a/examples/fips_validation/fips_validation.c > > > > > b/examples/fips_validation/fips_validation.c > > > > > index 13f763c9aa..858f581ba3 100644 > > > > > --- a/examples/fips_validation/fips_validation.c > > > > > +++ b/examples/fips_validation/fips_validation.c > > > > > @@ -33,6 +33,8 @@ get_file_line(void) > > > > > > > > > > if (loc >=3D MAX_LINE_CHAR - 1) > > > > > return -ENOMEM; > > > > > + if (c =3D=3D '\r') > > > > > + continue; > > > > > if (c =3D=3D '\n') > > > > > break; > > > > > line[loc++] =3D c; > > > > > -- > > > > > > > > > > > > The patch looks ok but the test file link you provided in the patch= is > CAVS > > > > 5.3. > > > > > > > > As mentioned in > > > > https://doc.dpdk.org/guides/sample_app_ug/fips_validation.html, the > > > supported > > > > CAVS supported version is 21.0 (not latest one by newer than 5.3). = In > CAVS > > > > 21.0 test files there is no '\r' before '\n' (I suppose this is for= Windows > > > > right). > > > > > > Thank you for your feedback. > > > > > > I'm ok to drop this patch from the patchset if you feel it's useless,= or > > > I can update the commit log with the information you provide, to clar= ify > > > that it should not happen with the supported version of CAVS. > > > > > > Please let me know what you prefer. > > > > > > > > > Thanks, > > > Olivier