Skip to content

Commit b5019ca

Browse files
committed
Merge remote-tracking branch 'benma/rembase-proto'
2 parents a1ec5cd + e66818c commit b5019ca

File tree

21 files changed

+41
-1592
lines changed

21 files changed

+41
-1592
lines changed

messages/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ set(PROTO_FILES
44
common.proto
55
backup_commands.proto
66
bitbox02_system.proto
7-
bitboxbase.proto
87
btc.proto
98
eth.proto
109
mnemonic.proto

messages/bitboxbase.options

Lines changed: 0 additions & 19 deletions
This file was deleted.

messages/bitboxbase.proto

Lines changed: 0 additions & 88 deletions
This file was deleted.

messages/hww.proto

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import "common.proto";
1919

2020
import "backup_commands.proto";
2121
import "bitbox02_system.proto";
22-
import "bitboxbase.proto";
2322
import "btc.proto";
2423
import "eth.proto";
2524
import "keystore.proto";
@@ -37,7 +36,7 @@ message Success {
3736
}
3837

3938
message Request {
40-
reserved 1;
39+
reserved 1, 23;
4140
oneof request {
4241
// removed: RandomNumberRequest random_number = 1;
4342
SetDeviceNameRequest device_name = 2;
@@ -61,7 +60,7 @@ message Request {
6160
ETHRequest eth = 20;
6261
ResetRequest reset = 21;
6362
RestoreFromMnemonicRequest restore_from_mnemonic = 22;
64-
BitBoxBaseRequest bitboxbase = 23;
63+
// removed: BitBoxBaseRequest bitboxbase = 23;
6564
RootFingerprintRequest fingerprint = 24;
6665
BTCRequest btc = 25;
6766
ElectrumEncryptionKeyRequest electrum_encryption_key = 26;

py/bitbox02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
OUT_DIR=bitbox02/communication/generated
1717

18-
PROTO_FILES=hww.proto common.proto backup_commands.proto bitbox02_system.proto bitboxbase.proto btc.proto eth.proto mnemonic.proto system.proto perform_attestation.proto keystore.proto antiklepto.proto
18+
PROTO_FILES=hww.proto common.proto backup_commands.proto bitbox02_system.proto btc.proto eth.proto mnemonic.proto system.proto perform_attestation.proto keystore.proto antiklepto.proto
1919

2020
TARGETS=$(addprefix ${OUT_DIR}/, $(PROTO_FILES:.proto=_pb2.py))
2121

py/bitbox02/bitbox02/bitboxbase/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

py/bitbox02/bitbox02/bitboxbase/bitboxbase.py

Lines changed: 0 additions & 91 deletions
This file was deleted.

py/bitbox02/bitbox02/bitboxbase/py.typed

Whitespace-only changes.

py/bitbox02/bitbox02/communication/bitbox_api_protocol.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ class Platform(enum.Enum):
168168
""" Available hardware platforms """
169169

170170
BITBOX02 = "bitbox02"
171-
BITBOXBASE = "bitboxbase"
172171

173172

174173
class BitBox02Edition(enum.Enum):
@@ -178,12 +177,6 @@ class BitBox02Edition(enum.Enum):
178177
BTCONLY = "btconly"
179178

180179

181-
class BitBoxBaseEdition(enum.Enum):
182-
""" Editions for the BitBoxBase platform """
183-
184-
STANDARD = "standard"
185-
186-
187180
class Bitbox02Exception(Exception):
188181
def __init__(self, code: int, message: str):
189182
self.code = code
@@ -549,7 +542,7 @@ def __init__(
549542
self.version.major, self.version.minor, self.version.patch, build=self.version.build
550543
)
551544

552-
# raises exceptions if the library is out of date, does not check BitBoxBase
545+
# raises exceptions if the library is out of date
553546
self._check_max_version()
554547

555548
self._bitbox_protocol: BitBoxProtocol
@@ -668,13 +661,11 @@ def reboot(
668661
return True
669662

670663
@staticmethod
671-
def get_info(
672-
transport: TransportLayer
673-
) -> Tuple[str, Platform, Union[BitBox02Edition, BitBoxBaseEdition], bool]:
664+
def get_info(transport: TransportLayer) -> Tuple[str, Platform, Union[BitBox02Edition], bool]:
674665
"""
675666
Returns (version, platform, edition, unlocked).
676667
This is useful to get the version of the firmware when a usb descriptor is not available
677-
(BitBoxBase, via BitBoxBridge, etc.).
668+
(via BitBoxBridge, etc.).
678669
This call does not use a versioned BitBoxProtocol for communication, as the version is not
679670
available (this call is used to get the version), so it must work for all firmware versions.
680671
"""
@@ -688,11 +679,11 @@ def get_info(
688679
platform = {0x00: Platform.BITBOX02}[platform_byte]
689680

690681
edition_byte, response = response[0], response[1:]
691-
edition: Union[BitBox02Edition, BitBoxBaseEdition]
682+
edition: Union[BitBox02Edition]
692683
if platform == Platform.BITBOX02:
693684
edition = {0x00: BitBox02Edition.MULTI, 0x01: BitBox02Edition.BTCONLY}[edition_byte]
694685
else:
695-
edition = {0x00: BitBoxBaseEdition.STANDARD}[edition_byte]
686+
raise Exception("Unknown platform: {}".format(platform))
696687

697688
unlocked_byte = response[0]
698689
unlocked = {0x00: False, 0x01: True}[unlocked_byte]
@@ -701,7 +692,7 @@ def get_info(
701692
def check_min_version(self) -> None:
702693
"""
703694
Raises FirmwareVersionOutdatedException if the device has an older firmware version than
704-
required and the minimum required version. A check for the BitBoxBase is not implemented.
695+
required and the minimum required version.
705696
"""
706697
if self.edition == BitBox02Edition.MULTI:
707698
if self.version < MIN_SUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION:
@@ -721,7 +712,6 @@ def _check_max_version(self) -> None:
721712
"""
722713
Raises LibraryVersionOutdatedException if the device has an firmware which is too new
723714
(major version increased).
724-
A check for the BitBoxBase is not implemented.
725715
"""
726716
if self.edition == BitBox02Edition.MULTI:
727717
if self.version >= MIN_UNSUPPORTED_BITBOX02_MULTI_FIRMWARE_VERSION:

0 commit comments

Comments
 (0)