From 8d886d325fa98981840b45a74f173e0358a05d4a Mon Sep 17 00:00:00 2001 From: ldpreload <95562574+ldpreload@users.noreply.github.com> Date: Thu, 6 Aug 2026 19:08:21 +0000 Subject: [PATCH] fix(core): propagate SE failure when importing mnemonic --- core/src/storage/device.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/storage/device.py b/core/src/storage/device.py index 2805a2576..0a1b9d69a 100644 --- a/core/src/storage/device.py +++ b/core/src/storage/device.py @@ -1131,9 +1131,13 @@ def store_mnemonic_secret( common.set_bool(_NAMESPACE, INITIALIZED, True, public=True) else: if backup_type == BackupType.Bip39: - config.se_import_mnemonic(secret) + if not config.se_import_mnemonic(secret): + raise RuntimeError("Failed to import mnemonic into the secure element") else: - config.se_import_slip39(secret, backup_type, identifier, iteration_exponent) + if not config.se_import_slip39( + secret, backup_type, identifier, iteration_exponent + ): + raise RuntimeError("Failed to import secret into the secure element") common.set_uint8(_NAMESPACE, _BACKUP_TYPE, backup_type) common.set_true_or_delete(_NAMESPACE, _NO_BACKUP, no_backup) if not no_backup: