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

Encrypted db #2244

Merged
merged 4 commits into from
Jan 19, 2024
Merged

Encrypted db #2244

merged 4 commits into from
Jan 19, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jan 17, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Ensure the application is providing a passphrase, for the SDK to encrypt the stored data.
The passphrase is stored in the SessionData, so that a Session created by Element Android can be restored (still need to create a PR on Element Android to store the passphrase to the correct location)

Enabled on Debug and Nightly builds for now.

  • Existing sessions will have a null passphrase and will continue to work.
  • New session will use a passphrase, only on Nightly and Debug build for now.

Motivation and context

Closes #2219
Part of #86

Screenshots / GIFs

Tests

  • Upgrade an existing installation and see that the session can still be used
  • If you log out and log in again, using the nightly version, or the debug version, a non-null passphrase will be used. And the app can be restarted without any issue.
  • In release mode, no passphrase is used.

To check if the database is encrypted, you need access to the file storage of the device.
Database are stored at:

/data/user/0/io.element.android.x.debug/files/sessions/userId

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty requested a review from a team as a code owner January 17, 2024 13:51
@bmarty bmarty requested review from ganfra and removed request for a team January 17, 2024 13:51
Copy link
Contributor

github-actions bot commented Jan 17, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/VtzGu5

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (54f3f8d) 69.95% compared to head (877ed3c) 69.99%.
Report is 7 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2244      +/-   ##
===========================================
+ Coverage    69.95%   69.99%   +0.04%     
===========================================
  Files         1335     1335              
  Lines        32656    32643      -13     
  Branches      6791     6789       -2     
===========================================
+ Hits         22844    22848       +4     
+ Misses        6535     6518      -17     
  Partials      3277     3277              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

The passphrase is stored in the SessionData, so that a Session created by Element Android can be restored.
Existing sessions will have a null passphrase and will continue to work.
New session will use a passphrase, only on Nightly and Debug build for now.
Copy link

sonarcloud bot commented Jan 18, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 18, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 18, 2024
@bmarty bmarty added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 18, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Jan 18, 2024
Copy link
Contributor

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@bmarty bmarty merged commit b4773d5 into develop Jan 19, 2024
19 of 20 checks passed
@bmarty bmarty deleted the feature/bma/encryptedDb2 branch January 19, 2024 16:40
@bmarty bmarty mentioned this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Encrypt local databases
2 participants