Skip to content

Commit 052e332

Browse files
committed
fix: cursor feedback
1 parent 78a4fef commit 052e332

File tree

1 file changed

+10
-6
lines changed
  • packages/profile-sync-controller/src/shared/encryption

1 file changed

+10
-6
lines changed

packages/profile-sync-controller/src/shared/encryption/encryption.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,16 @@ class EncryptorDecryptor {
228228
}
229229

230230
doesEntryNeedReEncryption(encryptedDataStr: string): boolean {
231-
const doesEntryHaveRandomSalt =
232-
this.getSalt(encryptedDataStr).toString() !== SHARED_SALT.toString();
233-
const doesEntryUseOldScryptN =
234-
JSON.parse(encryptedDataStr).o?.N !== SCRYPT_N_V2;
235-
236-
return doesEntryHaveRandomSalt || doesEntryUseOldScryptN;
231+
try {
232+
const doesEntryHaveRandomSalt =
233+
this.getSalt(encryptedDataStr).toString() !== SHARED_SALT.toString();
234+
const doesEntryUseOldScryptN =
235+
JSON.parse(encryptedDataStr).o?.N !== SCRYPT_N_V2;
236+
237+
return doesEntryHaveRandomSalt || doesEntryUseOldScryptN;
238+
} catch {
239+
return false;
240+
}
237241
}
238242

239243
#encrypt(plaintext: Uint8Array, key: Uint8Array): Uint8Array {

0 commit comments

Comments
 (0)