Skip to content
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

Password Salt uses default seed (Bugzilla Bug 4648) #704

Open
tianocore-issues opened this issue Jan 17, 2024 · 2 comments
Open

Password Salt uses default seed (Bugzilla Bug 4648) #704

tianocore-issues opened this issue Jan 17, 2024 · 2 comments

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 4648

Date: 2024-01-17T01:57:18+00:00
From: tabassum.yasmin
To: tabassum.yasmin
CC: @lgao4

Last updated: 2024-01-30T21:46:39+00:00

@tianocore-issues
Copy link
Author

Comment 22377

Date: 2024-01-17 01:57:18 +0000
From: tabassum.yasmin

  • Industry Specification: ---
  • Release Observed: edk2-stable202305
  • Releases to Fix: edk2-stable202305
  • Target OS: ---
  • Bugzilla Assignee(s): tabassum.yasmin

The SavePasswordToVariable function takes in the password, generates a salt, generates a SHA256 hash of the
password and saves the password hash to a variable. The KeyLipGenerateSalt function calls RandomSeed with
NULL as the first argument. The RandomSeed function comes from CryptRandTsc.c. When NULL is used as the
first argument, the default seed "UEFI Crypto Library default seed" is used this is concatenated with the TSC

Code snippet below

BOOLEAN
EFIAPI
RandomSeed (
IN CONST UINT8 *Seed OPTIONAL,
IN UINTN SeedSize
)
{
CHAR8 DefaultSeed[128];

//
// Seed the pseudorandom number generator with user-supplied value.
// NOTE: A cryptographic PRNG must be seeded with unpredictable data.
//
if (Seed != NULL) {
RAND_seed (Seed, (UINT32)SeedSize);
} else {
//
// Retrieve current time.
//
AsciiSPrint (
DefaultSeed,
sizeof (DefaultSeed),
"UEFI Crypto Library default seed (%ld)",
AsmReadTsc ()
);
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
}
if (RAND_status () == 1) {

@tianocore-issues
Copy link
Author

Comment 22460

Date: 2024-01-30 21:46:39 +0000
From: @lgao4

tabassum.yasmin@intel.com: please work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant