This differential implements inbound notification session creation with race condition handling. The NSE code is modified to use this mechanism when receiving E2EE notification from peer. Android part in CommNotificationsHandler.java will be added shortly after Tunnelbroker <-> FCM diff is out.
Details
- Apply this patch: https://gist.github.com/marcinwasowicz/8bdc755abad8ecf81f3bd01c6ca34376
- Send notification from web to iOS device.
- Ensure that each notification results in two identical notification being displayed. One is from the keyserver. The other is from tunnelbroker and is E2EE encrypted.
- I also added some logs in NotificationsCryptoModule so that it is logged whether we create new session or use existing one. I only saw the first type of log once.
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-8237
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h | ||
---|---|---|
114 | When we create inbound session from notification we need to return updated notif account state as well since one time key is removed from the account. | |
147 | When we win race condition we create an emphemeral one time session to decrypt single message but we don't persist anything. The StatefulPeerConflictDecryptResult implementation of flushState is a np-op. |
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp | ||
---|---|---|
613 | We use this way of checking olm internals: https://github.com/CommE2E/comm/blob/6583cde4a78d2981d65d9ec16256f62225af58fb/native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp#L169-L171 |
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp | ||
---|---|---|
709 | Decryption with immediate state persistence is used on Android. |
Use common C++ implementation on Android. It was tested the same way as iOS using latest staging Tunnelbroker release
native/cpp/CommonCpp/CryptoTools/Session.cpp | ||
---|---|---|
86–91 ↗ | (On Diff #42717) | this is huge change, I would create a separate diff to test it separately but I think it's okay |