Details
Details
- Reviewers
atul ashoat - Commits
- rCOMMb62c392ba505: [web] Caclulate encrypted media sha256
Added console.log in encryptMedia() and sent encrypted photo. Verified that the hash is calculated
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
Please address inline comment before landing. If it doesn't make sense or you feel like I am missing something, feel free to re-request review
web/olm/olm-utils.js | ||
---|---|---|
17–24 | There is a risk here of a race that leads to two instantiations. We can avoid that |
web/olm/olm-utils.js | ||
---|---|---|
17–24 | Actually I missed a line here: let olmUtilityInstance; function olmUtility(): Promise<Utility> { if (!olmUtilityInstance) { olmUtilityInstance = (async () => { await initOlm(); olmUtilityInstance = new olm.Utility(); return olmUtilityInstance; })(); } return Promise.resolve(olmUtilityInstance); } |
Comment Actions
During testing I encountered this issue: https://linear.app/comm/issue/ENG-3845/js-olm-sha256-fails
For now, used a WebCrypto fallback.
web/media/encryption-utils.js | ||
---|---|---|
65 ↗ | (On Diff #26169) | Looks like this is very well supported by modern browsers: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest |