From c3eb1664ef99158bd9037d772d4e76f63b0299a2 Mon Sep 17 00:00:00 2001 From: matejcik Date: Thu, 1 Jun 2023 13:28:11 +0200 Subject: [PATCH] chore(python): add T2B1 keys to trezorlib --- python/.changelog.d/noissue.added | 1 + python/src/trezorlib/firmware/models.py | 27 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 python/.changelog.d/noissue.added diff --git a/python/.changelog.d/noissue.added b/python/.changelog.d/noissue.added new file mode 100644 index 000000000..8ce4d8415 --- /dev/null +++ b/python/.changelog.d/noissue.added @@ -0,0 +1 @@ +Recognize signing keys for T2B1. diff --git a/python/src/trezorlib/firmware/models.py b/python/src/trezorlib/firmware/models.py index 21c009766..8dacf918e 100644 --- a/python/src/trezorlib/firmware/models.py +++ b/python/src/trezorlib/firmware/models.py @@ -176,13 +176,40 @@ TREZOR_T_DEV = ModelKeys( firmware_sigs_needed=-1, ) +TREZOR_R = ModelKeys( + production=True, + boardloader_keys=[ + bytes.fromhex(key) + for key in ( + "549a45557008d5518a9a151dc6a3568cf73830a7fe419f2626d9f30d024b2bec", + "c16c7027f8a3962607bf24cdec2e3cd2344e1f6071e8260b3dda52b1a5107cb7", + "87180f933178b2832bee2d7046c7f4b98300ca7d7fb2e4567169c8730a1c4020", + ) + ], + boardloader_sigs_needed=2, + bootloader_keys=[ + bytes.fromhex(key) + for key in ( + "549a45557008d5518a9a151dc6a3568cf73830a7fe419f2626d9f30d024b2bec", + "c16c7027f8a3962607bf24cdec2e3cd2344e1f6071e8260b3dda52b1a5107cb7", + "87180f933178b2832bee2d7046c7f4b98300ca7d7fb2e4567169c8730a1c4020", + ) + ], + bootloader_sigs_needed=2, + firmware_keys=(), + firmware_sigs_needed=-1, +) + +TREZOR_R_DEV = TREZOR_T_DEV MODEL_MAP = { Model.ONE: TREZOR_ONE_V3, Model.T: TREZOR_T, + Model.R: TREZOR_R, } MODEL_MAP_DEV = { Model.ONE: TREZOR_ONE_V3_DEV, Model.T: TREZOR_T_DEV, + Model.R: TREZOR_R_DEV, }