VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Boot
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-09-24 21:36:13 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 16:40:14 (GMT)
commit77d070fe7384bfb0c6dece81e4900e603b13ee6c (patch)
treed1596436592199cad8ed7654253e167e87422ecd /src/Boot
parent183cbc087a7551e4335da212e93732a72a7570f0 (diff)
downloadVeraCrypt-77d070fe7384bfb0c6dece81e4900e603b13ee6c.zip
VeraCrypt-77d070fe7384bfb0c6dece81e4900e603b13ee6c.tar.gz
Windows Bootloader: for MBR bootloader, reset position pointers to keystroke buffer after password or PIM is entered to avoid leaking length information
Diffstat (limited to 'src/Boot')
-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 2fee84f..60305ea 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
}
}