1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-08 03:07:03 +00:00

feat(python): Implement DebugLinkOptigaSetSecMax.

This commit is contained in:
Andrew Kozlik 2024-07-09 14:29:46 +02:00 committed by Andrew Kozlik
parent b71a809da3
commit b6b1ad8825
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
Added ability to set Optiga's security event counter to maximum: `trezorctl debug optiga-set-sec-max`.

View File

@ -21,6 +21,7 @@ import click
from .. import mapping, messages, protobuf
from ..client import TrezorClient
from ..debuglink import TrezorClientDebugLink
from ..debuglink import optiga_set_sec_max as debuglink_optiga_set_sec_max
from ..debuglink import prodtest_t1 as debuglink_prodtest_t1
from ..debuglink import record_screen
from . import with_client
@ -112,3 +113,10 @@ def prodtest_t1(client: "TrezorClient") -> str:
Only available on PRODTEST firmware and on T1B1. Formerly named self-test.
"""
return debuglink_prodtest_t1(client)
@cli.command()
@with_client
def optiga_set_sec_max(client: "TrezorClient") -> str:
"""Set Optiga's security event counter to maximum."""
return debuglink_optiga_set_sec_max(client)

View File

@ -1362,3 +1362,8 @@ def record_screen(
def _is_emulator(debug_client: "TrezorClientDebugLink") -> bool:
"""Check if we are connected to emulator, in contrast to hardware device."""
return debug_client.features.fw_vendor == "EMULATOR"
@expect(messages.Success, field="message", ret_type=str)
def optiga_set_sec_max(client: "TrezorClient") -> protobuf.MessageType:
return client.call(messages.DebugLinkOptigaSetSecMax())