dice: use model-specific completion keys
What changed, and why it matters
This commit changes which physical buttons on the COLDCARD device are treated as 'done' or 'cancel' keys during a dice-roll seed-generation feature. It makes the choice depend on the device model (QWERTY keyboard vs. non-QWERTY) instead of hardcoding a mix of keys. The change is small and appears to be a UI/UX correctness fix rather than a security vulnerability. There is no clear evidence in the commit that this fixes an exploitable bug.
Treat as a routine firmware improvement. Review whether the old mixed key set could have caused unexpected behavior (e.g., a non-existent key being interpreted as completion/cancel) on any supported model, but no immediate security response is indicated by the commit alone.
Security signals we found
Input handling change for seed-generation UI
Model-specific key mapping introduced
Removal of hardcoded mixed key set
Evidence from the diff
In shared/seed.py, the add_dice_rolls function builds a PressRelease object that tells the firmware which key presses to listen for while the user is entering dice rolls. Previously it listened for digits 1-6 plus KEY_ENTER, KEY_CANCEL, ‘y’, and ‘x’. The patch replaces that with digits 1-6 plus model-specific completion keys: KEY_ENTER + KEY_CANCEL on QWERTY models, or ‘y’/’x’ on non-QWERTY models. This removes the previous mixing of both sets of keys and avoids treating keys that may not exist or have different meanings on a given model as completion inputs.
Changed components
shared/seed.pyCOLDCARD dice-roll seed generation UIInspect captured patch +2 / −3
### shared/seed.py
@@ -452,9 +452,8 @@ async def add_dice_rolls(count, seed, judge_them, nwords=None, enforce=False):
counter = {}
md = sha256(seed)
- # no key-repeat on any key we act on: a held digit is one roll, not many
- # - same idea as ux_mk4.ux_enter_number, which puts its digits in need_release
- pr = PressRelease('123456' + KEY_ENTER + KEY_CANCEL + 'xy')
+ done_keys = (KEY_ENTER + KEY_CANCEL) if version.has_qwerty else 'yx'
+ pr = PressRelease('123456' + done_keys)
# draws initial screen, and returns funct to update count and/or hash
screen_updater = ux_dice_rolling()Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.