aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/via.c
diff options
context:
space:
mode:
authorJoel Challis2025-06-29 03:29:33 +0200
committerGitHub2025-06-29 03:29:33 +0200
commit711b109246dc7d7e3881ccf70dce4adceefb4b02 (patch)
tree8c12759de3302ba7d433e30748e8eb8bee73d567 /quantum/via.c
parent6347d18a2d4ffa041e175655e8669041e1f45d53 (diff)
Mitigate VIA keylogger security issues (#25414)
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'quantum/via.c')
-rw-r--r--quantum/via.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/quantum/via.c b/quantum/via.c
index 3682b4ab2b..9446811af6 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -22,6 +22,10 @@
# error "DYNAMIC_KEYMAP_ENABLE is not enabled"
#endif
+#ifdef VIA_INSECURE
+# pragma message "VIA_INSECURE is enabled - firmware is susceptible to keyloggers"
+#endif
+
#include "via.h"
#include "raw_hid.h"
@@ -318,7 +322,11 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
uint8_t rows = 28 / ((MATRIX_COLS + 7) / 8);
uint8_t i = 2;
for (uint8_t row = 0; row < rows && row + offset < MATRIX_ROWS; row++) {
+#ifdef VIA_INSECURE
matrix_row_t value = matrix_get_row(row + offset);
+#else
+ matrix_row_t value = 0;
+#endif
#if (MATRIX_COLS > 24)
command_data[i++] = (value >> 24) & 0xFF;
#endif