1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00

python: get u2f counter

This commit is contained in:
Tomas Susanka 2019-11-13 10:38:04 +00:00
parent a8b82975a1
commit ef9900ee52
2 changed files with 12 additions and 2 deletions

View File

@ -412,6 +412,12 @@ def set_u2f_counter(connect, counter):
return device.set_u2f_counter(connect(), counter) return device.set_u2f_counter(connect(), counter)
@cli.command(help="Get U2F counter.")
@click.pass_obj
def get_u2f_counter(connect):
return device.get_next_u2f_counter(connect())
@cli.command(help="Reset device to factory defaults and remove all private data.") @cli.command(help="Reset device to factory defaults and remove all private data.")
@click.option( @click.option(
"-b", "-b",

View File

@ -99,8 +99,12 @@ def sd_protect(client, operation):
@expect(proto.Success, field="message") @expect(proto.Success, field="message")
def set_u2f_counter(client, u2f_counter): def set_u2f_counter(client, u2f_counter):
ret = client.call(proto.SetU2FCounter(u2f_counter=u2f_counter)) return client.call(proto.SetU2FCounter(u2f_counter=u2f_counter))
return ret
@expect(proto.NextU2FCounter, field="u2f_counter")
def get_next_u2f_counter(client):
return client.call(proto.GetNextU2FCounter())
@expect(proto.Success, field="message") @expect(proto.Success, field="message")