EmbeddedPkg: Clear keyboard queue buffer after reading

There is a possibility to retrieve user input keystroke data stored in the
queue buffer via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL pointer. To prevent
exposure of the password string, clear the queue buffer by filling it
with zeros after reading.

Signed-off-by: Nick Wang <nick.wang@insyde.com>
This commit is contained in:
nick.wang
2025-04-15 19:35:46 +08:00
committed by mergify[bot]
parent 0cad130cb4
commit ab04d09555

View File

@ -348,6 +348,7 @@ Dequeue (
}
CopyMem (KeyData, &Queue->Buffer[Queue->Front], sizeof (EFI_KEY_DATA));
ZeroMem (&Queue->Buffer[Queue->Front], sizeof (EFI_KEY_DATA));
Queue->Front = (Queue->Front + 1) % QUEUE_MAX_COUNT;
return EFI_SUCCESS;