mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-06-26 18:02:35 +00:00
common/messages: Add SdProtect message.
This commit is contained in:
parent
4f01003637
commit
06fc676cc9
@ -131,6 +131,24 @@ message ChangePin {
|
|||||||
optional bool remove = 1; // is PIN removal requested?
|
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
|
* Request: Test if the device is alive, device sends back the message in Success response
|
||||||
* @start
|
* @start
|
||||||
|
@ -61,6 +61,7 @@ enum MessageType {
|
|||||||
MessageType_WordAck = 47 [(wire_in) = true];
|
MessageType_WordAck = 47 [(wire_in) = true];
|
||||||
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];
|
||||||
|
|
||||||
// Bootloader
|
// Bootloader
|
||||||
MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true];
|
MessageType_FirmwareErase = 6 [(wire_in) = true, (wire_bootloader) = true];
|
||||||
|
@ -33,6 +33,7 @@ WordRequest = 46
|
|||||||
WordAck = 47
|
WordAck = 47
|
||||||
GetFeatures = 55
|
GetFeatures = 55
|
||||||
SetU2FCounter = 63
|
SetU2FCounter = 63
|
||||||
|
SdProtect = 79
|
||||||
FirmwareErase = 6
|
FirmwareErase = 6
|
||||||
FirmwareUpload = 7
|
FirmwareUpload = 7
|
||||||
FirmwareRequest = 8
|
FirmwareRequest = 8
|
||||||
|
28
core/src/trezor/messages/SdProtect.py
Normal file
28
core/src/trezor/messages/SdProtect.py
Normal 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),
|
||||||
|
}
|
5
core/src/trezor/messages/SdProtectOperationType.py
Normal file
5
core/src/trezor/messages/SdProtectOperationType.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
DISABLE = 0
|
||||||
|
ENABLE = 1
|
||||||
|
REFRESH = 2
|
@ -31,6 +31,7 @@ WordRequest = 46
|
|||||||
WordAck = 47
|
WordAck = 47
|
||||||
GetFeatures = 55
|
GetFeatures = 55
|
||||||
SetU2FCounter = 63
|
SetU2FCounter = 63
|
||||||
|
SdProtect = 79
|
||||||
FirmwareErase = 6
|
FirmwareErase = 6
|
||||||
FirmwareUpload = 7
|
FirmwareUpload = 7
|
||||||
FirmwareRequest = 8
|
FirmwareRequest = 8
|
||||||
|
28
python/src/trezorlib/messages/SdProtect.py
Normal file
28
python/src/trezorlib/messages/SdProtect.py
Normal 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),
|
||||||
|
}
|
5
python/src/trezorlib/messages/SdProtectOperationType.py
Normal file
5
python/src/trezorlib/messages/SdProtectOperationType.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Automatically generated by pb2py
|
||||||
|
# fmt: off
|
||||||
|
DISABLE = 0
|
||||||
|
ENABLE = 1
|
||||||
|
REFRESH = 2
|
@ -201,6 +201,7 @@ from .RippleGetAddress import RippleGetAddress
|
|||||||
from .RipplePayment import RipplePayment
|
from .RipplePayment import RipplePayment
|
||||||
from .RippleSignTx import RippleSignTx
|
from .RippleSignTx import RippleSignTx
|
||||||
from .RippleSignedTx import RippleSignedTx
|
from .RippleSignedTx import RippleSignedTx
|
||||||
|
from .SdProtect import SdProtect
|
||||||
from .SelfTest import SelfTest
|
from .SelfTest import SelfTest
|
||||||
from .SetU2FCounter import SetU2FCounter
|
from .SetU2FCounter import SetU2FCounter
|
||||||
from .SignIdentity import SignIdentity
|
from .SignIdentity import SignIdentity
|
||||||
@ -274,6 +275,7 @@ from . import PinMatrixRequestType
|
|||||||
from . import RecoveryDeviceType
|
from . import RecoveryDeviceType
|
||||||
from . import RequestType
|
from . import RequestType
|
||||||
from . import ResetDeviceBackupType
|
from . import ResetDeviceBackupType
|
||||||
|
from . import SdProtectOperationType
|
||||||
from . import TezosBallotType
|
from . import TezosBallotType
|
||||||
from . import TezosContractType
|
from . import TezosContractType
|
||||||
from . import WordRequestType
|
from . import WordRequestType
|
||||||
|
Loading…
Reference in New Issue
Block a user