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

common/messages: Add SdProtect message.

This commit is contained in:
Andrew Kozlik 2019-08-09 19:19:00 +02:00
parent 4f01003637
commit 06fc676cc9
9 changed files with 89 additions and 0 deletions

View File

@ -131,6 +131,24 @@ message ChangePin {
optional bool remove = 1; // is PIN removal requested?
}
/**
* Request: Starts workflow for enabling/regenerating/disabling SD card protection
* @start
* @next Success
* @next Failure
*/
message SdProtect {
optional SdProtectOperationType operation = 1;
/**
* Structure representing SD card protection operation
*/
enum SdProtectOperationType {
DISABLE = 0;
ENABLE = 1;
REFRESH = 2;
}
}
/**
* Request: Test if the device is alive, device sends back the message in Success response
* @start

View File

@ -61,6 +61,7 @@ enum MessageType {
MessageType_WordAck = 47 [(wire_in) = true];
MessageType_GetFeatures = 55 [(wire_in) = true];
MessageType_SetU2FCounter = 63 [(wire_in) = true];
MessageType_SdProtect = 79 [(wire_in) = true];
// Bootloader
MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true];

View File

@ -33,6 +33,7 @@ WordRequest = 46
WordAck = 47
GetFeatures = 55
SetU2FCounter = 63
SdProtect = 79
FirmwareErase = 6
FirmwareUpload = 7
FirmwareRequest = 8

View File

@ -0,0 +1,28 @@
# Automatically generated by pb2py
# fmt: off
import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional
from typing_extensions import Literal # noqa: F401
EnumTypeSdProtectOperationType = Literal[0, 1, 2]
except ImportError:
Dict, List, Optional = None, None, None # type: ignore
EnumTypeSdProtectOperationType = None # type: ignore
class SdProtect(p.MessageType):
MESSAGE_WIRE_TYPE = 79
def __init__(
self,
operation: EnumTypeSdProtectOperationType = None,
) -> None:
self.operation = operation
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('operation', p.EnumType("SdProtectOperationType", (0, 1, 2)), 0),
}

View File

@ -0,0 +1,5 @@
# Automatically generated by pb2py
# fmt: off
DISABLE = 0
ENABLE = 1
REFRESH = 2

View File

@ -31,6 +31,7 @@ WordRequest = 46
WordAck = 47
GetFeatures = 55
SetU2FCounter = 63
SdProtect = 79
FirmwareErase = 6
FirmwareUpload = 7
FirmwareRequest = 8

View File

@ -0,0 +1,28 @@
# Automatically generated by pb2py
# fmt: off
from .. import protobuf as p
if __debug__:
try:
from typing import Dict, List, Optional
from typing_extensions import Literal # noqa: F401
EnumTypeSdProtectOperationType = Literal[0, 1, 2]
except ImportError:
Dict, List, Optional = None, None, None # type: ignore
EnumTypeSdProtectOperationType = None # type: ignore
class SdProtect(p.MessageType):
MESSAGE_WIRE_TYPE = 79
def __init__(
self,
operation: EnumTypeSdProtectOperationType = None,
) -> None:
self.operation = operation
@classmethod
def get_fields(cls) -> Dict:
return {
1: ('operation', p.EnumType("SdProtectOperationType", (0, 1, 2)), 0),
}

View File

@ -0,0 +1,5 @@
# Automatically generated by pb2py
# fmt: off
DISABLE = 0
ENABLE = 1
REFRESH = 2

View File

@ -201,6 +201,7 @@ from .RippleGetAddress import RippleGetAddress
from .RipplePayment import RipplePayment
from .RippleSignTx import RippleSignTx
from .RippleSignedTx import RippleSignedTx
from .SdProtect import SdProtect
from .SelfTest import SelfTest
from .SetU2FCounter import SetU2FCounter
from .SignIdentity import SignIdentity
@ -274,6 +275,7 @@ from . import PinMatrixRequestType
from . import RecoveryDeviceType
from . import RequestType
from . import ResetDeviceBackupType
from . import SdProtectOperationType
from . import TezosBallotType
from . import TezosContractType
from . import WordRequestType