From cd5da87f4e348b90014606819d910be4101e1c41 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 5 Dec 2024 11:21:27 +0100 Subject: [PATCH] chore(protobuf): add `ResetDevice.entropy_check` --- packages/protobuf/messages.json | 23 ++++++++++++++++++++++- packages/protobuf/src/messages-schema.ts | 17 ++++++++++++++++- packages/protobuf/src/messages.ts | 12 +++++++++++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/packages/protobuf/messages.json b/packages/protobuf/messages.json index f5427b7c8d2..4c40dccd7a3 100644 --- a/packages/protobuf/messages.json +++ b/packages/protobuf/messages.json @@ -4860,6 +4860,10 @@ "options": { "default": "Bip39" } + }, + "entropy_check": { + "type": "bool", + "id": 11 } } }, @@ -4893,7 +4897,16 @@ } }, "EntropyRequest": { - "fields": {} + "fields": { + "entropy_commitment": { + "type": "bytes", + "id": 1 + }, + "prev_entropy": { + "type": "bytes", + "id": 2 + } + } }, "EntropyAck": { "fields": { @@ -4904,6 +4917,12 @@ } } }, + "ResetDeviceContinue": { + "fields": {} + }, + "ResetDeviceFinish": { + "fields": {} + }, "RecoveryDevice": { "fields": { "word_count": { @@ -6713,6 +6732,8 @@ "BackupDevice": 34, "EntropyRequest": 35, "EntropyAck": 36, + "ResetDeviceContinue": 994, + "ResetDeviceFinish": 995, "PassphraseRequest": 41, "PassphraseAck": 42, "RecoveryDevice": 45, diff --git a/packages/protobuf/src/messages-schema.ts b/packages/protobuf/src/messages-schema.ts index 815dc9887e2..fb89324b7c9 100644 --- a/packages/protobuf/src/messages-schema.ts +++ b/packages/protobuf/src/messages-schema.ts @@ -2571,6 +2571,7 @@ export const ResetDevice = Type.Object( skip_backup: Type.Optional(Type.Boolean()), no_backup: Type.Optional(Type.Boolean()), backup_type: Type.Optional(EnumEnum_BackupType), + entropy_check: Type.Optional(Type.Boolean()), }, { $id: 'ResetDevice' }, ); @@ -2594,7 +2595,13 @@ export const BackupDevice = Type.Object( ); export type EntropyRequest = Static; -export const EntropyRequest = Type.Object({}, { $id: 'EntropyRequest' }); +export const EntropyRequest = Type.Object( + { + entropy_commitment: Type.Optional(Type.String()), + prev_entropy: Type.Optional(Type.String()), + }, + { $id: 'EntropyRequest' }, +); export type EntropyAck = Static; export const EntropyAck = Type.Object( @@ -2604,6 +2611,12 @@ export const EntropyAck = Type.Object( { $id: 'EntropyAck' }, ); +export type ResetDeviceContinue = Static; +export const ResetDeviceContinue = Type.Object({}, { $id: 'ResetDeviceContinue' }); + +export type ResetDeviceFinish = Static; +export const ResetDeviceFinish = Type.Object({}, { $id: 'ResetDeviceFinish' }); + export enum Enum_WordRequestType { WordRequestType_Plain = 0, WordRequestType_Matrix9 = 1, @@ -3706,6 +3719,8 @@ export const MessageType = Type.Object( BackupDevice, EntropyRequest, EntropyAck, + ResetDeviceContinue, + ResetDeviceFinish, WordRequest, WordAck, SetU2FCounter, diff --git a/packages/protobuf/src/messages.ts b/packages/protobuf/src/messages.ts index 2531a6c4f05..508204ce37a 100644 --- a/packages/protobuf/src/messages.ts +++ b/packages/protobuf/src/messages.ts @@ -1686,6 +1686,7 @@ export type ResetDevice = { skip_backup?: boolean; no_backup?: boolean; backup_type?: Enum_BackupType; + entropy_check?: boolean; }; export type Slip39Group = { @@ -1698,12 +1699,19 @@ export type BackupDevice = { groups?: Slip39Group[]; }; -export type EntropyRequest = {}; +export type EntropyRequest = { + entropy_commitment?: string; + prev_entropy?: string; +}; export type EntropyAck = { entropy: string; }; +export type ResetDeviceContinue = {}; + +export type ResetDeviceFinish = {}; + export enum Enum_WordRequestType { WordRequestType_Plain = 0, WordRequestType_Matrix9 = 1, @@ -2468,6 +2476,8 @@ export type MessageType = { BackupDevice: BackupDevice; EntropyRequest: EntropyRequest; EntropyAck: EntropyAck; + ResetDeviceContinue: ResetDeviceContinue; + ResetDeviceFinish: ResetDeviceFinish; WordRequest: WordRequest; WordAck: WordAck; SetU2FCounter: SetU2FCounter;