matrix-org / matrix-org/matrix-js-sdk
Megolm encryption rotation configuration
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
Megolm encryption rotation configuration can coerce to 0 on null values. Initial configuration is configured here: https://github.com/matrix-org/matrix-js-sdk/blob/355da0f9a9c37fa348bc592e28ab4ecc6fbf824a/src/crypto/algorithms/megolm.js#L170-L179 Here it checks for undefined values, but not null.
If this happens, every time that rotation is checked (https://github.com/matrix-org/matrix-js-sdk/blob/355da0f9a9c37fa348bc592e28ab4ecc6fbf824a/src/crypto/algorithms/megolm.js#L74-L75), it starts a new session. It seems that null is coerced to 0 (or at least, is what I guess is happening).
I'm almost sure that this 2 parameters comes from a m.room.encryption event, but I could not find where this happens.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/crypto/algorithms/megolm.js at the initial configuration check around lines 170-179, then inspect the rotation check around lines 74-75. Trace how m.room.encryption events supply the two parameters and confirm that null values no longer cause repeated session creation during rotation checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100