Page MenuHomePhabricator

[CommCoreModule] persist account after generating prekeys and one-time keys
ClosedPublic

Authored by kamil on Dec 18 2023, 4:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 23, 5:47 AM
Unknown Object (File)
Mon, Oct 21, 1:42 PM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Unknown Object (File)
Fri, Oct 18, 1:09 AM
Subscribers

Details

Summary

initializeCryptoAccount is idempotent method which is called many-times from JS code, and it relies on reading account from storage.
When we run getPrimaryOneTimeKeys or generateAndGetPrekeys at the beginnig to auth with Identity without persisting, then JS could call initializeCryptoAccount which overate state with keys generated, and later when creating inbound session olm throws OLM_BAD_MESSAGE_KEY_ID because init message was created with unknown one-time keys.

Context in ENG-6098.

Depends on D10371

Test Plan

Call getPrimaryOneTimeKeys and generateAndGetPrekeys and verify (using Logger) if it caused updating values in DB.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Dec 18 2023, 6:47 AM
This revision is now accepted and ready to land.Dec 21 2023, 2:25 AM
marcin requested changes to this revision.Dec 21 2023, 3:20 AM
marcin added inline comments.
native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
616 ↗(On Diff #34785)

This comment is relevant here as well.

This revision now requires changes to proceed.Dec 21 2023, 3:20 AM
This revision is now accepted and ready to land.Jan 2 2024, 5:17 AM