Page MenuHomePhabricator

[lib] mark prekeys as published after uploading to identity
ClosedPublic

Authored by varun on Jun 19 2024, 7:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 7:23 AM
Unknown Object (File)
Sat, Dec 7, 6:19 PM
Unknown Object (File)
Fri, Nov 29, 7:03 AM
Unknown Object (File)
Thu, Nov 28, 7:03 AM
Unknown Object (File)
Sun, Nov 24, 11:55 PM
Unknown Object (File)
Nov 14 2024, 12:34 PM
Unknown Object (File)
Nov 2 2024, 9:55 AM
Unknown Object (File)
Nov 1 2024, 12:49 PM
Subscribers

Details

Summary

These are all the places where we upload prekeys to the identity service. In all these cases, we should mark them as published immediately after uploading.

Depends on D12479

Test Plan

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

varun held this revision as a draft.
varun published this revision for review.Jun 20 2024, 9:25 AM
varun edited the test plan for this revision. (Show Details)
kamil added 1 blocking reviewer(s): marcin.

What if a user is successfully registered/logged in to Identity but for some reason markPrekeysAsPublished fails? Wondering, if shouldn't catch and ignore errors here and make sure later PrekeysHandler re-uploads the same keys and marks as published (since marking as published is used only for rotation).

I think existing logic should handle this because it uploads not published keys and marks as published (not sure about native but logic should match).

It might be strange if a user sees that registration fails, but after attempting sees that the user already exists because registration worked but marking keys as published failed.

Curious for @marcin's perspective.

Accepting to unblock and I don't have a strong opinion on which approach is better, only pointing out something worth considering.

What if a user is successfully registered/logged in to Identity but for some reason markPrekeysAsPublished fails? Wondering, if shouldn't catch and ignore errors here and make sure later PrekeysHandler re-uploads the same keys and marks as published (since marking as published is used only for rotation).

I think existing logic should handle this because it uploads not published keys and marks as published (not sure about native but logic should match).

It might be strange if a user sees that registration fails, but after attempting sees that the user already exists because registration worked but marking keys as published failed.

Curious for @marcin's perspective.

Accepting to unblock and I don't have a strong opinion on which approach is better, only pointing out something worth considering.

fair point. i'm curious what @marcin thinks as well

This revision is now accepted and ready to land.Jun 24 2024, 6:52 AM

I have concern that marking prekeys as published after uploading to identity comes with the risk of delaying next prekey rotation in case app crashes after uploading but before marking as published. I am wondering if letting the prekeys to be in circulation for longer than expected is a security concern. Accepting to unblock identity release. If my reasoning is correct we can just change the order later.

It might be strange if a user sees that registration fails, but after attempting sees that the user already exists because registration worked but marking keys as published failed.

I think this is a good point. I'm going to catch and ignore errors from markPrekeysAsPublished

I have concern that marking prekeys as published after uploading to identity comes with the risk of delaying next prekey rotation in case app crashes after uploading but before marking as published. I am wondering if letting the prekeys to be in circulation for longer than expected is a security concern. Accepting to unblock identity release. If my reasoning is correct we can just change the order later.

talked to @marcin about this, decided we can discuss with @ashoat when he's back