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

Payload support #1

Merged
merged 63 commits into from
Apr 28, 2016
Merged

Payload support #1

merged 63 commits into from
Apr 28, 2016

Conversation

Minishlink
Copy link
Member

  • (done) use phpecc/phpecc in order to generate the encryption key in prime256v1
  • when this PHP bug is fixed, replace phpecc by the PHP binding of OpenSSL (thanks @marco-c)
  • use OpenSSL with AES 128 GCM mode to encrypt the payload (need to wait for the resolution of this other PHP bug.)

If you want to help: (thanks!)

  • vote for the PHP bugs in the above linked pages
  • or contribute to php/php-src in order to fix the bugs

@Minishlink Minishlink added this to the 0.3.0 milestone Dec 3, 2015
@marco-c
Copy link
Member

marco-c commented Jan 26, 2016

Hey Minishlink, IIRC phpecc has known vulnerabilities.
Directly using OpenSSL would probably be better, since you have to wait for https://bugs.php.net/bug.php?id=67304, you could wait for https://bugs.php.net/bug.php?id=61204 as well (hoping that they will be resolved soon enough).

@Minishlink
Copy link
Member Author

Thanks for the info! :) It surely is worth waiting, I'll look into it.

@FallDi
Copy link

FallDi commented Feb 13, 2016

Hola. Is payload encryption works for firefox? I try run project it generated salt & publicKey, but payload not received by browser. This sample is works fine https://jrconlin.github.io/WebPushDataTestPage/, but in this sample shared key & encryption key length is less than in you code

@Minishlink
Copy link
Member Author

Hi, payload is not yet supported because PHP doesn't provide enough access to OpenSSL yet. This will likely be the case with PHP 7.1.

This PR is here to implement the changes made to resolve the aforementioned bugs. Its development is paused since the bug fixes are not yet merged in any PHP version, beta or not.

As explained in the README, a workaround is to store the payload in your server, to send notifications without payload, and to make the client fetch the corresponding payload stored in the server, using the endpoint as identification.

But, if you really need "real" payload support, you will have to drop PHP for Node.js. Note that payload won't be delivered in Chrome (though it may have changed since the last time I checked).

@marco-c
Copy link
Member

marco-c commented Mar 2, 2016

@Minishlink have you seen https://github.com/Spomky-Labs/jose/blob/master/src/Util/GCM.php? It was suggested in https://bugs.php.net/bug.php?id=67304.
OpenSSL is probably better security-wise, but at least that should make it possible to support push payloads in the meantime.

@Minishlink
Copy link
Member Author

@marco-c Yep, I'll probably look into it this weekend. :) Thanks for the notification btw.

@marco-c
Copy link
Member

marco-c commented Mar 22, 2016

The output is the same as my library.
The only difference I can see is that I'm using the normal GCM endpoint (not the experimental Web Push one) with the raw_data parameter.

@gauntface
Copy link

I'll have a look into what is needed to support normal GCM endpoint (in hindsight - it wasn't helpful using the other endpoint - apologies for not thinking it through)

@Minishlink
Copy link
Member Author

Thanks. If I'm not mistaken, the temporary server has been updated as I can see that the aforementioned behavior now works well. :)

@Minishlink Minishlink merged commit 96bf635 into master Apr 28, 2016
@Minishlink Minishlink deleted the payload branch April 28, 2016 14:47
Minishlink added a commit that referenced this pull request Oct 6, 2016
t1gor added a commit to t1gor/web-push-php that referenced this pull request Sep 6, 2018
t1gor added a commit to t1gor/web-push-php that referenced this pull request Nov 26, 2018
Minishlink pushed a commit that referenced this pull request Nov 27, 2018
* WIP: initial concept of returning report objects

* WIP: add a test

* Docs update

Change results handling example

* Attempt to fix tests #1

* Change flush() signature for easier mocking

* Unqualify iterable

* Remove ignored vagrant file
@ghnp5 ghnp5 mentioned this pull request Dec 10, 2019
5 tasks
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