web-push-libs / pywebpush

Python Webpush Data encryption library
Mozilla Public License 2.0
305 stars 52 forks source link

encode_point has been deprecated on EllipticCurvePublicNumbers #101

Closed IgorCode closed 5 years ago

IgorCode commented 5 years ago

I'm getting this deprecation warning:

\pywebpush\__init__.py:189: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
  crypto_key = server_key.public_key().public_numbers().encode_point()

Python v3.6.8 Cryptography v2.5

jrconlin commented 5 years ago

So, this is actually a problem with the encrypted-content-encoding library. I've already filed a PR for the issue, but it still needs review. Once it's landed and the package is updated, I'll reflect the new baseline here.

eljoest commented 5 years ago

I've manually applied web-push-libs/vapid#69 and web-push-libs/encrypted-content-encoding@b3fbbd61ea1acdba2fcffa3ece1ee2f38a4f5b4a to a fresh install/virtualenv and there is only one more warning left:

pywebpush/__init__.py:189: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
  crypto_key = server_key.public_key().public_numbers().encode_point()
afzoun commented 5 years ago

Is it fixed yet?

jrconlin commented 5 years ago

Sorry, had to work on the real job for a bit.

Patch is pending review https://github.com/web-push-libs/pywebpush/pull/103

jrconlin commented 5 years ago

1.9.0 has been published https://pypi.org/project/pywebpush/

ghost commented 5 years ago

I'm still getting this issue with a recent install:

# python3 AuthNotif.py
/usr/local/lib/python3.6/dist-packages/py_vapid/__init__.py:292: CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.
  self.public_key.public_numbers().encode_point())
# pip install -U pywebpush
Requirement already up-to-date: pywebpush in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: py-vapid>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from pywebpush)
Requirement already up-to-date: cryptography>=2.6.1 in /usr/local/lib/python2.7/dist-packages (from pywebpush)
Requirement already up-to-date: http-ece>=1.1.0 in /usr/local/lib/python2.7/dist-packages (from pywebpush)
Requirement already up-to-date: requests>=2.21.0 in /usr/local/lib/python2.7/dist-packages (from pywebpush)
Requirement already up-to-date: asn1crypto>=0.21.0 in /usr/lib/python2.7/dist-packages (from cryptography>=2.6.1->pywebpush)
Requirement already up-to-date: enum34; python_version < "3" in /usr/lib/python2.7/dist-packages (from cryptography>=2.6.1->pywebpush)
Requirement already up-to-date: ipaddress; python_version < "3" in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.6.1->pywebpush)
Requirement already up-to-date: cffi!=1.11.3,>=1.8 in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.6.1->pywebpush)
Requirement already up-to-date: six>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography>=2.6.1->pywebpush)
Requirement already up-to-date: urllib3<1.25,>=1.21.1 in /usr/local/lib/python2.7/dist-packages (from requests>=2.21.0->pywebpush)
Requirement already up-to-date: certifi>=2017.4.17 in /usr/local/lib/python2.7/dist-packages (from requests>=2.21.0->pywebpush)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/dist-packages (from requests>=2.21.0->pywebpush)
Requirement already up-to-date: idna<2.9,>=2.5 in /usr/local/lib/python2.7/dist-packages (from requests>=2.21.0->pywebpush)
Requirement already up-to-date: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi!=1.11.3,>=1.8->cryptography>=2.6.1->pywebpush)
jrconlin commented 5 years ago

the py_vapid library was out of date.

ghost commented 5 years ago

Strange! I had to do a pip install -U py-vapid to get 1.5.0 but it's odd that it didn't install 1.5.0 when I installed pywebpush. I'm certain that I installed it after 1.5.0 was released. Oh well, at least it's fixed now. I'm hoping it also solves my other issue.