HomePhabricator
Diffusion Comm 7b1601b0741d

[keyserver] Add new hashing to keyserver state check

Description

[keyserver] Add new hashing to keyserver state check

Summary:
Part of ENG-4959
Depends on D9265
Depends on D9266

Modify the hashing on the keyserver (for new clients) so that:

  • the hashes are generated from data in client-side-schema, so clients don't have to do the conversion
  • the stores aren't hashed by stringifying the whole store but instead we generate a hash for each info and merge them using xor (there's a code comment explaining why that is correct)

Test Plan:
Remove the version checks and wait for state check to trigger (with an old client):

  • check that there are no errors
  • check that:
    • currentUserInfo hash still matches because it's not a collection and it doesn't have anything to convert
    • specific userInfos match because they don't contain anything to convert
    • all other contain different hashes than on the client
  • inside of the getClientResponsesSelector additionally select integrityStore and use it's threadHashes for client side hashes -> check that now specific rawThreadInfos hashes match

Reviewers: tomek, inka, kamil

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D9267

Details

Provenance
Michal Gniadek <michal.gniadek@swmansion.com>Authored on Sep 21 2023, 2:03 AM
Reviewer
tomek
Differential Revision
D9267: [keyserver] Add new hashing to keyserver state check
Parents
rCOMM5fede8afd7b6: [lib/web/native] Add IntegrityStore
Branches
Unknown
Tags
Unknown

Event Timeline