Page MenuHomePhabricator

[native] update C++ crypto module to handle session version
ClosedPublic

Authored by kamil on Apr 8 2024, 6:38 AM.
Tags
None
Referenced Files
F3394535: D11582.id39042.diff
Sat, Nov 30, 8:22 PM
F3394405: D11582.id38904.diff
Sat, Nov 30, 7:38 PM
F3394306: D11582.diff
Sat, Nov 30, 6:58 PM
Unknown Object (File)
Thu, Nov 7, 3:49 PM
Unknown Object (File)
Thu, Nov 7, 2:34 PM
Unknown Object (File)
Thu, Nov 7, 12:50 PM
Unknown Object (File)
Sun, Nov 3, 8:12 AM
Unknown Object (File)
Oct 12 2024, 10:59 PM
Subscribers

Details

Summary

Updates in-memory CryptoModule to work with session versions.

Depends on D11580

Test Plan

Tested in TBD

Diff Detail

Repository
rCOMM Comm
Branch
publish-session-resetting
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
79

for notifs it's hardcoded now - we should update this in the future while working at [ENG-7658](https://linear.app/comm/issue/ENG-7658/add-olm-session-versioning-for-notifs

kamil published this revision for review.Apr 9 2024, 6:01 AM
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
79

This code is only used to migrate old way of persisting session. Currently we serialize and persist the following JSON to MMKV:

{
    "session":<session bytes>
    "picklingKey": <picklingKey>
}

That said we need to update this JSON to have version field as well.

native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
79

since this value will be hardcoded for notifs - can we just ignore updating JSON and add it when it is needed? Not sure what could we gain from persisting mock value in MMKV

marcin added inline comments.
native/cpp/CommonCpp/CryptoTools/Session.h
17 ↗(On Diff #38911)

Nit: Could we make it private and introduce getter?

This revision is now accepted and ready to land.Apr 10 2024, 6:28 AM

introduce setter & getter