VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-24 23:36:13 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:40:14 +0200
commit77d070fe7384bfb0c6dece81e4900e603b13ee6c (patch)
treed1596436592199cad8ed7654253e167e87422ecd
parent183cbc087a7551e4335da212e93732a72a7570f0 (diff)
downloadVeraCrypt-77d070fe7384bfb0c6dece81e4900e603b13ee6c.tar.gz
VeraCrypt-77d070fe7384bfb0c6dece81e4900e603b13ee6c.zip
Windows Bootloader: for MBR bootloader, reset position pointers to keystroke buffer after password or PIM is entered to avoid leaking length information
-rw-r--r--src/Boot/Windows/BootConsoleIo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Boot/Windows/BootConsoleIo.cpp b/src/Boot/Windows/BootConsoleIo.cpp
index 2fee84fc..60305ea1 100644
--- a/src/Boot/Windows/BootConsoleIo.cpp
+++ b/src/Boot/Windows/BootConsoleIo.cpp
@@ -299,6 +299,12 @@ void ClearBiosKeystrokeBuffer ()
mov cx, 32
cld
rep stosb
+
+ // reset position pointers at 0x41A and 0x41C to the begining
+ // of keyboard buffer to avoid revealing password/PIM length
+ mov ax, 0x001e
+ mov es:[0x41a], ax
+ mov es:[0x41c], ax
pop es
}
}