wire-web-packages icon indicating copy to clipboard operation
wire-web-packages copied to clipboard

feat(core): update keys periodically (#FS-562)

Open PatrykBuniX opened this issue 3 years ago • 0 comments

link to confluence use case

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 days old 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

PatrykBuniX avatar Sep 01 '22 12:09 PatrykBuniX