[edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib

Sukerkar, Amol N posted 2 patches 4 years, 2 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 121 ++++++--------------
CryptoPkg/CryptoPkg.dec                           |  18 ++-
CryptoPkg/CryptoPkg.uni                           |  12 +-
CryptoPkg/Include/Library/HashApiLib.h            |  16 +--
4 files changed, 52 insertions(+), 115 deletions(-)
[edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Sukerkar, Amol N 4 years, 2 months ago
This patch implements the fixes and enhancement to BaseHashApiLib in
the following manner:
- Remove reference to MD4 and MD5 hashing algorithms as they are
  deprecated;
- Align the enumeration for hashing algorithmswith the one used in
  TPM 2.0 implementation defined in IndustryStandard/Tpm20.h;
- Change the type of PcdHashApiLibPolicy to PcdsFixedAtBuild to
  optimize away the unused hashing algorithms for a particular
  instance of HashApiLib.

More information can be found at Bugzilla ticket,
https://bugzilla.tianocore.org/show_bug.cgi?id=2511.

Amol N Sukerkar (2):
  CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0
    Implementation
  CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy type to
    FixedAtBuild

 CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 121 ++++++--------------
 CryptoPkg/CryptoPkg.dec                           |  18 ++-
 CryptoPkg/CryptoPkg.uni                           |  12 +-
 CryptoPkg/Include/Library/HashApiLib.h            |  16 +--
 4 files changed, 52 insertions(+), 115 deletions(-)

-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54492): https://edk2.groups.io/g/devel/message/54492
Mute This Topic: https://groups.io/mt/71288763/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Michael D Kinney 4 years, 2 months ago
Hi Amol,

Thanks for the updates:

There are a couple items remaining:

1) BaseHashApiLib needs to use PcdGet32() instead of PcdGet16()
2) The extra [PcdsFixedAtBuild] line needs to be removed from CryptoPkg.dec

Thanks,

Mike

> -----Original Message-----
> From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> Sent: Friday, February 14, 2020 4:19 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: [PATCH v4 0/2] Enhancement and Fixes to
> BaseHashApiLib
> 
> This patch implements the fixes and enhancement to
> BaseHashApiLib in
> the following manner:
> - Remove reference to MD4 and MD5 hashing algorithms as
> they are
>   deprecated;
> - Align the enumeration for hashing algorithmswith the
> one used in
>   TPM 2.0 implementation defined in
> IndustryStandard/Tpm20.h;
> - Change the type of PcdHashApiLibPolicy to
> PcdsFixedAtBuild to
>   optimize away the unused hashing algorithms for a
> particular
>   instance of HashApiLib.
> 
> More information can be found at Bugzilla ticket,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> 
> Amol N Sukerkar (2):
>   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with
> TPM 2.0
>     Implementation
>   CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy
> type to
>     FixedAtBuild
> 
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> 121 ++++++--------------
>  CryptoPkg/CryptoPkg.dec                           |
> 18 ++-
>  CryptoPkg/CryptoPkg.uni                           |
> 12 +-
>  CryptoPkg/Include/Library/HashApiLib.h            |
> 16 +--
>  4 files changed, 52 insertions(+), 115 deletions(-)
> 
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54502): https://edk2.groups.io/g/devel/message/54502
Mute This Topic: https://groups.io/mt/71288763/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Sukerkar, Amol N 4 years, 2 months ago
Hi Mike,

Yes, I just noticed and sent the patch with update 1 (build passed and worked with PcdGet16). I didn't notice the second change so I will make it as well in version 6.

Question: There is a call FixedPcdGet32 as well. Would it be applicable in BaseHashApiLib?

Thanks,
Amol

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Saturday, February 15, 2020 12:28 PM
To: Sukerkar, Amol N <amol.n.sukerkar@intel.com>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Agrawal, Sachin <sachin.agrawal@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib

Hi Amol,

Thanks for the updates:

There are a couple items remaining:

1) BaseHashApiLib needs to use PcdGet32() instead of PcdGet16()
2) The extra [PcdsFixedAtBuild] line needs to be removed from CryptoPkg.dec

Thanks,

Mike

> -----Original Message-----
> From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> Sent: Friday, February 14, 2020 4:19 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Yao, Jiewen 
> <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Agrawal, 
> Sachin <sachin.agrawal@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
> 
> This patch implements the fixes and enhancement to BaseHashApiLib in 
> the following manner:
> - Remove reference to MD4 and MD5 hashing algorithms as they are
>   deprecated;
> - Align the enumeration for hashing algorithmswith the one used in
>   TPM 2.0 implementation defined in
> IndustryStandard/Tpm20.h;
> - Change the type of PcdHashApiLibPolicy to PcdsFixedAtBuild to
>   optimize away the unused hashing algorithms for a particular
>   instance of HashApiLib.
> 
> More information can be found at Bugzilla ticket, 
> https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> 
> Amol N Sukerkar (2):
>   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with TPM 2.0
>     Implementation
>   CryptoPkg/BaseHashApiLib: Change PcdHashApiLibPolicy type to
>     FixedAtBuild
> 
>  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> 121 ++++++--------------
>  CryptoPkg/CryptoPkg.dec                           |
> 18 ++-
>  CryptoPkg/CryptoPkg.uni                           |
> 12 +-
>  CryptoPkg/Include/Library/HashApiLib.h            |
> 16 +--
>  4 files changed, 52 insertions(+), 115 deletions(-)
> 
> --
> 2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54507): https://edk2.groups.io/g/devel/message/54507
Mute This Topic: https://groups.io/mt/71288763/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Michael D Kinney 4 years, 2 months ago
Amol,

FixedPcdGet32() does not apply to this use case.

FixedPcdGet32() is usually only used when a PCD value 
is used to fill in a field of a structure in a global
variable where the compiler requires a value instead
of a variable or a function call.

The general rule is to use PcdGet/Setxx() everywhere 
possible to maximize compatibility with different
PCD types and only use FixedPcdGet/Setxx() if the
compiler cannot build the component when
PcdGet/Setxx() is used.

Thanks,

Mike

> -----Original Message-----
> From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> Sent: Saturday, February 15, 2020 11:40 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>;
> devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>; Sukerkar, Amol N
> <amol.n.sukerkar@intel.com>
> Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to
> BaseHashApiLib
> 
> Hi Mike,
> 
> Yes, I just noticed and sent the patch with update 1
> (build passed and worked with PcdGet16). I didn't
> notice the second change so I will make it as well in
> version 6.
> 
> Question: There is a call FixedPcdGet32 as well. Would
> it be applicable in BaseHashApiLib?
> 
> Thanks,
> Amol
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Saturday, February 15, 2020 12:28 PM
> To: Sukerkar, Amol N <amol.n.sukerkar@intel.com>;
> devel@edk2.groups.io; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal, Sachin
> <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to
> BaseHashApiLib
> 
> Hi Amol,
> 
> Thanks for the updates:
> 
> There are a couple items remaining:
> 
> 1) BaseHashApiLib needs to use PcdGet32() instead of
> PcdGet16()
> 2) The extra [PcdsFixedAtBuild] line needs to be
> removed from CryptoPkg.dec
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> > Sent: Friday, February 14, 2020 4:19 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Yao, Jiewen
> > <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal,
> > Sachin <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> > Subject: [PATCH v4 0/2] Enhancement and Fixes to
> BaseHashApiLib
> >
> > This patch implements the fixes and enhancement to
> BaseHashApiLib in
> > the following manner:
> > - Remove reference to MD4 and MD5 hashing algorithms
> as they are
> >   deprecated;
> > - Align the enumeration for hashing algorithmswith
> the one used in
> >   TPM 2.0 implementation defined in
> > IndustryStandard/Tpm20.h;
> > - Change the type of PcdHashApiLibPolicy to
> PcdsFixedAtBuild to
> >   optimize away the unused hashing algorithms for a
> particular
> >   instance of HashApiLib.
> >
> > More information can be found at Bugzilla ticket,
> > https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> >
> > Amol N Sukerkar (2):
> >   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with
> TPM 2.0
> >     Implementation
> >   CryptoPkg/BaseHashApiLib: Change
> PcdHashApiLibPolicy type to
> >     FixedAtBuild
> >
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> > 121 ++++++--------------
> >  CryptoPkg/CryptoPkg.dec                           |
> > 18 ++-
> >  CryptoPkg/CryptoPkg.uni                           |
> > 12 +-
> >  CryptoPkg/Include/Library/HashApiLib.h            |
> > 16 +--
> >  4 files changed, 52 insertions(+), 115 deletions(-)
> >
> > --
> > 2.16.2.windows.1
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54508): https://edk2.groups.io/g/devel/message/54508
Mute This Topic: https://groups.io/mt/71288763/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
Posted by Sukerkar, Amol N 4 years, 2 months ago
Thanks for the explanation, Mike! Also, I noticed during rebasing my original commit (BZ: 2151) that PcdSetxx does not work with PcdsFixedAtBuild anymore, which, should be by design.

