web-push-php icon indicating copy to clipboard operation
web-push-php copied to clipboard

Uncaught RuntimeException thrown when the publicKey(p256dh) has - at the end. e.g BGzoP5QD6aKTKGhmQ9pwIl0pLYNdxMHP3MmWaukujsXtweN9BQuIPVihjpf-

Open leonnduati opened this issue 6 years ago • 2 comments

When the p256dh key has a dash(-) at the end, the library throws an error. An example p256dh: BGzoP5QD6aKTKGhmQ9pwIl0pLYNdxMHP3MmWaukujsXtweN9BQuIPVihjpf-

The library works for all other p256dh keys.

leonnduati avatar Jan 25 '19 11:01 leonnduati

The detailed error is: Fatal error: Uncaught RuntimeException: Curve curve(115792089210356248762697446949407573530086143415290314195533631308867097853948, 41058363725152142129326129780047268409114441015993725554835256314039467401291, 115792089210356248762697446949407573530086143415290314195533631308867097853951) does not contain point (40747028616055263392251367296946612409732463385756865, 77770575987221971440859916007439511959237697213470718) in /home/spordzvf/public_html/push/vendor/web-token/jwt-util-ecc/Curve.php:82 Stack trace: #0 /home/spordzvf/public_html/push/vendor/web-token/jwt-util-ecc/Curve.php(101): Jose\Component\Core\Util\Ecc\Curve->getPoint(Object(GMP), Object(GMP)) #1 /home/spordzvf/public_html/push/vendor/minishlink/web-push/src/Encryption.php(95): Jose\Component\Core\Util\Ecc\Curve->getPublicKeyFrom(Object(GMP), Object(GMP)) #2 /home/spordzvf/public_html/push/vendor/minishlink/web-push/src/Encryption.php(65): Minishlink\WebPush\Encryption::deterministicEncrypt('\v\xA2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...', ' in /home/spordzvf/public_html/push/vendor/web-token/jwt-util-ecc/Curve.php on line 82

leonnduati avatar Jan 25 '19 11:01 leonnduati

Do you have some example of subscription+vapid?

Minishlink avatar Feb 23 '19 15:02 Minishlink