Skip to content

Commit

Permalink
feat(connect): add T3T1 pubkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Apr 17, 2024
1 parent 474cf2c commit f1b1787
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
8 changes: 8 additions & 0 deletions packages/connect/e2e/tests/device/authenticateDevice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ describe('TrezorConnect.authenticateDevice', () => {
'04ba6084cb9fba7c86d5d5a86108a91d55a27056da4eabbedde88a95e1cae8bce3620889167aaf7f2db166998f950984aa195e868f96e22803c3cd991be31d39e7',
],
},
T3T1: {
rootPubKeys: [
'047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
],
caPubKeys: [
'04ba6084cb9fba7c86d5d5a86108a91d55a27056da4eabbedde88a95e1cae8bce3620889167aaf7f2db166998f950984aa195e868f96e22803c3cd991be31d39e7',
],
},
};

it('validation successful', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ const CONFIG = {
'041b36cc98d5e3d1a20677aaf26254ef3756f27c9d63080c93ad3e7d39d3ad23bf00497b924789bc8e3f87834994e16780ad4eae7e75db1f03835ca64363e980b4',
],
},
T3T1: {
rootPubKeys: [
'04626d58aca84f0fcb52ea63f0eb08de1067b8d406574a715d5e7928f4b67f113a00fb5c5918e74d2327311946c446b242c20fe7347482999bdc1e229b94e27d96',
],
caPubKeys: [
'041b36cc98d5e3d1a20677aaf26254ef3756f27c9d63080c93ad3e7d39d3ad23bf00497b924789bc8e3f87834994e16780ad4eae7e75db1f03835ca64363e980b4',
],
},
};

describe('firmware/verifyAuthenticityProof', () => {
Expand Down
34 changes: 29 additions & 5 deletions packages/connect/src/data/deviceAuthenticityConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const CertPubKeys = Type.Object({
type ModelPubKeys = Static<typeof ModelPubKeys>;
const ModelPubKeys = Type.Intersect([
Type.Record(
Type.Literal(PROTO.DeviceModelInternal.T2B1),
Type.Exclude(
Type.KeyOfEnum(PROTO.DeviceModelInternal),
Type.Union([Type.Literal('T1B1'), Type.Literal('T2T1')]),
),
Type.Intersect([
CertPubKeys,
Type.Object({
Expand All @@ -21,7 +24,10 @@ const ModelPubKeys = Type.Intersect([
),
Type.Partial(
Type.Record(
Type.Exclude(Type.KeyOfEnum(PROTO.DeviceModelInternal), Type.Literal('T2B1')),
Type.Exclude(
Type.KeyOfEnum(PROTO.DeviceModelInternal),
Type.Union([Type.Literal('T2B1'), Type.Literal('T3T1')]),
),
Type.Undefined(),
),
),
Expand All @@ -42,7 +48,7 @@ export const DeviceAuthenticityConfig = Type.Intersect([
*/
export const deviceAuthenticityConfig: DeviceAuthenticityConfig = {
version: 1,
timestamp: '2023-03-18T12:00:00+00:00',
timestamp: '2023-04-17T12:00:00+00:00',
T2B1: {
rootPubKeys: [
'04ca97480ac0d7b1e6efafe518cd433cec2bf8ab9822d76eafd34363b55d63e60380bff20acc75cde03cffcb50ab6f8ce70c878e37ebc58ff7cca0a83b16b15fa5',
Expand All @@ -65,8 +71,6 @@ export const deviceAuthenticityConfig: DeviceAuthenticityConfig = {
'04ac1815177cc1f07700e5f18c05522427413f404bacc987eb1cf9d86f96b9e0cc53ef5941eafd483102eea321205d7dd9271ac2d0fca75a9a43deb824b51f1596',
],
debug: {
// debug keys are used **only** to validate emulator or dev. firmware
// use `allowDebugKeys: true` parameter in `authenticateDevice` method
rootPubKeys: [
'047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
],
Expand All @@ -75,4 +79,24 @@ export const deviceAuthenticityConfig: DeviceAuthenticityConfig = {
],
},
},
T3T1: {
rootPubKeys: [
'041854b27fb1d9f65abb66828e78c9dc0ca301e66081ab0c6a4d104f9df1cd0ad5a7c75f77a8c092f55cf825d2abaf734f934c9394d5e75f75a5a06a5ee9be93ae',
],
caPubKeys: [
'045b785b703810363deeadc0faa5a7388d8385f5e4f9170a3c27d3d2506bf9090d5b09044fbad6b906446d8cdb754b65869e8992b26a344e01ecff75844fe5a3d6',
'046442ece98b1cd13389b6eda3235e2848becc655db564897b2dc0862580f69b29be59dc30f92820f41a7a493b90623e66e1ee8529dbfd60d50aed97b46c4b8f64',
'0416960078e1d2b44df717ff5445ec76f4247333375982c5ae59b3bc223371f3cf81e7c182fd1ca36c95977070e2ff46f998bff3f00ab0de266edfdd430aea56b8',
],
debug: {
rootPubKeys: [
'047f77368dea2d4d61e989f474a56723c3212dacf8a808d8795595ef38441427c4389bc454f02089d7f08b873005e4c28d432468997871c0bf286fd3861e21e96a',
],
caPubKeys: [
'04829e8965018feb542e9236c9b2ce08f864a55ed9183d0259564f0e05345b04676a0bef36c59d21d3c24868b5601f0b1193a6bfcf6d814e1cfb79c2256a05e953',
'046f64eff0dfa3ceeae9708a3881fc09a3dae62198559d022d120e96edc168f3991a9e9b016635a0d43997ee55d8c2b37d969e8abc84e75c791ec911108b52f3c7',
'041260c3c1fd4ddfc97ba19732d5dcbe6efab61d58af83281b95d6cdb30606bf08f0b817eb6db2825b5ce32d0cc2c275b7eadcedaa1805f00b3f5a11668b6c5cb5',
],
},
},
};

0 comments on commit f1b1787

Please sign in to comment.