Skip to content

Commit

Permalink
Adding Sha256HashAll to all versions of generated binaries (#72)
Browse files Browse the repository at this point in the history
## Description

A platform needed Sha256HashAll in the PEI phase, but
BaseCryptoLibOnProtocolPpi was always returning an error, no matter
which version was used (tiny, standard, etc).

Investigation revelated that Sha256HashAll was excluded in all flavors.

PR will remove Sha256HashAll from exclude list of functions, which will
make it available for all flavors of CryptoDriver.



- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Generated binaries locally, verified that Sha256HashAll was included via
PCD in the generated binary files.

## Integration Instructions

NA
  • Loading branch information
apop5 authored Mar 1, 2024
1 parent 478ce7e commit 0422f42
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CryptoBinPkg/Driver/Bin/Crypto.pcd.MINIMAL_SHA_SM3.inc.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AUTOGENERATED BY CryptoBinPkg\Driver\Packaging\generate_cryptodriver.py
# AUTOGENED AS Crypto.pcd.MINIMAL_SHA_SM3.inc.dsc
# DO NOT MODIFY
# GENERATED ON: 2024-02-12 18:57:08.365387
# GENERATED ON: 2024-02-29 11:04:07.985454

# HMACSHA256 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceHmacSha256New | TRUE
Expand All @@ -24,6 +24,7 @@
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Duplicate | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Update | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Final | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256HashAll | TRUE
# SHA384 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384GetContextSize | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384Init | TRUE
Expand Down
3 changes: 2 additions & 1 deletion CryptoBinPkg/Driver/Bin/Crypto.pcd.SMALL_SHA_RSA.inc.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AUTOGENERATED BY CryptoBinPkg\Driver\Packaging\generate_cryptodriver.py
# AUTOGENED AS Crypto.pcd.SMALL_SHA_RSA.inc.dsc
# DO NOT MODIFY
# GENERATED ON: 2024-02-12 18:57:08.366369
# GENERATED ON: 2024-02-29 11:04:07.986469

# HMACSHA256 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceHmacSha256New | TRUE
Expand All @@ -24,6 +24,7 @@
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Duplicate | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Update | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Final | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256HashAll | TRUE
# SHA384 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384GetContextSize | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384Init | TRUE
Expand Down
3 changes: 2 additions & 1 deletion CryptoBinPkg/Driver/Bin/Crypto.pcd.STANDARD.inc.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AUTOGENERATED BY CryptoBinPkg\Driver\Packaging\generate_cryptodriver.py
# AUTOGENED AS Crypto.pcd.STANDARD.inc.dsc
# DO NOT MODIFY
# GENERATED ON: 2024-02-12 18:57:08.366369
# GENERATED ON: 2024-02-29 11:04:07.986469

# HMACSHA256 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceHmacSha256New | TRUE
Expand Down Expand Up @@ -36,6 +36,7 @@
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Duplicate | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Update | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Final | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256HashAll | TRUE
# SHA384 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384GetContextSize | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384Init | TRUE
Expand Down
3 changes: 2 additions & 1 deletion CryptoBinPkg/Driver/Bin/Crypto.pcd.TINY_SHA.inc.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# AUTOGENERATED BY CryptoBinPkg\Driver\Packaging\generate_cryptodriver.py
# AUTOGENED AS Crypto.pcd.TINY_SHA.inc.dsc
# DO NOT MODIFY
# GENERATED ON: 2024-02-12 18:57:08.364350
# GENERATED ON: 2024-02-29 11:04:07.984443

# SHA1 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha1GetContextSize | TRUE
Expand All @@ -16,6 +16,7 @@
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Duplicate | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Update | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256Final | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha256HashAll | TRUE
# SHA384 family
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384GetContextSize | TRUE
gEfiCryptoPkgTokenSpaceGuid.PcdCryptoServiceSha384Init | TRUE
Expand Down
8 changes: 4 additions & 4 deletions CryptoBinPkg/Driver/Packaging/generate_cryptodriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,25 +127,25 @@ def get_flavors():
"TINY_SHA": {
"families": ["SHA1", "SHA256", "SHA384"],
"individuals": ["Pkcs5HashPassword"],
"exclude": ["Sha256HashAll", "Sha1HashAll"],
"exclude": ["Sha1HashAll"],
"guid": "e6ed744a-8db0-42b8-a507-8909782ed200"
},
"MINIMAL_SHA_SM3": {
"families": ["HMACSHA256", "SHA1", "SHA256", "SHA384", "SHA512", "SM3"],
"individuals": ["Pkcs5HashPassword"],
"exclude": ["Sha256HashAll", "Sha1HashAll"],
"exclude": ["Sha1HashAll"],
"guid": "6d653b3b-0654-4eec-8ab3-183a3e061400"
},
"SMALL_SHA_RSA": {
"families": ["HMACSHA256", "SHA1", "SHA256", "SHA384", "SHA512", "SM3"],
"individuals": ["RsaPkcs1Verify", "RsaNew", "RsaFree", "RsaSetKey", "Pkcs5HashPassword", "RsaPssSign", "RsaPssVerify"],
"exclude": ["Sha256HashAll", "Sha1HashAll"],
"exclude": ["Sha1HashAll"],
"guid": "d9a75606-caba-4aa0-80a6-591852335400"
},
"STANDARD": {
"families": ["HMACSHA256", "PKCS", "SHA1", "SHA256", "SHA384", "SHA512", "RANDOM", "TLS", "TLSGET", "TLSSET"],
"individuals": ["RsaPkcs1Verify", "RsaNew", "RsaFree", "RsaGetPublicKeyFromX509", "X509GetSubjectName", "X509GetCommonName", "X509GetOrganizationName", "X509GetTBSCert", "RsaPssSign", "RsaPssVerify"],
"exclude": ["Sha1HashAll", "Sha256HashAll", "Pkcs7Sign", "Pkcs7GetCertificatesList", "ImageTimestampVerify"],
"exclude": ["Sha1HashAll", "Pkcs7Sign", "Pkcs7GetCertificatesList", "ImageTimestampVerify"],
"guid": "bdee011f-87f2-4a7f-bc5e-44b6b61fef00"
}
}
Expand Down

0 comments on commit 0422f42

Please sign in to comment.