summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/libpayload.h
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@chromium.org>2014-01-13 17:45:54 -0800
committerPatrick Georgi <patrick@georgi-clan.de>2014-07-12 20:19:14 +0200
commit562db3bb3fa16abf6f758e97f9e5496f1c14d423 (patch)
treec9076f5fc2b526f2088dfde880024540019a17f8 /payloads/libpayload/include/libpayload.h
parentf4d1f3a4d9f57b0c36bf90cd9326fdc38ea78de3 (diff)
libpayload: find source of input characters
This change makes it possible for vboot to avoid an exploit that could cause involuntary switch to dev mode. It gives depthcharge/vboot some information on the type of input device that generated a key. BUG=chrome-os-partner:21729 TEST=manually tested for panther BRANCH=none CQ-DEPEND=CL:182420,CL:182241,CL:182946 Change-Id: I87bdac34bfc50f3adb0b35a2c57a8f95f4fbc35b Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: https://chromium-review.googlesource.com/182357 Reviewed-by: Luigi Semenzato <semenzato@chromium.org> Tested-by: Luigi Semenzato <semenzato@chromium.org> Commit-Queue: Luigi Semenzato <semenzato@chromium.org> Reviewed-on: http://review.coreboot.org/6003 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'payloads/libpayload/include/libpayload.h')
-rw-r--r--payloads/libpayload/include/libpayload.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 10a4505c30..14f8a38164 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -247,12 +247,18 @@ int set_option_from_string(const struct nvram_accessor *nvram, struct cb_cmos_op
* @defgroup console Console functions
* @{
*/
+typedef enum {
+ CONSOLE_INPUT_TYPE_UNKNOWN = 0,
+ CONSOLE_INPUT_TYPE_USB,
+} console_input_type;
+
void console_init(void);
int putchar(unsigned int c);
int puts(const char *s);
int havekey(void);
int getchar(void);
int getchar_timeout(int *ms);
+console_input_type last_key_input_type(void);
extern int last_putchar;
@@ -261,6 +267,7 @@ struct console_input_driver {
struct console_input_driver *next;
int (*havekey) (void);
int (*getchar) (void);
+ console_input_type input_type;
};
struct console_output_driver;