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

Draft: feat: Add encrypted push #1242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

famedly-bot
Copy link

In GitLab by @Sorunome on Nov 1, 2021, 16:34

Description

This PR adds push helper methods to setting up pushers and processing push payloads. Additionally, this PR also adds support to encrypted push, dynamically making pushers encrypted, if the server supports encrypted push.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I updated/added relevant documentation (doc comments with ///).
  • I did not add or update methods, functions or widgets without tests.

This adds helper methods to set pushers, making sure that the pushers
are still up-to-date with what you want to set. Additionally, this
detects if the server supports encrypted push and the user does not
opt-out. Furthermore, there are helper methods to process / decrypt
a push payload.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Nov 1, 2021, 16:38

Commented on pubspec.yaml line 21

@nico-famedly adds a note, that this needs to be fixed before getting merged of course.

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Nov 1, 2021, 16:43

Commented on pubspec.yaml line 21

well yeah, the CI also fails because of this, so it'd be hard to miss xP

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Nov 1, 2021, 16:44

Commented on pubspec.yaml line 21

Oh, I guess it should. I didn't think thaaaat far :D

@famedly-bot
Copy link
Author

In GitLab by @krille-chan on Nov 2, 2021, 08:27

Commented on lib/encryption/push_helper.dart line 28

What about we make this an extension on Encryption instead of an own class? Then we just name privateKey and publicKey pushPrivateKey and pushPublicKey.

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Nov 5, 2021, 12:04

added 1 commit

  • d11149cc - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 7, 2021, 17:07

added 1 commit

  • e2075bd4 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 8, 2021, 14:50

Commented on pubspec.yaml line 21

changed this line in version 4 of the diff

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 8, 2021, 14:50

added 120 commits

  • e2075bd4...8f877b20 - 119 commits from branch main
  • 057faf62 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:45

added 3 commits

  • 057faf62...3f225208 - 2 commits from branch main
  • ec080953 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:45

Commented on lib/encryption/push_helper.dart line 28

extensions can't add new variables to the class it extends

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:45

resolved all threads

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:46

marked the checklist item I read the [Contributor Guide] and followed the process outlined there for submitting PRs. as completed

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:46

marked the checklist item I did not add or update methods, functions or widgets without tests. as completed

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:57

marked the checklist item I updated/added relevant documentation (doc comments with ///). as completed

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 9, 2021, 13:57

marked this merge request as ready

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 17, 2021, 13:49

resolved all threads

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 17, 2021, 13:49

added 1 commit

  • b5607da5 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 22, 2021, 21:46

Commented on lib/encryption/push_helper.dart line 40

Might make sense to link to dart-lang/sdk#39510, since this is documented almost nowhere...

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 22, 2021, 22:07

Commented on lib/encryption/push_helper.dart line 27

Can you add a comment to this class, what it does or rename it to EncryptedPushHelper? PushHelper is very generic and it only does crypto, afaik.

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 22, 2021, 22:07

Commented on test/push_helper_test.dart line 1

Did you duplicate this?

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 22, 2021, 22:07

Looks good to me mostly. Although I haven't looked into the crypto thaaaat deply. I can do that, if I have to, but maybe adding some tests comparing it to olm could work too?

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:08

added 1 commit

  • 42a86f88 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:09

Commented on lib/encryption/push_helper.dart line 27

Soru thought the location inside encryption was sufficient here?

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:11

the issue is that we can't easily compare it to libolm due to the mac issue and, when encryption, generating ephemeral keys

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:13

Commented on test/push_helper_test.dart line 1

yup, oops

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:17

added 1 commit

  • 86656fff - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 27, 2021, 12:18

added 5 commits

  • 86656fff...5a72287d - 4 commits from branch main
  • bd7efe92 - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 27, 2021, 15:12

Apart from the mac, the code should be identical though?

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 27, 2021, 15:13

Commented on lib/encryption/push_helper.dart line 27

Hm, I guess. It wasn't as obvious to me, when I saw the class usage in the other class. Because there you don't see, where it is originally declared, but yea, probably fine.

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 29, 2021, 10:09

yeah, but in both cases (libolm and this method) the functions throw errors prior decrypting if the mac does not match, meaning we'd need to fork libolm or this method to be able to test against that

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 29, 2021, 10:25

added 1 commit

  • f4eee0be - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 29, 2021, 18:03

Ah, right, that would cause issues.

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Dec 29, 2021, 18:03

resolved all threads

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 29, 2021, 18:15

resolved all threads

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 29, 2021, 18:15

added 1 commit

  • ce660d8e - feat: Add encrypted push

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 31, 2021, 10:49

resolved all threads

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Dec 31, 2021, 10:49

added 1 commit

Compare with previous version

@famedly-bot
Copy link
Author

In GitLab by @Sorunome on Jan 3, 2022, 09:47

requested review from @krille-chan, @lukaslihotzki, @nico-famedly, @Sorunome, @techno-disaster, @cloudwebrtc, and @TheOneWithTheBraid

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Jan 10, 2022, 07:24

Commented on test/push_helper_test.dart line 1

Looks still duplicated to me :3

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on Jan 10, 2022, 07:25

Commented on test/encryption/push_helper_test.dart line 31

No test/implementation for the count stuff for iOS?

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on May 4, 2022, 11:51

marked this merge request as draft

@famedly-bot
Copy link
Author

In GitLab by @nico-famedly on May 4, 2022, 11:52

Marking as draft as the SCT wants us to change a few things like the encryption algorithm used.

@nico-famedly
Copy link
Member

This depends on us finally fixing the iOS push and then updating the MSC and synapse implementation to match the review comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants