From 319a665d0d1eec843ee744f599e932e48701ed58 Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 31 May 2023 14:47:22 +0200 Subject: [PATCH] chore(core): add T2B1 vendor header data --- core/SConscript.firmware | 12 ++++--- core/SConscript.prodtest | 4 ++- core/SConscript.reflash | 4 ++- .../T2B1/vendor_qa_DO_NOT_SIGN.json | 19 +++++++++++ .../{ => T2B1}/vendor_qa_DO_NOT_SIGN.toif | 0 .../vendorheader/T2B1/vendor_satoshilabs.json | 19 +++++++++++ .../vendorheader/T2B1/vendor_satoshilabs.toif | Bin 0 -> 213 bytes .../vendorheader/T2B1/vendor_unsafe.json | 19 +++++++++++ .../vendorheader/T2B1/vendor_unsafe.toif | Bin 0 -> 219 bytes ...vendorheader_qa_DO_NOT_SIGN_signed_dev.bin | Bin 0 -> 4608 bytes .../vendorheader_qa_DO_NOT_SIGN_unsigned.bin | Bin 0 -> 4608 bytes .../vendorheader_satoshilabs_unsigned.bin | Bin 0 -> 4608 bytes .../T2B1/vendorheader_unsafe_signed_dev.bin | Bin 0 -> 4608 bytes .../T2B1/vendorheader_unsafe_unsigned.bin | Bin 0 -> 4608 bytes .../{ => T2T1}/vendor_prodtest.json | 0 .../{ => T2T1}/vendor_prodtest.toif | 0 .../{ => T2T1}/vendor_qa_DO_NOT_SIGN.json | 0 .../T2T1/vendor_qa_DO_NOT_SIGN.toif | 1 + .../{ => T2T1}/vendor_satoshilabs.json | 0 .../{ => T2T1}/vendor_satoshilabs.toif | Bin .../{ => T2T1}/vendor_unsafe.json | 0 .../{ => T2T1}/vendor_unsafe.toif | Bin .../vendorheader_prodtest_signed_prod.bin | Bin .../vendorheader_prodtest_unsigned.bin | Bin ...vendorheader_qa_DO_NOT_SIGN_signed_dev.bin | Bin .../vendorheader_qa_DO_NOT_SIGN_unsigned.bin | Bin .../vendorheader_satoshilabs_signed_prod.bin | Bin .../vendorheader_satoshilabs_unsigned.bin | Bin .../vendorheader_unsafe_signed_dev.bin | Bin .../vendorheader_unsafe_signed_prod.bin | Bin .../vendorheader_unsafe_unsigned.bin | Bin core/embed/vendorheader/generate.sh | 30 +++++++++++------- 32 files changed, 90 insertions(+), 18 deletions(-) create mode 100644 core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.json rename core/embed/vendorheader/{ => T2B1}/vendor_qa_DO_NOT_SIGN.toif (100%) create mode 100644 core/embed/vendorheader/T2B1/vendor_satoshilabs.json create mode 100644 core/embed/vendorheader/T2B1/vendor_satoshilabs.toif create mode 100644 core/embed/vendorheader/T2B1/vendor_unsafe.json create mode 100644 core/embed/vendorheader/T2B1/vendor_unsafe.toif create mode 100644 core/embed/vendorheader/T2B1/vendorheader_qa_DO_NOT_SIGN_signed_dev.bin create mode 100644 core/embed/vendorheader/T2B1/vendorheader_qa_DO_NOT_SIGN_unsigned.bin create mode 100644 core/embed/vendorheader/T2B1/vendorheader_satoshilabs_unsigned.bin create mode 100644 core/embed/vendorheader/T2B1/vendorheader_unsafe_signed_dev.bin create mode 100644 core/embed/vendorheader/T2B1/vendorheader_unsafe_unsigned.bin rename core/embed/vendorheader/{ => T2T1}/vendor_prodtest.json (100%) rename core/embed/vendorheader/{ => T2T1}/vendor_prodtest.toif (100%) rename core/embed/vendorheader/{ => T2T1}/vendor_qa_DO_NOT_SIGN.json (100%) create mode 120000 core/embed/vendorheader/T2T1/vendor_qa_DO_NOT_SIGN.toif rename core/embed/vendorheader/{ => T2T1}/vendor_satoshilabs.json (100%) rename core/embed/vendorheader/{ => T2T1}/vendor_satoshilabs.toif (100%) rename core/embed/vendorheader/{ => T2T1}/vendor_unsafe.json (100%) rename core/embed/vendorheader/{ => T2T1}/vendor_unsafe.toif (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_prodtest_signed_prod.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_prodtest_unsigned.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_qa_DO_NOT_SIGN_signed_dev.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_qa_DO_NOT_SIGN_unsigned.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_satoshilabs_signed_prod.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_satoshilabs_unsigned.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_unsafe_signed_dev.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_unsafe_signed_prod.bin (100%) rename core/embed/vendorheader/{ => T2T1}/vendorheader_unsafe_unsigned.bin (100%) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index 30cb32f2ec..8fb1f7d8ff 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -794,15 +794,17 @@ cmake_gen = env.Command( MODEL_IDENTIFIER = tools.get_model_identifier(TREZOR_MODEL) +BOOTLOADER_SUFFIX = MODEL_IDENTIFIER if BOOTLOADER_QA: - VENDORHEADER = 'embed/vendorheader/vendorheader_qa_DO_NOT_SIGN_signed_dev.bin' + VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_qa_DO_NOT_SIGN_signed_dev.bin' BOOTLOADER_SUFFIX = MODEL_IDENTIFIER + '_qa' elif PRODUCTION: - VENDORHEADER = 'embed/vendorheader/vendorheader_satoshilabs_signed_prod.bin' - BOOTLOADER_SUFFIX = MODEL_IDENTIFIER + VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_satoshilabs_signed_prod.bin' +elif TREZOR_MODEL == 'R': + # XXX workaround for currently missing prod-signed vendorheader for T2B1 + VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_unsafe_signed_dev.bin' else: - VENDORHEADER = 'embed/vendorheader/vendorheader_unsafe_signed_prod.bin' - BOOTLOADER_SUFFIX = MODEL_IDENTIFIER + VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_unsafe_signed_prod.bin' obj_program.extend( env.Command( diff --git a/core/SConscript.prodtest b/core/SConscript.prodtest index efb2a4aeaa..cf196f4540 100644 --- a/core/SConscript.prodtest +++ b/core/SConscript.prodtest @@ -193,7 +193,9 @@ obj_program.extend(env.Object(source=SOURCE_PRODTEST)) obj_program.extend(env.Object(source=SOURCE_STMHAL)) obj_program.extend(env.Object(source=SOURCE_TREZORHAL)) -VENDORHEADER = 'embed/vendorheader/vendorheader_' + ('unsafe_signed_prod.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'prodtest_signed_prod.bin') +MODEL_IDENTIFIER = tools.get_model_identifier(TREZOR_MODEL) + +VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_' + ('unsafe_signed_prod.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'prodtest_signed_prod.bin') obj_program.extend( env.Command( diff --git a/core/SConscript.reflash b/core/SConscript.reflash index e3114886db..17528270da 100644 --- a/core/SConscript.reflash +++ b/core/SConscript.reflash @@ -181,7 +181,9 @@ obj_program += env.Object(source=SOURCE_REFLASH) obj_program += env.Object(source=SOURCE_STMHAL) obj_program += env.Object(source=SOURCE_TREZORHAL) -VENDORHEADER = 'embed/vendorheader/vendorheader_' + ('unsafe_signed_dev.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'satoshilabs_signed_prod.bin') +MODEL_IDENTIFIER = tools.get_model_identifier(TREZOR_MODEL) + +VENDORHEADER = f'embed/vendorheader/{MODEL_IDENTIFIER}/vendorheader_' + ('unsafe_signed_dev.bin' if ARGUMENTS.get('PRODUCTION', '0') == '0' else 'satoshilabs_signed_prod.bin') obj_program.extend( env.Command( diff --git a/core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.json b/core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.json new file mode 100644 index 0000000000..77aa812863 --- /dev/null +++ b/core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.json @@ -0,0 +1,19 @@ +{ + "header_len": 4608, + "text": "QA ONLY, DO NOT USE!", + "hw_model": "T2B1", + "expiry": 0, + "version": [0, 0], + "sig_m": 2, + "trust": { + "show_vendor_string": false, + "require_user_click": false, + "red_background": false, + "delay": 0 + }, + "pubkeys": [ + "e28a8970753332bd72fef413e6b0b2ef1b4aadda7aa2c141f233712a6876b351", + "d4eec1869fb1b8a4e817516ad5a931557cb56805c3eb16e8f3a803d647df7869", + "772c8a442b7db06e166cfbc1ccbcbcde6f3eba76a4e98ef3ffc519502237d6ef" + ] +} diff --git a/core/embed/vendorheader/vendor_qa_DO_NOT_SIGN.toif b/core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.toif similarity index 100% rename from core/embed/vendorheader/vendor_qa_DO_NOT_SIGN.toif rename to core/embed/vendorheader/T2B1/vendor_qa_DO_NOT_SIGN.toif diff --git a/core/embed/vendorheader/T2B1/vendor_satoshilabs.json b/core/embed/vendorheader/T2B1/vendor_satoshilabs.json new file mode 100644 index 0000000000..f89f57049e --- /dev/null +++ b/core/embed/vendorheader/T2B1/vendor_satoshilabs.json @@ -0,0 +1,19 @@ +{ + "header_len": 4608, + "text": "SatoshiLabs", + "hw_model": "T2B1", + "expiry": 0, + "version": [0, 0], + "sig_m": 2, + "trust": { + "show_vendor_string": false, + "require_user_click": false, + "red_background": false, + "delay": 0 + }, + "pubkeys": [ + "bf4e6f004fcb32cec683f22c88c1a86c1518c6de8ac97002d84a63bea3e375dd", + "d2def691c1e9d809d8190cf7af935c10688f68983479b4ee9abac19104878ec1", + "07c85134946bf89fa19bdc2c5e5ff9ce01296508ee0863d0ff6d63331d1a2516" + ] +} diff --git a/core/embed/vendorheader/T2B1/vendor_satoshilabs.toif b/core/embed/vendorheader/T2B1/vendor_satoshilabs.toif new file mode 100644 index 0000000000000000000000000000000000000000..4ba1fc365acf2a9eae19a517d4e5b894e4269e65 GIT binary patch literal 213 zcmV;`04o1fPf15W06+lA0002(lFJbUAqYgtfc&%U4A{~d9OR?U>>igJ{iG3;=yw6> z!3CBPi{i=xLq>YQYKSf7l5had(dVHdCIiHgriyH0qajdoj@u1Qp}LvS2DY4?QEp!tz`a9VZmwc6mszZUJK*!SG@h`8e)e7CeVV54A(9N- PWev_3w#37tpzq=XvxaVY literal 0 HcmV?d00001 diff --git a/core/embed/vendorheader/T2B1/vendor_unsafe.json b/core/embed/vendorheader/T2B1/vendor_unsafe.json new file mode 100644 index 0000000000..41699ae41c --- /dev/null +++ b/core/embed/vendorheader/T2B1/vendor_unsafe.json @@ -0,0 +1,19 @@ +{ + "header_len": 4608, + "text": "UNSAFE, DO NOT USE!", + "hw_model": "T2B1", + "expiry": 0, + "version": [0, 0], + "sig_m": 2, + "trust": { + "show_vendor_string": true, + "require_user_click": true, + "red_background": true, + "delay": 1 + }, + "pubkeys": [ + "e28a8970753332bd72fef413e6b0b2ef1b4aadda7aa2c141f233712a6876b351", + "d4eec1869fb1b8a4e817516ad5a931557cb56805c3eb16e8f3a803d647df7869", + "772c8a442b7db06e166cfbc1ccbcbcde6f3eba76a4e98ef3ffc519502237d6ef" + ] +} diff --git a/core/embed/vendorheader/T2B1/vendor_unsafe.toif b/core/embed/vendorheader/T2B1/vendor_unsafe.toif new file mode 100644 index 0000000000000000000000000000000000000000..bb96de5fcb09cf98ea6883d9317e6ab7811acbe4 GIT binary patch literal 219 zcmV<103`oZPf15W06+lG0002ZlED?kAP7Y5fd0Fr19#sVjKDBtZ}Fn=l|f*PH?8?y z4JH?KapBL)0Qy6909`LjegUln%wKT5xsdRsK*J9&6wuqLh|iNx79I+8+_`{&6}Kp{ zdG;poce;BdRqvpH*~X(l$IaB^@CV=4?GE*lFk}9Q6Y+^hgZCS9cjWVi_?e13O8$z= zT5>7CufpV^o*$LWRRhE71R4%z*$Mbj3~iUx=wPK6DO$tRAch1<`YSii#{(`E)+fBL VZxO-3B+Kp*OfJZv7i7F(eEJ{ff+Toh}#c+6{SPIlm8{ z*|Xh4%zk;8Ch(c(vt0K_)5Pwg12L=a* zlR);{Nv8!_6ggZ@HvHNAhUdm5DVZmW&%KeGF8z0j;FK5Tj4uzeP7~~Ybc)H@t?EEl zhwigU1q|mdK3}M)#(ZSrvaXz@#fs501wXg)ivB#-9#a%~lmD-t`~5|pKU?m9>x)0~ zX2wY(=*?Km-FqPewt_AmjC16|3$juxy%0l4SUh>nw4q)fxg?k zz6*EFyuh|?&fLJfc!>jhon!OXB^geST+?9v;PW<$%O4 literal 0 HcmV?d00001 diff --git a/core/embed/vendorheader/T2B1/vendorheader_qa_DO_NOT_SIGN_unsigned.bin b/core/embed/vendorheader/T2B1/vendorheader_qa_DO_NOT_SIGN_unsigned.bin new file mode 100644 index 0000000000000000000000000000000000000000..5c4a762e524cf01a2ade684468747b8bd720f4f7 GIT binary patch literal 4608 zcmWFuiV9;8Vt@iB=KudgjGPQ%dJ{ff+Toh}#c+6{SPIlm8{ z*|Xh4%zk;8Ch(c(vt0K_)5Pwg12L=a* zlR);{Nv8!_6ggZ@HvHNAhUdm5DVZmW&%KeGF8z0j;FK5Tj4uzeP7~~Ybc)H@t?EEl zhwigU1q|mdK3}M)#(ZSrvaXz@#fs501wXg)ivB#-9#a%~lmD-t`~5|pKU?m9>x)0~ zX2wY(=*?Km-FqPewt_AmjC16|3$juxy%0l4SUh>nw4q)fxg?k zz6*EFyuh|?&fLJfc!>jhon!OXB^geST+?9v;PW<0oAyyHl|@IN=%SXN3^j5|27B)>Q#(hIKJ_Ey}uFir|W23!A|Go%6+py`qwAb2ORf`Tfeljl9 z$|&0$c;(%}w)q=(EO{Xwn00lfVQ9_P4A#T1#a?_~!Fz?S?$DoZkn} z?AdcK-)>jgl9zp-{~whMP%^*vUO3b**wM{ZN5REk!OuTLAvD-kF~r}~-GRY@;XKe8 zXD1yLJ)*$j^0wjM?j_9S_oaFc7^LKXT=Ze8V?vMl+Mlt!YT_k@56_=w_~l&65UcN9 z$GDc|OnkxKofAGRbvVqgFLL4b%8v7s{l(p(l$SLoLNuwn);sg`GN-zsGNQ$ z=%aUHfq2TEgjz(nj*9OHU5LmKJ4K;4E>hv3{g-I{jgtZ XIfu&x!#|qWgc{n7Ht=7yt7HcNm2<>^ literal 0 HcmV?d00001 diff --git a/core/embed/vendorheader/T2B1/vendorheader_unsafe_unsigned.bin b/core/embed/vendorheader/T2B1/vendorheader_unsafe_unsigned.bin new file mode 100644 index 0000000000000000000000000000000000000000..3fe85ef073327b905544513bb876de617f8c5e0a GIT binary patch literal 4608 zcmWFuiV9;8Vt@iB=DzJ_Ey}uFir|W23!A|Go%6+py`qwAb2ORf`Tfeljl9 z$|&0$c;(%}w)q=(EO{Xwn00lfVQ9_P4A#T1#a?_~!Fz?S?$DoZkn} z?AdcK-)>jgl9zp-{~whMP%^*vUO3b**wM{ZN5REk!OuTLAvD-kF~r}~-GRY@;XKe8 zXD1yLJ)*$j^0wjM?j_9S_oaFc7^LKXT=Ze8V?vMl+Mlt!YT_k@56_=w_~l&65UcN9 z$GDc|OnkxKofAGRbvVqgFLL4b%8v7s{l(p(l$SLoLNuwn);sg`GN-zsGNQ$ z=%aUHfq2TEgjz(nj