Skip to content

Commit

Permalink
Merge pull request qmk#39 from svalboard/security_redo
Browse files Browse the repository at this point in the history
recreated vial secure patch with some tweaks
  • Loading branch information
morganvenable authored May 14, 2024
2 parents 0a39dae + 1f266f8 commit 262939c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
20 changes: 19 additions & 1 deletion keyboards/svalboard/keymaps/vial/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

#define VIAL_KEYBOARD_UID {0x1B, 0x18, 0x7D, 0xF2, 0x21, 0xF6, 0x29, 0x48}

// Vial security combos, depending on which unit this is...
#ifdef INIT_EE_HANDS_RIGHT
// right thumb lock
#define VIAL_UNLOCK_COMBO_ROWS { 5, 5 }
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 }
#elif INIT_EE_HANDS_LEFT
// left thumb lock
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 }
#define VIAL_UNLOCK_COMBO_COLS { 0, 1 }
#else
// both thumb locks
#define VIAL_UNLOCK_COMBO_ROWS { 0, 0, 5, 5 }
#define VIAL_UNLOCK_COMBO_COLS { 2, 5, 2, 5 }
#endif

// Shorten the unlock timeout (needs mod in `quantum/vial.c`; without
// it the override doesn't work)
#define VIAL_UNLOCK_COUNTER_MAX 12
2 changes: 0 additions & 2 deletions keyboards/svalboard/keymaps/vial/rules.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
VIA_ENABLE = yes
VIAL_ENABLE = yes
VIAL_INSECURE = yes

2 changes: 2 additions & 0 deletions quantum/vial.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

#include "vial_ensure_keycode.h"

#ifndef VIAL_UNLOCK_COUNTER_MAX
#define VIAL_UNLOCK_COUNTER_MAX 50
#endif

#ifdef VIAL_INSECURE
#pragma message "Building Vial-enabled firmware in insecure mode."
Expand Down

0 comments on commit 262939c

Please sign in to comment.