vector-im-hydrogen-web/src/matrix/e2ee
Bruno Windels 134b04c782 make flushing room key shares reentrant
as it can be called from Room.start while still running.
2020-09-25 10:45:00 +02:00
..
megolm keys from backup need to be imported with import_session, not create 2020-09-17 17:59:02 +02:00
olm wrap olm error for creating session in DecryptionError 2020-09-21 17:58:13 +02:00
Account.js interpret unreported signed_curve25519 as 0 OTKs 2020-09-21 17:56:23 +02:00
common.js createEnum does not take an array 2020-09-18 13:08:35 +02:00
DecryptionResult.js make decryption algorithms return DecryptionResult 2020-09-08 10:48:11 +02:00
DeviceTracker.js actually use correct method to get all device ids for a user 2020-09-14 18:31:54 +02:00
OlmWorker.js offload olm account creation in worker 2020-09-11 10:43:17 +02:00
README.md add prepareSync and afterPrepareSync steps to sync, run decryption in it 2020-09-10 12:11:43 +02:00
RoomEncryption.js make flushing room key shares reentrant 2020-09-25 10:45:00 +02:00

Integratation within the sync lifetime cycle

prepareSync

The session can start its own read/write transactions here, rooms only read from a shared transaction

- session
    - device handler
        - txn
            - write pending encrypted
        - txn
            - olm decryption read
        - olm async decryption
            - dispatch to worker
        - txn
            - olm decryption write / remove pending encrypted
- rooms (with shared read txn)
    - megolm decryption read

afterPrepareSync

- rooms    
    - megolm async decryption   
        - dispatch to worker

writeSync

- rooms (with shared readwrite txn)
    - megolm decryption write, yielding decrypted events
    - use decrypted events to write room summary

afterSync

- rooms
    - emit changes

afterSyncCompleted

- session
    - e2ee account
        - generate more otks if needed
        - upload new otks if needed or device keys if not uploaded before
- rooms
    - share new room keys if needed