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

KeyLibGenerateSalt function Failure to check return State (Bugzilla Bug 4649) #705

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

Comments

@tianocore-issues
Copy link

This issue was created automatically with bugzilla2github

Bugzilla Bug 4649

Date: 2024-01-17T01:59:36+00:00
From: tabassum.yasmin
To: unassigned <>
CC: @lgao4

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

@tianocore-issues
Copy link
Author

Comment 22378

Date: 2024-01-17 01:59:36 +0000
From: tabassum.yasmin

  • Industry Specification: ---
  • Release Observed: edk2-stable202305
  • Releases to Fix: edk2-stable202305
  • Target OS: ---
  • Bugzilla Assignee(s): unassigned <>

The KeyLibGenerateSalt function fails to check the return value of RandomSeed and RandomBytes function
calls.
SavePasswordToVariable function also fails to check the status of calling function KeyLibGenerateSalt

Snippet below

EFI_STATUS
SavePasswordToVariable (
IN EFI_GUID *UserGuid,
IN CHAR8 *Password, OPTIONAL
IN UINTN PasswordSize
)
{
EFI_STATUS Status;
USER_PASSWORD_VAR_STRUCT UserPasswordVarStruct;
BOOLEAN HashOk;
//
// If password is NULL, it means we want to clean password field saved in variable region.
//
if (Password != NULL) {
KeyLibGenerateSalt (UserPasswordVarStruct.PasswordSalt, sizeof(UserPasswordVarStruct.PasswordSalt));

BOOLEAN
EFIAPI
KeyLibGenerateSalt (
IN OUT UINT8 *SaltValue,
IN UINTN SaltSize
)
{
if (SaltValue == NULL) {
return FALSE;
}
RandomSeed(NULL, 0);
RandomBytes(SaltValue, SaltSize);
return TRUE;
}

@tianocore-issues
Copy link
Author

Comment 22459

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

[email protected]: 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