Hi Judah,

Does CryptoPkg.dsc break if DISABLE_SHA1_DEPRECATED_INTERFACE is defined in
that DSC file [BuildOptions] section?

All packages in edk2 repo have a .ci.yaml file that provides the set of CI 
checks
that are performed when a PR contains source changes to that package.  Here is
link to CryptoPkg.ci.yaml file:

    https://github.com/tianocore/edk2/blob/master/CryptoPkg/CryptoPkg.ci.yaml

The section of this file that identifies the package build step is 
"CompilerPlugin".
It specifies the relative path to the DSC file to build to perform a package 
scoped build verification.

    "CompilerPlugin": {
        "DscPath": "CryptoPkg.dsc"
    },

The easiest way to make sure there is build coverage for SHA1 disabled is to
make sure this DSC file is updated to include builds with and without SHA1
disabled.  SHA1 is enabled by default, so DSC file needs to be amended to
perform additional build(s) of components that disable SHA1.  This is a
challenge because this define is used in both libraries and modules so the
define needs to be global to cover library instances.


The define DISABLE_SHA1_DEPRECATED_INTERFACES is also used in the 
SecurityPkg, so that package may also need updates to get CI coverage
with and without this define.

https://github.com/tianocore/edk2/search?q=DISABLE_SHA1_DEPRECATED_INTERFACES&type=code

I just did a search for similar defines in edk2 repo:
* ENABLE_MD5_DEPRECATED_INTERFACES
* DISABLE_SHA1_DEPRECATED_INTERFACES
* DISABLE_NEW_DEPRECATED_INTERFACES

Perhaps Sean can provide advice on how to get full CI coverage for these
types of defines.

Best regards,

Mike


> -----Original Message-----
> From: Vang, Judah <judah.v...@intel.com>
> Sent: Wednesday, October 26, 2022 11:42 AM
> To: Kinney, Michael D <michael.d.kin...@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.w...@intel.com>; Mistry, Nishant C 
> <nishant.c.mis...@intel.com>
> Subject: RE: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes
> 
> Mike,
> 
> Can you explain #3?  I have no idea how to update/modify the EDK2 CI.
> I know for MTL, we have this define there by default, that is why when I 
> enabled crypto for RPMC feature
> for MTL we ran into the issue.
> 
> #4,  I prefer a build error.
> 
> Judah
> 
> -----Original Message-----
> From: Kinney, Michael D <michael.d.kin...@intel.com>
> Sent: Monday, October 24, 2022 10:22 AM
> To: devel@edk2.groups.io; Vang, Judah <judah.v...@intel.com>; Kinney, Michael 
> D <michael.d.kin...@intel.com>
> Subject: RE: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes
> 
> Hi Judah,
> 
> There was an update to CryptoPkg pushed yesterday.
> 
> 1) There is a CryptoPkg/Readme.md with tables and DSC content for services 
> that are
>    enabled in each phase.  I think that needs updates too for the AES and KDF 
> features.
> 2) The CryptoPkg.dsc file has recommended settings for PEI, DXE, SMM.  I think
>    they need to be updated for the AES and KDF features.
> 3) It looks like the SHA1 disable caused a build break.  I would like to see 
> the
>    standard package builds for EDK II CI be updated to cover the failure case 
> so
>    we know that this case is covered in the future.  It looks like the 
> default is
>    for SHA1 enabled and the build break is when define for SHA1 disabled is
>    asserted.
> 4) There is an overlap between the defines to deprecate MD5 and SH1 and the
>    structured PCD that allows those services to be disabled in the Crypto
>    Protocol/PPI.  The defines to deprecate MD5 and SH1 extend into the 
> BaseCryptLib
>    instance implementations such that a call to those services when static 
> linking
>    will generate a build error instead of a runtime ASSERT().  Which behavior 
> do
>    you prefer?
> 
> Best regards,
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Judah
> > Vang
> > Sent: Monday, October 24, 2022 9:42 AM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH V1 0/2] CryptoPkg bug fixes
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3991
> > https://bugzilla.tianocore.org/show_bug.cgi?id=3992
> >
> > There is a #define to deprecate Sha1 functions but not all the Sha1
> > function are wrapped around this #define causing a build error. The
> > fix is to wrap all Sha1 functions with the #define.
> >
> > Need crypto AES to be supported for PEI phase and need crypto KDF to
> > be supported for SMM phase.
> >
> > Judah Vang (2):
> >   CryptoPkg: Sha1 functions causing build errors
> >   CryptoPkg: Need to enable crypto functions
> >
> >  CryptoPkg/Library/BaseCryptLib/PeiCryptLib.inf    |  2 +-
> >  CryptoPkg/Library/BaseCryptLib/SmmCryptLib.inf    |  2 +-
> >  CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.c | 14 +++++++++++++-
> >  3 files changed, 15 insertions(+), 3 deletions(-)
> >
> > --
> > 2.35.1.windows.2
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#95621): https://edk2.groups.io/g/devel/message/95621
Mute This Topic: https://groups.io/mt/94539162/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to