-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: revamp user storage encryption process (#4981)
## Explanation This PR adds new steps when both `UserStorageController` and SDK performs: - `getUserStorageAllFeatureEntries` - `getUserStorage` This steps looks for fetched entries' salts and, if random salts are found, re-encrypts these entries with a constant salt and uploads them back to user storage. This PR also removes the salt randomness when generating the keys, by adding a new shared salt. This is done to prevent performance issues when decrypting multiple entries that have different salts in applications using `UserStorageController` / SDK. ## References ## Changelog ### `@metamask/profile-sync-controller` - **CHANGED**: Stop using a random salt when generating scrypt keys and use a shared one - **ADDED**: Re-encrypt data fetched by `getUserStorageAllFeatureEntries` and `getUserStorage` with the shared salt if fetched entries were encrypted with random salts ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
- Loading branch information
1 parent
5e303ba
commit a6937e3
Showing
10 changed files
with
615 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.