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 C8BC0A04BC; Thu, 8 Oct 2020 14:41:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3B3E21BF0B; Thu, 8 Oct 2020 14:41:23 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id D01EA1BEF9; Thu, 8 Oct 2020 14:41:19 +0200 (CEST) IronPort-SDR: 2FQXdQGaKB8ipDRcd7UiQutsANZgUNttl4OG1XGsGLHkh2aa/9kDEirLnQrxElwsgTd85FhaAC tL1KyjFSNS5g== X-IronPort-AV: E=McAfee;i="6000,8403,9767"; a="250021354" X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="250021354" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2020 05:41:17 -0700 IronPort-SDR: DVYPeluJPkfrfgZYf57LW8epEucf5GAALVENwfjSAu3T56UeGY5DNci5uHAy5gbU1CGHoy/VQ7 kCBCKZZw8hCw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,350,1596524400"; d="scan'208";a="354481446" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by FMSMGA003.fm.intel.com with ESMTP; 08 Oct 2020 05:41:17 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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; Thu, 8 Oct 2020 05:41:16 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX608.amr.corp.intel.com (10.22.229.21) 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 05:41:16 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 05:41:16 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.55) by edgegateway.intel.com (134.134.137.103) 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 05:41:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h2bU/Y0MTmxBj88axPe2pT3PEqc0hUoW0q/89QpBmJPCNQ0CX+oNcxwhb/c4Mrt9O6SeOquIhVpdNmYIuDGk2bL7ggUt7e15PrQQ8ylGzwGCTLWQXO4Z6onaYzMCVY+YrNrnVKLMSYQJ+biQy2citzFzoZ2a1PtqbwNpNXoWYSsaUJOJRRrs9VeblYjNewEPXjMrishF1Q8xd9qnaigVs8vq6OeN7UinVDkOzCJ1lLBfT8mC1x09Tg6J/S2a2oSiF0L31Mn/rVJ6qfQPNS3crB5wviubyBgaTjdK1hRNQb4855o5V59cdQchKpChppalhHXmNJlnUUEoLDNrgi+W6Q== 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=ueJcmJwiYRUvON1JfK7crdI/Mi9dLaYnz2nzvPhPNJM=; b=UqVqeqn+0f/k2ocz5HY5PzXgY5Tq5Y/7yHPY2YezSXQ0HGIwjlOWzIqBegJs0rVOltBRq9vqbxpyqYKfqspoZdQ7k4gyaR6GVjNWyNicsH+tNAe7dR1517Yt2Uhh/20FLl1MGe/mMhoiW/nR+xhiQRG7KFBJvbbsJlE01T31lwlZmfJqutuH3iLZJTY8U9uLBasK4PoTfFSI6f8BkprZyI6eZaugq8ncNrvujOhhMgej782RSs+Icd4PKZ9IlrC1heorctTjDLz6G/N87BkVQ3P28WCoO1flraKUZI8SNR2HWZ80mSw454//Zp3myJ8ZBQvD8ipOzylO+9DKsoBgSw== 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=ueJcmJwiYRUvON1JfK7crdI/Mi9dLaYnz2nzvPhPNJM=; b=RHeYbatH3lwrLwD40zDPko744HtFERPkUSOl8XLg3HWpGjY5TvDRmK7CGR92wXbdxGrbQDSo10xM2he0F4La98kt5c611COF+/LiNMrnzHYnJ/3dGA52DbSe1QX0by2LkoTlt1DsfRDdpra5eN0f6IsH9jX5LwiJ8W7GZWdpJAE= Received: from BL0PR11MB3043.namprd11.prod.outlook.com (2603:10b6:208:33::19) by BL0PR11MB3185.namprd11.prod.outlook.com (2603:10b6:208:63::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.22; Thu, 8 Oct 2020 12:41:11 +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 12:41:11 +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/oCAAwz2AIAACm6AgAANLtCAABdHAIAAEX5A Date: Thu, 8 Oct 2020 12:41:11 +0000 Message-ID: References: <20201006074143.31691-1-olivier.matz@6wind.com> <20201006074143.31691-3-olivier.matz@6wind.com> <20201006100901.GJ21395@platinum> <20201008092131.GU21395@platinum> <20201008113200.GW21395@platinum> In-Reply-To: <20201008113200.GW21395@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: f9b73ab2-de7d-4abd-57cb-08d86b876ffa x-ms-traffictypediagnostic: BL0PR11MB3185: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3F/2aOMijiuLXMCqOrAqiCvW0lj2yXJHFpgS2WQsPfbbA49vlTJGZpJPhlnulh3jzaGUYeLrUx+wi+CdOSVxtmq9TLLDvH3jYE7FC/Vt4edq32ZW2sEvmgeNVKA8Yz4MgrjFoBNOHqmcqbjATnJvl8vC4OVFwXpLc6DpHHP+jU6phrprrtLTuN92cl9o3+A7Ehh9LLqvDz+bnUNre5s7y6BiGS55JAmgFRbiykE6pbE7wev+eER3KPAH4+ttiSSMpEHYZw1ysXfmvUI+z5U6lUwYX29+grWn+fj0QZ7rSs7hbs6KSquXIdpErvgv63rnewdZWiKu0Z6kyQ77CAHjg29gnyM54WG7DFWxb9OhpxfgtonEAtmYb5Jj56Bzp8JxLbALpW9no52qWtX9RQ09DQ== 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)(376002)(346002)(39860400002)(396003)(136003)(366004)(7696005)(76116006)(6506007)(33656002)(8676002)(71200400001)(5660300002)(6916009)(86362001)(8936002)(83380400001)(2906002)(54906003)(83080400001)(4326008)(52536014)(478600001)(316002)(53546011)(26005)(186003)(966005)(9686003)(55016002)(66446008)(66556008)(64756008)(66476007)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: qx0dCQG/c++QKDwp40ehebgHFDwAR6bjQDwwZWG/hr0CWISY1TYbhZGt5q5ujoVJEwEAruUQ948f5I/vrLLH48gOLlTM2x2hO6zLjxbpDIbG232SSljcC0QtSvViFNVQjbCSzbL2ouEuR3LMA2wD+pv5INEae7CsgGyMoEJ1w0Q53CUS9mj5wk2OClAPRSSAA9AFXZOBEI0qHLUkr8LZyswEHAo9Od5SWJWziKBfQ4FXQpDILWzWnhFM7XGyqYbasg778e4uRya6nITz0PBwmGg49/43tK+3WP9YcW3TzNFCmFB7qLFBowMSvVp8u30mCns406ntklM9CQMtKQC9UkJgZkZPAlgkcevmu1HF3IoOHHLJOITjAuIMybqwLlgH8yu5gUnEMTn1rfROJSuBBAsd0vUogqNcNjpOFTxO8SGc33NLXMDVgoo3LXDjbCToTl1G3OnIjuXXQ5voQGbrJLe8HxSq3WInFUlBL8mPxlon7iCQzmAwxxfhKi8konlayFOHFMykki1yQatX2pkN3asxJaO5qmoceAOlmmaKA9gOlFBkX2p/o2TKCKNU4sbLgRxh5q8gR95rGA7Yeda5h8c1mPCKhGFfrt5AEpzous1y5PtZXCWOLGFkVKdpA8U/MABDGEvCxwhMHPMC0Q/0ZQ== 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: f9b73ab2-de7d-4abd-57cb-08d86b876ffa X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2020 12:41:11.4220 (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: MI/MAQfikM8NTN8yydFUpjAhWU/1bGYL3pvwagaD0JnoKLNOBhlgILjKhxscsEsyxB8YJeouNDMD2O9kKSq4fA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB3185 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, Unfortunately I wanted to find the same document since forever. NIST did not provide this on their website. What I am sure is for CAVS 21.0 both the test vectors Intel used for testing and the ones provided by our customer for debugging did not have \r in the files. In 2018 we could find some sample request and response files from NIST website but I just checked and they are gone. Regards, Fan > -----Original Message----- > From: Olivier Matz > Sent: Thursday, October 8, 2020 12:32 PM > 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 Fan, >=20 > Thank you for the clarification. One more question: do you know where I > can find a description of the different FIPS CAVS versions? I would like > to know from what version the \r has been removed. >=20 > Thanks, > Olivier >=20 > On Thu, Oct 08, 2020 at 10:24:48AM +0000, Zhang, Roy Fan wrote: > > 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 the > > application should be wrapped into a branch that is checked with parsed > > version number. With this way the original application's behavior shoul= d > > remain the same. > > > > The reason for that is we are having an issue right now that the valida= tion > > team is struggling with the limited test vectors and inconsistency form= atting > > between different FIPS CAVS versions. For example we still have FIPS TD= ES > test > > failing today due to the different test file versions. > > https://bugs.dpdk.org/show_bug.cgi?id=3D512 > > > > 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= files > > > > > > Hi, > > > > > > 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? > > > > > > Thank you for your feedback. > > > > > > 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. > > > > > > 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 us= ed > > > in your patch. In that case, I think it is a bit overkill. Do you thi= nk > > > it is a problem to always drop '\r'? > > > > > > If you think we should not support files containing '\r', I'm fine > > > with it, I can drop this particular patch. > > > > > > > > > > > > > > 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 "); > > > > > > I think it should be strlen(), because sizeof() will contain > > > the '\0'. Or it could be sizeof() - 1. > > > > > > > + > > > > + 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 i= nput > 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 i= nput > files > > > > > > > > > > > > > > Some test vectors contain '\r' before '\n' (see link). Ignore= them. > > > > > > > > > > > > > > Link: https://www.openssl.org/docs/fips/testvectors-linux-200= 7- > 10- > > > > > 10.tar.gz > > > > > > > Fixes: 3d0fad56b74a ("examples/fips_validation: add crypto FI= PS > > > > > 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 p= atch 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 usel= ess, or > > > > > I can update the commit log with the information you provide, to > clarify > > > > > that it should not happen with the supported version of CAVS. > > > > > > > > > > Please let me know what you prefer. > > > > > > > > > > > > > > > Thanks, > > > > > Olivier