aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon')
-rw-r--r--mastodon/Mastodon.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py
index 2a9833b..a3903df 100644
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -24,6 +24,7 @@ import hashlib
24 24
25IMPL_HAS_CRYPTO = True 25IMPL_HAS_CRYPTO = True
26try: 26try:
27 import cryptography
27 from cryptography.hazmat.backends import default_backend 28 from cryptography.hazmat.backends import default_backend
28 from cryptography.hazmat.primitives.asymmetric import ec 29 from cryptography.hazmat.primitives.asymmetric import ec
29except: 30except:
@@ -2587,7 +2588,10 @@ class Mastodon:
2587 2588
2588 push_key_pair = ec.generate_private_key(ec.SECP256R1(), default_backend()) 2589 push_key_pair = ec.generate_private_key(ec.SECP256R1(), default_backend())
2589 push_key_priv = push_key_pair.private_numbers().private_value 2590 push_key_priv = push_key_pair.private_numbers().private_value
2590 push_key_pub = push_key_pair.public_key().public_numbers().encode_point() 2591 if bigger_version(cryptography.__version__, "2.5.0") == cryptography.__version__:
2592 push_key_pub = push_key_pair.public_key().public_numbers().public_bytes()
2593 else:
2594 push_key_pub = push_key_pair.public_key().public_numbers().encode_point()
2591 push_shared_secret = os.urandom(16) 2595 push_shared_secret = os.urandom(16)
2592 2596
2593 priv_dict = { 2597 priv_dict = {
Powered by cgit v1.2.3 (git 2.41.0)