deltamode & secure notes and passwords

This commit is contained in:
scgbckbone 2024-10-16 10:28:07 +02:00 committed by doc-hex
parent 1b54536eff
commit 8f86ed1c0e
5 changed files with 22 additions and 5 deletions

View File

@ -5,6 +5,7 @@ This lists the new changes that have not yet been published in a normal release.
# Shared Improvements - Both Mk4 and Q
- Enhancement: Hide Secure Notes & Passwords in Deltamode. Wipe seed if notes menu accessed.
- Bugfix: Sometimes see a struck screen after _Verifying..._ in boot up sequence.
On Q, result is blank screen, on Mk4, result is three-dots screen.
- Bugfix: Do not allow to enable/disable Seed Vault feature when in temporary seed mode

View File

@ -889,6 +889,12 @@ async def start_login_sequence():
await ar.interact()
except: pass
if pa.is_deltamode():
# pretend Secure Notes & Passwords is disabled
try:
settings.remove_key("secnap")
except: pass
if version.has_nfc and settings.get('nfc', 0):
# Maybe allow NFC now
import nfc

View File

@ -352,7 +352,7 @@ AdvancedNormalMenu = [
MenuItem('Export Wallet', predicate=has_secrets, menu=WalletExportMenu, shortcut='x'), # also inside FileMgmt
MenuItem("Upgrade Firmware", menu=UpgradeMenu, predicate=is_not_tmp),
MenuItem("File Management", menu=FileMgmtMenu),
NonDefaultMenuItem('Secure Notes & Passwords', 'notes', menu=make_notes_menu,
NonDefaultMenuItem('Secure Notes & Passwords', 'secnap', menu=make_notes_menu,
predicate=version.has_qwerty),
MenuItem('Derive Seed B85' if not version.has_qwerty else 'Derive Seeds (BIP-85)',
f=drv_entro_start),
@ -424,7 +424,7 @@ NormalSystem = [
MenuItem('Start HSM Mode', f=start_hsm_menu_item, predicate=hsm_policy_available),
MenuItem("Address Explorer", menu=address_explore, shortcut='x'),
MenuItem('Secure Notes & Passwords', menu=make_notes_menu, shortcut='n',
predicate=lambda: version.has_qwerty and (settings.get("notes", False) != False)),
predicate=lambda: version.has_qwerty and settings.get("secnap", False)),
MenuItem('Type Passwords', f=password_entry, shortcut='t',
predicate=lambda: settings.get("emu", False) and has_secrets()),
MenuItem('Seed Vault', menu=make_seed_vault_menu, shortcut='v',

View File

@ -21,7 +21,13 @@ from utils import problem_file_line, url_decode
ONE_LINE = CHARS_W-2
async def make_notes_menu(*a):
if settings.get('notes', False) == False:
from pincodes import pa
if pa.is_deltamode():
import callgate
callgate.fast_wipe()
if not settings.get('secnap', False):
# Explain feature, and then enable if interested. Drop them into menu.
ch = await ux_show_story('''\
Enable this feature to store short text notes and passwords inside the Coldcard.
@ -34,8 +40,10 @@ Press ENTER to enable and get started otherwise CANCEL.''',
if ch != 'y':
return
# mark as enabled (altho empty)
settings.set('notes', [])
# mark as enabled
settings.set('secnap', True)
if settings.get('notes', None) is None:
settings.set('notes', [])
# need to correct top menu now, so this choice is there.
goto_top_menu()
@ -170,6 +178,7 @@ class NotesMenu(MenuSystem):
async def disable_notes(cls, *a):
# they don't want feature anymore; already checked no notes in effect
# - no need for confirm, they aren't loosing anything
settings.remove_key('secnap')
settings.remove_key('notes')
settings.save()

View File

@ -56,6 +56,7 @@ from utils import call_later_ms
# seedvault = (bool) opt-in enable seed vault feature
# seeds = list of stored secrets for seedvault feature
# bright = (int:0-255) LCD brightness when on battery
# secnap = (bool) opt-in enable Secure Notes & Passwords feature
# notes = (complex) Secure notes held for user, see notes.py
# accts = (list of tuples: (addr_fmt, account#)) Single-sig wallets we've seen them use
# aei = (bool) allow changing start index in Address Explorer