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

Bug-for bug compatibility with libolm's PkEncryption support #171

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

poljar
Copy link
Collaborator

@poljar poljar commented Aug 15, 2024

A review commit-by-commit is advised, there are a couple of unrelated commits here to make the CI happy.

The meat of the PR is the libolm's PKEncryption support, for more info please take a look at the commit message which adds this functionality. Please note that the commit message assumes that we're going to merge #165.

@poljar poljar force-pushed the poljar/pk-dekurcina branch 2 times, most recently from 6f97915 to c231c72 Compare September 2, 2024 14:15
@poljar poljar changed the title WIP PK decryption support Bug-for bug compatibility with libolm's PkEncryption support Sep 2, 2024
@poljar poljar marked this pull request as ready for review September 2, 2024 14:32
@poljar poljar requested a review from dkasak as a code owner September 2, 2024 14:32
@poljar
Copy link
Collaborator Author

poljar commented Sep 2, 2024

Trying to get our codecov thing going.

@poljar poljar closed this Sep 2, 2024
@poljar poljar reopened this Sep 2, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.35%. Comparing base (4785a08) to head (484317b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #171   +/-   ##
=======================================
  Coverage   90.35%   90.35%           
=======================================
  Files          34       34           
  Lines        1907     1907           
=======================================
  Hits         1723     1723           
  Misses        184      184           

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

src/pk_encryption.rs Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
Copy link
Member

@dkasak dkasak 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 overall, though I reworded a bunch of stuff as usual. Clicking approved so it doesn't require another roundtrip.

src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
src/pk_encryption.rs Outdated Show resolved Hide resolved
This patch introduces support for the libolm PkEncryption/PkDecryption
concepts, ensuring bug-for-bug compatibility with libolm. Notably, the
libolm implementation has a known flaw that leaves ciphertext
unauthenticated, as documented in the Matrix spec [1]. To address this,
the feature is gated behind a feature flag to better inform users of
this issue.

[1]: https://spec.matrix.org/v1.11/client-server-api/#backup-algorithm-mmegolm_backupv1curve25519-aes-sha2

Changelog: Add support for the libolm PkEncryption feature. This allows
Matrix clients to implement the [m.megolm_backup.v1.curve25519-aes-sha2](https://spec.matrix.org/v1.11/client-server-api/#backup-algorithm-mmegolm_backupv1curve25519-aes-sha2)
room key backup algorithm. Please note that this algorithm contains a
critical flaw and should only be used for compatibility reasons.
@poljar poljar merged commit 57cbf7e into main Sep 11, 2024
34 checks passed
@poljar poljar deleted the poljar/pk-dekurcina branch September 11, 2024 09:39
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.

4 participants