wire-web-packages
wire-web-packages copied to clipboard
feat(core): update keys periodically (#FS-562)
Each user periodically updates their key material for each MLS group they're in.
Goals:
(1) Store the date (timestamp) of group creation / welcome message as last-kay-material:
- [x] when creating a group - after conversation is successfully created in
createMLSConversation(ConversationService.ts) - [ ] when being added to a group (welcome message) - todo
Dates are stored in indexedDB's last_key_material_update_dates table as objects ({groupId:string, previousUpdateDate: number})
(2)
- [x] After 90 days (likely to change) since creating/being added to a group - renew keying material for each mls group - achieved with
TaskScheduler- each time app is launched it gets the dates of last key update and schedules tasks to renew key material (3) for> 90 daysold dates.
(3)
- [x] For each group calculate the key material update (core crypto
updateKeyingMaterial(groupId)) - returns a commit - [x] Send commit message and accept it.
- [x] Update last-key-material timestamp for each group and schedule new renewal task
This pull request also adds new MLSService class which contains some mls-related methods shared between conversation and notification services.
Pull Request Checklist
- [ ] My code is covered by tests
- [ ] I will merge the PR as breaking change, if the API contract changes