From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.7171.1580827585624164217 for ; Tue, 04 Feb 2020 06:46:25 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: jian.j.wang@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2020 06:46:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,402,1574150400"; d="scan'208";a="254429956" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 04 Feb 2020 06:46:25 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 4 Feb 2020 06:46:24 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 4 Feb 2020 06:46:24 -0800 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.46]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.138]) with mapi id 14.03.0439.000; Tue, 4 Feb 2020 22:46:22 +0800 From: "Wang, Jian J" To: "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Lu, XiaoyuX" Subject: Re: [edk2-devel] [Patch] CryptoPkg/BaseCryptLibNull: Add missing HkdfSha256ExtractAndExpand() Thread-Topic: [edk2-devel] [Patch] CryptoPkg/BaseCryptLibNull: Add missing HkdfSha256ExtractAndExpand() Thread-Index: AQHV1wKfci0LehTwi0OoXsdkJ+WXuqgLJWOg Date: Tue, 4 Feb 2020 14:46:21 +0000 Message-ID: References: <20200130001706.12756-1-michael.d.kinney@intel.com> In-Reply-To: <20200130001706.12756-1-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTM3ZTMwMmMtOGE5Yi00NWQ5LThjNDUtN2I5NjcyZTA5N2NmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUGhFVHpESmx2M1JXSzdwdjJmeGEyd2RkM05peEEzRjY2aTg2WVFOXC80anNJWkIwa2VoM2FWeUd0ZnpqNVNEankifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jian.j.wang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The copyright year of file CryptHkdfNull.c was not updated. With it address= ed, Reviewed-by: Jian J Wang Regards, Jian > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Michael D > Kinney > Sent: Thursday, January 30, 2020 8:17 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Lu, XiaoyuX > Subject: [edk2-devel] [Patch] CryptoPkg/BaseCryptLibNull: Add missing > HkdfSha256ExtractAndExpand() >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2493 >=20 > The BaseCryptLib was expanded to add the HkdfSha256ExtractAndExpand() > service in the following commit: >=20 > https://github.com/tianocore/edk2/commit/4b1b7c1913092d73d689d8086dcfa > 579c0217dc8 >=20 > When BaseCryptLibNull was added in the commit below, this new > service was not included. >=20 > https://github.com/tianocore/edk2/commit/d95de082da01f4a4cb3ebf87e1597 > 2a12d0f8d53 >=20 > Cc: Jian J Wang > Cc: Xiaoyu Lu > Signed-off-by: Michael D Kinney > --- > .../BaseCryptLibNull/BaseCryptLibNull.inf | 3 +- > .../BaseCryptLibNull/Kdf/CryptHkdfNull.c | 43 +++++++++++++++++++ > 2 files changed, 45 insertions(+), 1 deletion(-) > create mode 100644 CryptoPkg/Library/BaseCryptLibNull/Kdf/CryptHkdfNull= .c >=20 > diff --git a/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf > b/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf > index 1e4807968a..8f53b0dfd0 100644 > --- a/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf > +++ b/CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf > @@ -6,7 +6,7 @@ > # This external input must be validated carefully to avoid security is= sues such as > # buffer overflow or integer overflow. > # > -# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved. > +# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved. > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > ## > @@ -37,6 +37,7 @@ [Sources] > Hmac/CryptHmacMd5Null.c > Hmac/CryptHmacSha1Null.c > Hmac/CryptHmacSha256Null.c > + Kdf/CryptHkdfNull.c > Cipher/CryptAesNull.c > Cipher/CryptTdesNull.c > Cipher/CryptArc4Null.c > diff --git a/CryptoPkg/Library/BaseCryptLibNull/Kdf/CryptHkdfNull.c > b/CryptoPkg/Library/BaseCryptLibNull/Kdf/CryptHkdfNull.c > new file mode 100644 > index 0000000000..19d795a4cc > --- /dev/null > +++ b/CryptoPkg/Library/BaseCryptLibNull/Kdf/CryptHkdfNull.c > @@ -0,0 +1,43 @@ > +/** @file > + HMAC-SHA256 KDF Wrapper Implementation which does not provide real > capabilities. > + > +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
> +SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include > +#include > + > +/** > + Derive key data using HMAC-SHA256 based KDF. > + > + @param[in] Key Pointer to the user-supplied key. > + @param[in] KeySize Key size in bytes. > + @param[in] Salt Pointer to the salt(non-secret) value. > + @param[in] SaltSize Salt size in bytes. > + @param[in] Info Pointer to the application specific inf= o. > + @param[in] InfoSize Info size in bytes. > + @param[out] Out Pointer to buffer to receive hkdf value= . > + @param[in] OutSize Size of hkdf bytes to generate. > + > + @retval TRUE Hkdf generated successfully. > + @retval FALSE Hkdf generation failed. > + > +**/ > +BOOLEAN > +EFIAPI > +HkdfSha256ExtractAndExpand ( > + IN CONST UINT8 *Key, > + IN UINTN KeySize, > + IN CONST UINT8 *Salt, > + IN UINTN SaltSize, > + IN CONST UINT8 *Info, > + IN UINTN InfoSize, > + OUT UINT8 *Out, > + IN UINTN OutSize > + ) > +{ > + ASSERT (FALSE); > + return FALSE; > +} > -- > 2.21.0.windows.1 >=20 >=20 >=20