Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate backup private key before migrating it #4114

Merged

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Mar 15, 2024

Fixes element-hq/element-web#27324

Add some checks to validate that the legacy cached private key matches the current backup when migrating (it could have changed while the session was closed).

At the moment we need to have libolm available to check the key validity, it's was needed before that. Maybe see if we could expose some rust API?

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

BillCarsonFr and others added 18 commits March 4, 2024 09:37
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@BillCarsonFr BillCarsonFr added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Mar 15, 2024
@BillCarsonFr BillCarsonFr force-pushed the valere/element-r/validate_backup_key_before_migrating branch from 8cb1334 to bf3e6d6 Compare March 15, 2024 17:29
Base automatically changed from valere/element-r/migrate_local_trust_if_needed to develop March 18, 2024 09:21
@BillCarsonFr BillCarsonFr force-pushed the valere/element-r/validate_backup_key_before_migrating branch from cda5200 to 6852682 Compare April 11, 2024 15:07
@BillCarsonFr BillCarsonFr added T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems and removed T-Task Refactoring, enabling or disabling functionality, other engineering tasks labels Apr 11, 2024
@BillCarsonFr BillCarsonFr marked this pull request as ready for review April 11, 2024 15:07
@BillCarsonFr BillCarsonFr requested review from a team as code owners April 11, 2024 15:08
Copy link
Contributor

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a couple of minor points. I hope other reviewers will be able to comment on whether the expected responses from the server are correct - I don't know.

src/rust-crypto/libolm_migration.ts Show resolved Hide resolved
src/rust-crypto/libolm_migration.ts Show resolved Hide resolved
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks sensible to me but a few comments

@BillCarsonFr BillCarsonFr added this pull request to the merge queue Apr 15, 2024
Merged via the queue into develop with commit 8438533 Apr 15, 2024
24 checks passed
@BillCarsonFr BillCarsonFr deleted the valere/element-r/validate_backup_key_before_migrating branch April 15, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ElementR | Missing validation when migrating the cached backup decryption key from legacy to rust
3 participants