diff --git a/protos/SignalService.proto b/protos/SignalService.proto index 577ed77f43..9bc9c15529 100644 --- a/protos/SignalService.proto +++ b/protos/SignalService.proto @@ -498,14 +498,14 @@ message SyncMessage { BLOCKED = 3; CONFIGURATION = 4; KEYS = 5; - PNI_IDENTITY = 6; + reserved /* PNI_IDENTITY */ 6; } optional Type type = 1; } message Keys { - optional bytes storageService = 1; // deprecated: this field will be removed in a future release. + reserved /* storageService */ 1; // deprecated: this field will be removed in a future release. optional bytes master = 2; // deprecated: this field will be removed in a future release. optional string accountEntropyPool = 3; optional bytes mediaRootBackupKey = 4; diff --git a/ts/background.ts b/ts/background.ts index 70c5586c58..7696e316ee 100644 --- a/ts/background.ts +++ b/ts/background.ts @@ -3276,7 +3276,6 @@ export async function startApp(): Promise { ev.confirm(); const { accountEntropyPool, masterKey, mediaRootBackupKey } = ev; - let { storageServiceKey } = ev; const prevMasterKeyBase64 = window.storage.get('masterKey'); const prevMasterKey = prevMasterKeyBase64 @@ -3314,7 +3313,6 @@ export async function startApp(): Promise { log.info('onKeysSync: updating masterKey'); } // Override provided storageServiceKey because it is deprecated. - storageServiceKey = deriveStorageServiceKey(derivedMasterKey); await window.storage.put('masterKey', Bytes.toBase64(derivedMasterKey)); } @@ -3331,12 +3329,8 @@ export async function startApp(): Promise { await window.storage.put('backupMediaRootKey', mediaRootBackupKey); } - if (storageServiceKey == null) { - log.warn('onKeysSync: deleting window.storageKey'); - await window.storage.remove('storageKey'); - } - - if (storageServiceKey) { + if (derivedMasterKey != null) { + const storageServiceKey = deriveStorageServiceKey(derivedMasterKey); const storageServiceKeyBase64 = Bytes.toBase64(storageServiceKey); if (window.storage.get('storageKey') === storageServiceKeyBase64) { log.info( diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index dd6625f31d..ab37f09409 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -3363,15 +3363,8 @@ export default class MessageReceiver logUnexpectedUrgentValue(envelope, 'keySync'); - if (!sync.storageService && !sync.master) { - return undefined; - } - const ev = new KeysEvent( { - storageServiceKey: Bytes.isNotEmpty(sync.storageService) - ? sync.storageService - : undefined, masterKey: Bytes.isNotEmpty(sync.master) ? sync.master : undefined, accountEntropyPool: sync.accountEntropyPool || undefined, mediaRootBackupKey: Bytes.isNotEmpty(sync.mediaRootBackupKey) diff --git a/ts/textsecure/messageReceiverEvents.ts b/ts/textsecure/messageReceiverEvents.ts index fab175ff05..5f391343ce 100644 --- a/ts/textsecure/messageReceiverEvents.ts +++ b/ts/textsecure/messageReceiverEvents.ts @@ -389,30 +389,22 @@ export class FetchLatestEvent extends ConfirmableEvent { } export type KeysEventData = Readonly<{ - storageServiceKey: Uint8Array | undefined; masterKey: Uint8Array | undefined; accountEntropyPool: string | undefined; mediaRootBackupKey: Uint8Array | undefined; }>; export class KeysEvent extends ConfirmableEvent { - public readonly storageServiceKey: Uint8Array | undefined; public readonly masterKey: Uint8Array | undefined; public readonly accountEntropyPool: string | undefined; public readonly mediaRootBackupKey: Uint8Array | undefined; constructor( - { - storageServiceKey, - masterKey, - accountEntropyPool, - mediaRootBackupKey, - }: KeysEventData, + { masterKey, accountEntropyPool, mediaRootBackupKey }: KeysEventData, confirm: ConfirmCallback ) { super('keys', confirm); - this.storageServiceKey = storageServiceKey; this.masterKey = masterKey; this.accountEntropyPool = accountEntropyPool; this.mediaRootBackupKey = mediaRootBackupKey;