From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: shenglei.zhang@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Thu, 15 Aug 2019 04:35:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 04:35:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,389,1559545200"; d="scan'208";a="377053149" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga006.fm.intel.com with ESMTP; 15 Aug 2019 04:35:24 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 15 Aug 2019 04:35:24 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 15 Aug 2019 04:35:24 -0700 Received: from shsmsx106.ccr.corp.intel.com ([169.254.10.204]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.80]) with mapi id 14.03.0439.000; Thu, 15 Aug 2019 19:35:22 +0800 From: "Zhang, Shenglei" To: "Wang, Jian J" , "devel@edk2.groups.io" CC: "Ye, Ting" Subject: Re: [PATCH 1/1] CryptoPkg/BaseCryptLib: Update pHkdfCtx to PHkdfCtx Thread-Topic: [PATCH 1/1] CryptoPkg/BaseCryptLib: Update pHkdfCtx to PHkdfCtx Thread-Index: AQHVU0ZYUlAdejKjVkWbdZa1Nhu+Iqb76RXwgAAqSKA= Date: Thu, 15 Aug 2019 11:35:21 +0000 Message-ID: References: <20190815084920.20856-1-shenglei.zhang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTY3OGFmYTktN2NjZi00NDVlLWIyMjctYmJmYTQ5OGJiOWMwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUU0zcXh5R3RXdnJvTFJOZFhzZmplMk5QNjViYzVnZUlpOGIrZWNVa3hWUk5vdUtteE1ybEJRRGNRNXpTSGVXVyJ9 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: shenglei.zhang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jian, Yes, you are right.=20 According to CCS_2_1_Draft, 4.3.3.3, Pointer variables may optionally be pr= efixed with a 'p'. So please skip this change. Thanks, Shenglei > -----Original Message----- > From: Wang, Jian J > Sent: Thursday, August 15, 2019 5:01 PM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Ye, Ting > Subject: RE: [PATCH 1/1] CryptoPkg/BaseCryptLib: Update pHkdfCtx to > PHkdfCtx >=20 > Shenglei, >=20 > I remember the edk2 coding style allows prefix 'p' (optional) to represen= t a > pointer variable. >=20 > Regards, > Jian >=20 >=20 > > -----Original Message----- > > From: Zhang, Shenglei > > Sent: Thursday, August 15, 2019 4:49 PM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J ; Ye, Ting > > Subject: [PATCH 1/1] CryptoPkg/BaseCryptLib: Update pHkdfCtx to > > PHkdfCtx > > > > Update pHkdfCtx to PHkdfCtx, to follow the variable naming > > rule. > > > > Cc: Jian Wang > > Cc: Ting Ye > > Signed-off-by: Shenglei Zhang > > --- > > .../Library/BaseCryptLib/Kdf/CryptHkdf.c | 22 +++++++++---------- > > 1 file changed, 11 insertions(+), 11 deletions(-) > > > > diff --git a/CryptoPkg/Library/BaseCryptLib/Kdf/CryptHkdf.c > > b/CryptoPkg/Library/BaseCryptLib/Kdf/CryptHkdf.c > > index f0fcef211d3f..488346a38b8c 100644 > > --- a/CryptoPkg/Library/BaseCryptLib/Kdf/CryptHkdf.c > > +++ b/CryptoPkg/Library/BaseCryptLib/Kdf/CryptHkdf.c > > @@ -39,7 +39,7 @@ HkdfSha256ExtractAndExpand ( > > IN UINTN OutSize > > ) > > { > > - EVP_PKEY_CTX *pHkdfCtx; > > + EVP_PKEY_CTX *PHkdfCtx; > > BOOLEAN Result; > > > > if (Key =3D=3D NULL || Salt =3D=3D NULL || Info =3D=3D NULL || Out = =3D=3D NULL || > > @@ -47,29 +47,29 @@ HkdfSha256ExtractAndExpand ( > > return FALSE; > > } > > > > - pHkdfCtx =3D EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); > > - if (pHkdfCtx =3D=3D NULL) { > > + PHkdfCtx =3D EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); > > + if (PHkdfCtx =3D=3D NULL) { > > return FALSE; > > } > > > > - Result =3D EVP_PKEY_derive_init(pHkdfCtx) > 0; > > + Result =3D EVP_PKEY_derive_init(PHkdfCtx) > 0; > > if (Result) { > > - Result =3D EVP_PKEY_CTX_set_hkdf_md(pHkdfCtx, EVP_sha256()) > 0; > > + Result =3D EVP_PKEY_CTX_set_hkdf_md(PHkdfCtx, EVP_sha256()) > 0; > > } > > if (Result) { > > - Result =3D EVP_PKEY_CTX_set1_hkdf_salt(pHkdfCtx, Salt, > > (UINT32)SaltSize) > 0; > > + Result =3D EVP_PKEY_CTX_set1_hkdf_salt(PHkdfCtx, Salt, > > (UINT32)SaltSize) > 0; > > } > > if (Result) { > > - Result =3D EVP_PKEY_CTX_set1_hkdf_key(pHkdfCtx, Key, > > (UINT32)KeySize) > 0; > > + Result =3D EVP_PKEY_CTX_set1_hkdf_key(PHkdfCtx, Key, > > (UINT32)KeySize) > 0; > > } > > if (Result) { > > - Result =3D EVP_PKEY_CTX_add1_hkdf_info(pHkdfCtx, Info, > > (UINT32)InfoSize) > 0; > > + Result =3D EVP_PKEY_CTX_add1_hkdf_info(PHkdfCtx, Info, > > (UINT32)InfoSize) > 0; > > } > > if (Result) { > > - Result =3D EVP_PKEY_derive(pHkdfCtx, Out, &OutSize) > 0; > > + Result =3D EVP_PKEY_derive(PHkdfCtx, Out, &OutSize) > 0; > > } > > > > - EVP_PKEY_CTX_free(pHkdfCtx); > > - pHkdfCtx =3D NULL; > > + EVP_PKEY_CTX_free(PHkdfCtx); > > + PHkdfCtx =3D NULL; > > return Result; > > } > > -- > > 2.18.0.windows.1