Please ignore patch v5 as patch v6 contains all the fixes.

~ Amol

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com> 
Sent: Saturday, February 15, 2020 12:44 PM
To: Sukerkar, Amol N <amol.n.sukerkar@intel.com>; devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>; Agrawal, Sachin <sachin.agrawal@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib

Amol,

FixedPcdGet32() does not apply to this use case.

FixedPcdGet32() is usually only used when a PCD value is used to fill in a field of a structure in a global variable where the compiler requires a value instead of a variable or a function call.

The general rule is to use PcdGet/Setxx() everywhere possible to maximize compatibility with different PCD types and only use FixedPcdGet/Setxx() if the compiler cannot build the component when
PcdGet/Setxx() is used.

Thanks,

Mike

> -----Original Message-----
> From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> Sent: Saturday, February 15, 2020 11:40 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>; 
> devel@edk2.groups.io
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J 
> <jian.j.wang@intel.com>; Agrawal, Sachin <sachin.agrawal@intel.com>; 
> Gao, Liming <liming.gao@intel.com>; Sukerkar, Amol N 
> <amol.n.sukerkar@intel.com>
> Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
> 
> Hi Mike,
> 
> Yes, I just noticed and sent the patch with update 1 (build passed and 
> worked with PcdGet16). I didn't notice the second change so I will 
> make it as well in version 6.
> 
> Question: There is a call FixedPcdGet32 as well. Would it be 
> applicable in BaseHashApiLib?
> 
> Thanks,
> Amol
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Saturday, February 15, 2020 12:28 PM
> To: Sukerkar, Amol N <amol.n.sukerkar@intel.com>; 
> devel@edk2.groups.io; Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J 
> <jian.j.wang@intel.com>; Agrawal, Sachin <sachin.agrawal@intel.com>; 
> Gao, Liming <liming.gao@intel.com>
> Subject: RE: [PATCH v4 0/2] Enhancement and Fixes to BaseHashApiLib
> 
> Hi Amol,
> 
> Thanks for the updates:
> 
> There are a couple items remaining:
> 
> 1) BaseHashApiLib needs to use PcdGet32() instead of
> PcdGet16()
> 2) The extra [PcdsFixedAtBuild] line needs to be removed from 
> CryptoPkg.dec
> 
> Thanks,
> 
> Mike
> 
> > -----Original Message-----
> > From: Sukerkar, Amol N <amol.n.sukerkar@intel.com>
> > Sent: Friday, February 14, 2020 4:19 PM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D <michael.d.kinney@intel.com>;
> Yao, Jiewen
> > <jiewen.yao@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>; Agrawal,
> > Sachin <sachin.agrawal@intel.com>; Gao, Liming
> <liming.gao@intel.com>
> > Subject: [PATCH v4 0/2] Enhancement and Fixes to
> BaseHashApiLib
> >
> > This patch implements the fixes and enhancement to
> BaseHashApiLib in
> > the following manner:
> > - Remove reference to MD4 and MD5 hashing algorithms
> as they are
> >   deprecated;
> > - Align the enumeration for hashing algorithmswith
> the one used in
> >   TPM 2.0 implementation defined in
> > IndustryStandard/Tpm20.h;
> > - Change the type of PcdHashApiLibPolicy to
> PcdsFixedAtBuild to
> >   optimize away the unused hashing algorithms for a
> particular
> >   instance of HashApiLib.
> >
> > More information can be found at Bugzilla ticket, 
> > https://bugzilla.tianocore.org/show_bug.cgi?id=2511.
> >
> > Amol N Sukerkar (2):
> >   CryptoPkg/BaseHashApiLib: Align BaseHashApiLib with
> TPM 2.0
> >     Implementation
> >   CryptoPkg/BaseHashApiLib: Change
> PcdHashApiLibPolicy type to
> >     FixedAtBuild
> >
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c |
> > 121 ++++++--------------
> >  CryptoPkg/CryptoPkg.dec                           |
> > 18 ++-
> >  CryptoPkg/CryptoPkg.uni                           |
> > 12 +-
> >  CryptoPkg/Include/Library/HashApiLib.h            |
> > 16 +--
> >  4 files changed, 52 insertions(+), 115 deletions(-)
> >
> > --
> > 2.16.2.windows.1
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54509): https://edk2.groups.io/g/devel/message/54509
Mute This Topic: https://groups.io/mt/71288763/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-