From 408361691e90c29a2fc86ce63e5eb1715c1bc311 Mon Sep 17 00:00:00 2001 From: douglasbakkum Date: Tue, 4 Jun 2019 16:00:10 +0200 Subject: [PATCH 1/2] load_firmware.py: add sigs for v6.1.0 --- py/load_firmware.py | 10 ++++++++++ py/send_command.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/py/load_firmware.py b/py/load_firmware.py index f501f582..00aee51a 100755 --- a/py/load_firmware.py +++ b/py/load_firmware.py @@ -161,6 +161,16 @@ '30f12c64b516380ab1adaceb4f3f4008b003ce6c3d0f51cfe4509990b568c9c5252748099a95d0b2127ccb7b3c92c9b19fc32a26df100761fe0aacb52233afb7' '34f59a71d7d46c22439700804cf02898f7e9c592f8c3c3c533da234e04201be2112dd33c0574eb1befeda3ea70d6a5c4690bcbc7ea02a38fd67427f8ceab1d4f' ) +elif '6.1.0' in version: + sig = ( + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' + '50c1a2b8ca106dbab2acd4eec2193af35dbd1890af199b2dba091eb1ce65c96a3d0058e104626f1a060bb59c00c74699b3656e2885557d2baec8bb17967b25ec' + 'c514ed71d60486469e0b47afe93aafbc6f0b91818e98baa770692a3897be56f36eb82ea139e263bac8760192d97a39d3b48f61ac00c02d36f96d0aedb6168c85' + '77da95464c5647fd8f88a4a37400959f7bfce19dcf288efb1ea2396b84499b7b1e43fb184ba3df3e41a3e1433bf563b8e3a7b6fc825b81695399351ea3e3ee66' + '97b7b7861e929237c638690edc363ed8db1c85831e15114aaf1f103b97af7e3061fb85503f50104f3d36489e5e0b8b0313d750c114bd2eb80df9a3a0d02e12cc' + ) elif 'debug' in version: sig = ( '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' diff --git a/py/send_command.py b/py/send_command.py index 16492058..e9e14845 100755 --- a/py/send_command.py +++ b/py/send_command.py @@ -28,7 +28,7 @@ message = '{"seed":{"source":"create", "filename":"testing.pdf", "key":"password"}}' message = '{"sign":{"meta":"hash", "data":[{"keypath":"m/1p/1/1/0", "hash":"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"},{"keypath":"m/1p/1/1/1", "hash":"123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0"}]}}' message = '{"led":"blink"}' - + # Send a JSON command hid_send_encrypt(message, password) From c06712a9f32a6f176fa4e1ef7f87835fcb1b6cfe Mon Sep 17 00:00:00 2001 From: douglasbakkum Date: Tue, 4 Jun 2019 16:58:13 +0200 Subject: [PATCH 2/2] dbb_utils.py: python 3.6.8 fix where int/int->float --- py/dbb_utils.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/py/dbb_utils.py b/py/dbb_utils.py index 9eeea3c5..ab9f3ef3 100644 --- a/py/dbb_utils.py +++ b/py/dbb_utils.py @@ -68,8 +68,7 @@ def double_hash(x): def derive_keys(x): h = double_hash(x) h = sha512(h) - return (h[:len(h)/2],h[len(h)/2:]) - + return (h[:(int(len(h) / 2))], h[(int(len(h)) / 2):]) # ---------------------------------------------------------------------------------- # HID # @@ -105,8 +104,8 @@ def openHid(): def hid_send_frame(data): data = bytearray(data) data_len = len(data) - seq = 0; - idx = 0; + seq = 0 + idx = 0 write = [] while idx < data_len: if idx == 0: @@ -128,7 +127,7 @@ def hid_read_frame(): cmd = read[4] data_len = read[5] * 256 + read[6] data = read[7:] - idx = len(read) - 7; + idx = len(read) - 7 while idx < data_len: # CONT response read = dbb_hid.read(usb_report_size)