depthcharge: add functions to improve dev mode switch security
Add VbExKeyboardReadWithFlags() and VbExGetSwitches()
and read the recovery button state directly from hardware.
Also pass the VB_INIT_FLAG_VIRTUAL_REC_SWITCH at init
as appropriate.
These changes make it possible for vboot to avoid some
dangerous opportunistic exploits that could put the device
in developer mode without the owner intending to do so.
BUG=chrome-os-partner:21729
TEST=compiles
BRANCH=none
Change-Id: Ic34a0606ec93253303de9ca7adbdc37e0d2ccef9
Original-Change-Id: Ied1e59684517c0125be029f575be282fdb2db8a3
Reviewed-on: https://chromium-review.googlesource.com/187380
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
10 files changed