Skip to content

fix(core): propagate SE failure when importing mnemonic - #428

Open
ldpreload wants to merge 1 commit into
OneKeyHQ:mainfrom
ldpreload:fix-se-import-error-propagation
Open

fix(core): propagate SE failure when importing mnemonic#428
ldpreload wants to merge 1 commit into
OneKeyHQ:mainfrom
ldpreload:fix-se-import-error-propagation

Conversation

@ldpreload

@ldpreload ldpreload commented Aug 6, 2026

Copy link
Copy Markdown

store_mnemonic_secret() drops the return value of config.se_import_mnemonic() and config.se_import_slip39() in core/src/storage/device.py. The SE layer does report failure: se_set_mnemonic() returns secfalse when the THD89 APDU exchange or MAC check fails, and the modtrezorconfig binding maps that to False. But the result is discarded, so ResetDevice still answers Success("Initialized") even when nothing was actually stored. The device then looks uninitialized after reboot, and with no_backup the seed is just lost.

This raises on failure instead, same behavior as the classic firmware (config_setMnemonic failure path in firmware-classic1s).

Only static analysis, I don't have hardware to force the SE fault, but the discarded return is straightforward.

@ldpreload
ldpreload requested a review from a team as a code owner August 6, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant