1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

common/protobuf: add message for retrieving an increased u2f counter

This commit is contained in:
Tomas Susanka 2019-11-11 14:58:09 +00:00
parent 13af405158
commit 2a20287882
10 changed files with 106 additions and 2 deletions

View File

@ -67,7 +67,7 @@ message DebugLinkState {
optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow
optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow
optional uint32 mnemonic_type = 12; // current mnemonic type (BIP-39/SLIP-39) optional uint32 mnemonic_type = 12; // current mnemonic type (BIP-39/SLIP-39)
repeated string layout_lines = 13; // current layout text repeated string layout_lines = 13; // current layout text
} }
/** /**

View File

@ -333,5 +333,21 @@ message WordAck {
* @next Success * @next Success
*/ */
message SetU2FCounter { message SetU2FCounter {
optional uint32 u2f_counter = 1; // counter optional uint32 u2f_counter = 1;
}
/**
* Request: Set U2F counter
* @start
* @next NextU2FCounter
*/
message GetNextU2FCounter {
}
/**
* Request: Set U2F counter
* @end
*/
message NextU2FCounter {
optional uint32 u2f_counter = 1;
} }

View File

@ -62,6 +62,8 @@ enum MessageType {
MessageType_GetFeatures = 55 [(wire_in) = true]; MessageType_GetFeatures = 55 [(wire_in) = true];
MessageType_SetU2FCounter = 63 [(wire_in) = true]; MessageType_SetU2FCounter = 63 [(wire_in) = true];
MessageType_SdProtect = 79 [(wire_in) = true]; MessageType_SdProtect = 79 [(wire_in) = true];
MessageType_GetNextU2FCounter = 80 [(wire_in) = true];
MessageType_NextU2FCounter = 81 [(wire_out) = true];
// Bootloader // Bootloader
MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true]; MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true];

View File

@ -0,0 +1,14 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class GetNextU2FCounter(p.MessageType):
MESSAGE_WIRE_TYPE = 80

View File

@ -37,6 +37,8 @@ WordAck = 47 # type: Literal[47]
GetFeatures = 55 # type: Literal[55] GetFeatures = 55 # type: Literal[55]
SetU2FCounter = 63 # type: Literal[63] SetU2FCounter = 63 # type: Literal[63]
SdProtect = 79 # type: Literal[79] SdProtect = 79 # type: Literal[79]
GetNextU2FCounter = 80 # type: Literal[80]
NextU2FCounter = 81 # type: Literal[81]
FirmwareErase = 6 # type: Literal[6] FirmwareErase = 6 # type: Literal[6]
FirmwareUpload = 7 # type: Literal[7] FirmwareUpload = 7 # type: Literal[7]
FirmwareRequest = 8 # type: Literal[8] FirmwareRequest = 8 # type: Literal[8]

View File

@ -0,0 +1,26 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class NextU2FCounter(p.MessageType):
MESSAGE_WIRE_TYPE = 81
def __init__(
self,
u2f_counter: int = None,
) -> None:
self.u2f_counter = u2f_counter
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('u2f_counter', p.UVarintType, 0),
}

View File

@ -0,0 +1,14 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class GetNextU2FCounter(p.MessageType):
MESSAGE_WIRE_TYPE = 80

View File

@ -35,6 +35,8 @@ WordAck = 47 # type: Literal[47]
GetFeatures = 55 # type: Literal[55] GetFeatures = 55 # type: Literal[55]
SetU2FCounter = 63 # type: Literal[63] SetU2FCounter = 63 # type: Literal[63]
SdProtect = 79 # type: Literal[79] SdProtect = 79 # type: Literal[79]
GetNextU2FCounter = 80 # type: Literal[80]
NextU2FCounter = 81 # type: Literal[81]
FirmwareErase = 6 # type: Literal[6] FirmwareErase = 6 # type: Literal[6]
FirmwareUpload = 7 # type: Literal[7] FirmwareUpload = 7 # type: Literal[7]
FirmwareRequest = 8 # type: Literal[8] FirmwareRequest = 8 # type: Literal[8]

View File

@ -0,0 +1,26 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List # noqa: F401
from typing_extensions import Literal # noqa: F401
except ImportError:
pass
class NextU2FCounter(p.MessageType):
MESSAGE_WIRE_TYPE = 81
def __init__(
self,
u2f_counter: int = None,
) -> None:
self.u2f_counter = u2f_counter
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('u2f_counter', p.UVarintType, 0),
}

View File

@ -101,6 +101,7 @@ from .GetAddress import GetAddress
from .GetECDHSessionKey import GetECDHSessionKey from .GetECDHSessionKey import GetECDHSessionKey
from .GetEntropy import GetEntropy from .GetEntropy import GetEntropy
from .GetFeatures import GetFeatures from .GetFeatures import GetFeatures
from .GetNextU2FCounter import GetNextU2FCounter
from .GetPublicKey import GetPublicKey from .GetPublicKey import GetPublicKey
from .HDNodePathType import HDNodePathType from .HDNodePathType import HDNodePathType
from .HDNodeType import HDNodeType from .HDNodeType import HDNodeType
@ -187,6 +188,7 @@ from .NEMSignTx import NEMSignTx
from .NEMSignedTx import NEMSignedTx from .NEMSignedTx import NEMSignedTx
from .NEMTransactionCommon import NEMTransactionCommon from .NEMTransactionCommon import NEMTransactionCommon
from .NEMTransfer import NEMTransfer from .NEMTransfer import NEMTransfer
from .NextU2FCounter import NextU2FCounter
from .PassphraseAck import PassphraseAck from .PassphraseAck import PassphraseAck
from .PassphraseRequest import PassphraseRequest from .PassphraseRequest import PassphraseRequest
from .PassphraseStateAck import PassphraseStateAck from .PassphraseStateAck import PassphraseStateAck