Page MenuHomePhabricator

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

Authored by kamil on Mon, Apr 8, 6:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 11:58 AM
Unknown Object (File)
Wed, Apr 17, 6:18 AM
Unknown Object (File)
Tue, Apr 16, 9:24 AM
Unknown Object (File)
Sun, Apr 14, 1:03 PM
Unknown Object (File)
Sat, Apr 13, 2:22 PM
Unknown Object (File)
Sat, Apr 13, 6:12 AM
Unknown Object (File)
Thu, Apr 11, 2:41 PM
Unknown Object (File)
Mon, Apr 8, 9:22 AM
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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
79 ↗(On Diff #38904)

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.Tue, Apr 9, 6:01 AM
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
79 ↗(On Diff #38904)

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 ↗(On Diff #38904)

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.Wed, Apr 10, 6:28 AM

introduce setter & getter