-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MdePkg/DxeRngLib: Refactoring and improvements #6158
Merged
mergify
merged 5 commits into
tianocore:master
from
pierregondois:pg/RngDxeLib_refactoring
Sep 13, 2024
Merged
MdePkg/DxeRngLib: Refactoring and improvements #6158
mergify
merged 5 commits into
tianocore:master
from
pierregondois:pg/RngDxeLib_refactoring
Sep 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pierregondois
requested review from
ardbiesheuvel,
samimujawar,
lgao4,
mdkinney and
kraxel
September 3, 2024 17:12
Associated |
tianocore-assign-reviewers
bot
requested review from
ajfish,
leiflindholm,
LiuZhiguang001,
SaloniKasbekar and
Zclarkwilliams
September 3, 2024 17:19
mdkinney
reviewed
Sep 3, 2024
pierregondois
force-pushed
the
pg/RngDxeLib_refactoring
branch
from
September 3, 2024 20:37
3de8862
to
43d2cac
Compare
kraxel
approved these changes
Sep 4, 2024
samimujawar
reviewed
Sep 4, 2024
pierregondois
force-pushed
the
pg/RngDxeLib_refactoring
branch
from
September 4, 2024 09:03
43d2cac
to
5a28a3c
Compare
lgao4
reviewed
Sep 11, 2024
pierregondois
force-pushed
the
pg/RngDxeLib_refactoring
branch
from
September 12, 2024 07:45
5a28a3c
to
db34f52
Compare
lgao4
approved these changes
Sep 13, 2024
lgao4
force-pushed
the
pg/RngDxeLib_refactoring
branch
from
September 13, 2024 01:18
db34f52
to
a885ce4
Compare
PR can not be merged due to conflict. Please rebase and resubmit |
The PcdEnforceSecureRngAlgorithms Pcd enforces the use of RNG algorithms defined by the UEFI spec. To re-use the Pcd in other packages and have a generic mean to control the usage of unsecure algorithms, move the Pcd to the MdePkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Pierre Gondois <[email protected]>
Add a library constructor which: - locate the RNG prototocol and keep a reference to it in order to avoid locating it multiple times (for each random number generation) - check which secure algorithm is available on the platform. This avoids to try each secure algorithm until finding one available for each random number generation call. Signed-off-by: Pierre Gondois <[email protected]>
…ithm Use PcdEnforceSecureRngAlgorithms to allow using the Rng protocol with the default algorithm. All previous call to the Rng protocol are requesting a secure Rng algorithm. Not specifying the Rng algorithm GUID to use is considered unsecure. Signed-off-by: Pierre Gondois <[email protected]>
DxeRngLib iterates over a list of secure algorithms before trying to use the default algorithm provided by the Rng protocol. Add gEfiRngAlgorithmArmRndr to this list. The algorithm represented by this GUID is a secure DRBG of an unknown type, implemented by the aarch64 RNDR instruction. On AARCH64 platform, use the RNDR instruction as the first option if it is available. Signed-off-by: Pierre Gondois <[email protected]>
pierregondois
force-pushed
the
pg/RngDxeLib_refactoring
branch
from
September 13, 2024 07:50
a885ce4
to
066da6b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Improve the DxeRngLib so that:
the RNG prototocol is located only once instead of at each
random number generation
algorithms that are not available on a platform are not called
when trying to generate a random number
gEfiRngAlgorithmArmRndr support is added
PcdEnforceSecureRngAlgorithms can be set to allow/avoid non-secure
algorithms
Breaking change?
Impacts security?
Includes tests?
How This Was Tested
Tested on a Juno. Associated patches to be provided.