mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-15 23:56:12 +00:00
device: pass u2f counter when running device recovery
This commit is contained in:
parent
7d14018f99
commit
3390422ce3
@ -15,6 +15,7 @@
|
||||
# If not, see <https://www.gnu.org/licenses/lgpl-3.0.html>.
|
||||
|
||||
import os
|
||||
import time
|
||||
import warnings
|
||||
|
||||
from . import messages as proto
|
||||
@ -110,6 +111,7 @@ def recover(
|
||||
input_callback=None,
|
||||
type=proto.RecoveryDeviceType.ScrambledWords,
|
||||
dry_run=False,
|
||||
u2f_counter=None,
|
||||
):
|
||||
if client.features.model == "1" and input_callback is None:
|
||||
raise RuntimeError("Input callback required for Trezor One")
|
||||
@ -122,6 +124,9 @@ def recover(
|
||||
"Device already initialized. Call device.wipe() and try again."
|
||||
)
|
||||
|
||||
if u2f_counter is None:
|
||||
u2f_counter = int(time.time())
|
||||
|
||||
res = client.call(
|
||||
proto.RecoveryDevice(
|
||||
word_count=word_count,
|
||||
@ -132,6 +137,7 @@ def recover(
|
||||
enforce_wordlist=True,
|
||||
type=type,
|
||||
dry_run=dry_run,
|
||||
u2f_counter=u2f_counter,
|
||||
)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user