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
Unknown Object (File)
Thu, May 16, 6:10 PM
Unknown Object (File)
Mon, Apr 22, 11:58 AM
Unknown Object (File)
Apr 17 2024, 6:18 AM
Unknown Object (File)
Apr 16 2024, 9:24 AM
Unknown Object (File)
Apr 14 2024, 1:03 PM
Unknown Object (File)
Apr 13 2024, 2:22 PM
Unknown Object (File)
Apr 13 2024, 6:12 AM
Unknown Object (File)
Apr 11 2024, 2:41 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