-
Notifications
You must be signed in to change notification settings - Fork 2.8k
CryptoPkg: Use RngLib to get Random number. #11198
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
base: master
Are you sure you want to change the base?
CryptoPkg: Use RngLib to get Random number. #11198
Conversation
REF: tianocore#11002 Use RngLib to get the Random number instead of passing the Default seed when the seed value is NULL and Seed size is zero. Signed-off-by: Kanagavel S <kanagavels@ami.com>
The patch looks good to me. As a side comment, shouldn't we have a valid implementation of
|
Do you want the same implementation for MbedTls library as well? |
It would be a good think IMO. Note that the build seems already failing. I had to to the following to see the unresolved dependency:
and the command: |
@@ -47,17 +48,12 @@ RandomSeed ( | |||
if (Seed != NULL) { | |||
RAND_seed (Seed, (UINT32)SeedSize); | |||
} else { | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to keep two files with exactly the same content. CryptRanTsc.c can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liyi77 You mean we can use CryptRand.c file for IA32, X64, ARM, and AARCH64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liyi77 You mean we can use CryptRand.c file for IA32, X64, ARM, and AARCH64?
Yes, they are same things anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok @liyi77 , I will remove CryptRandTsc.c file
Sounds strange, RngLib is a dependency of OpensslLib: edk2/CryptoPkg/Library/OpensslLib/OpensslLib.inf Lines 706 to 710 in 92c714f
Generally as long as you use Openssl CryptoLib, this dependency is already satisfied. |
Yes right, the RngLib dependency is already broken for the platform. |
Could you please confirm whether the RngLib dependency is still required for BaseCryptLib? |
REF: #11002
Use RngLib to get the Random number instead of passing the Default seed when the seed value is NULL and Seed size is zero.
Description
Add an implementation to use the RngLib to get the RandomNumber instead of passing the predictable default seed value when the RandomSeed() is called with seed value NULL and Seed size zero.