feat(common): Add UnlockPath message.

[no changelog]
andrewkozlik/slip25b
Andrew Kozlik 2 years ago
parent dff5bdced0
commit 5aa356f044

@ -607,3 +607,4 @@ message AuthorizeCoinJoin {
optional InputScriptType script_type = 7 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
optional AmountUnit amount_unit = 8 [default=BITCOIN]; // show amounts in
}

@ -441,6 +441,7 @@ message DoPreauthorized {
* @start
* @next SignTx
* @next GetOwnershipProof
* @next GetPublicKey
*/
message PreauthorizedRequest {
}
@ -480,3 +481,25 @@ message Nonce {
required bytes nonce = 1; // a 32-byte random value generated by Trezor
}
/**
* Request: Ask device to unlock a subtree of the keychain.
* @start
* @next UnlockedPathRequest
* @next Failure
*/
message UnlockPath {
repeated uint32 address_n = 1; // prefix of the BIP-32 path leading to the account (m / purpose' / coin_type' / account')
optional bytes mac = 2; // the MAC returned by UnlockedPathRequest
}
/**
* Request: Device awaits an operation.
* @start
* @next SignTx
* @next GetPublicKey
* @next GetAddress
*/
message UnlockedPathRequest {
optional bytes mac = 1; // authentication code for future UnlockPath calls
}

@ -119,6 +119,8 @@ enum MessageType {
MessageType_GetFirmware = 90 [(bitcoin_only) = true, (wire_in) = true];
MessageType_FirmwareChunk = 91 [(bitcoin_only) = true, (wire_out) = true];
MessageType_FirmwareChunkAck = 92 [(bitcoin_only) = true, (wire_in) = true];
MessageType_UnlockPath = 93 [(bitcoin_only) = true, (wire_in) = true];
MessageType_UnlockedPathRequest = 94 [(bitcoin_only) = true, (wire_out) = true];
MessageType_SetU2FCounter = 63 [(wire_in) = true];
MessageType_GetNextU2FCounter = 80 [(wire_in) = true];

@ -46,6 +46,8 @@ FirmwareHash = 89
GetFirmware = 90
FirmwareChunk = 91
FirmwareChunkAck = 92
UnlockPath = 93
UnlockedPathRequest = 94
FirmwareErase = 6
FirmwareUpload = 7
FirmwareRequest = 8

@ -63,6 +63,8 @@ if TYPE_CHECKING:
GetFirmware = 90
FirmwareChunk = 91
FirmwareChunkAck = 92
UnlockPath = 93
UnlockedPathRequest = 94
SetU2FCounter = 63
GetNextU2FCounter = 80
NextU2FCounter = 81

@ -2475,6 +2475,36 @@ if TYPE_CHECKING:
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["Nonce"]:
return isinstance(msg, cls)
class UnlockPath(protobuf.MessageType):
address_n: "list[int]"
mac: "bytes | None"
def __init__(
self,
*,
address_n: "list[int] | None" = None,
mac: "bytes | None" = None,
) -> None:
pass
@classmethod
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["UnlockPath"]:
return isinstance(msg, cls)
class UnlockedPathRequest(protobuf.MessageType):
mac: "bytes | None"
def __init__(
self,
*,
mac: "bytes | None" = None,
) -> None:
pass
@classmethod
def is_type_of(cls, msg: protobuf.MessageType) -> TypeGuard["UnlockedPathRequest"]:
return isinstance(msg, cls)
class DebugLinkDecision(protobuf.MessageType):
button: "DebugButton | None"
swipe: "DebugSwipeDirection | None"

@ -5,7 +5,7 @@ endif
SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdProtect Tezos WebAuthn \
DebugLinkRecordScreen DebugLinkEraseSdCard DebugLinkWatchLayout \
GetOwnershipProof OwnershipProof GetOwnershipId OwnershipId AuthorizeCoinJoin DoPreauthorized \
CancelAuthorization DebugLinkLayout GetNonce \
CancelAuthorization DebugLinkLayout GetNonce UnlockPath \
TxAckInput TxAckOutput TxAckPrev TxAckPaymentRequest \
EthereumSignTypedData EthereumTypedDataStructRequest EthereumTypedDataStructAck \
EthereumTypedDataValueRequest EthereumTypedDataValueAck

@ -40,3 +40,8 @@ GetFirmwareHash.challenge max_size:32
FirmwareHash.hash max_size:32
FirmwareChunk.chunk max_size:2048
UnlockPath.address_n max_count:8
UnlockPath.mac max_size:32
UnlockedPathRequest.mac max_size:32

@ -71,6 +71,8 @@ class MessageType(IntEnum):
GetFirmware = 90
FirmwareChunk = 91
FirmwareChunkAck = 92
UnlockPath = 93
UnlockedPathRequest = 94
SetU2FCounter = 63
GetNextU2FCounter = 80
NextU2FCounter = 81
@ -3521,6 +3523,37 @@ class Nonce(protobuf.MessageType):
self.nonce = nonce
class UnlockPath(protobuf.MessageType):
MESSAGE_WIRE_TYPE = 93
FIELDS = {
1: protobuf.Field("address_n", "uint32", repeated=True, required=False),
2: protobuf.Field("mac", "bytes", repeated=False, required=False),
}
def __init__(
self,
*,
address_n: Optional[Sequence["int"]] = None,
mac: Optional["bytes"] = None,
) -> None:
self.address_n: Sequence["int"] = address_n if address_n is not None else []
self.mac = mac
class UnlockedPathRequest(protobuf.MessageType):
MESSAGE_WIRE_TYPE = 94
FIELDS = {
1: protobuf.Field("mac", "bytes", repeated=False, required=False),
}
def __init__(
self,
*,
mac: Optional["bytes"] = None,
) -> None:
self.mac = mac
class DebugLinkDecision(protobuf.MessageType):
MESSAGE_WIRE_TYPE = 100
FIELDS = {

Loading…
Cancel
Save