Description: Remote http_ece dependency
 Method push_subscription_decrypt_push is removed as http_ece, which this
 and only this method depends on, is not available in Debian
Author: Craig Small <csmall@debian.org>
Forwarded: not-needed
Reviewed-by: Craig Small <csmall@debian.org>
Last-Update: 2019-05-31
--- a/mastodon/Mastodon.py
+++ b/mastodon/Mastodon.py
@@ -17,14 +17,14 @@
 import re
 import copy
 import threading
-import sys
+#import sys
 import six
 from decorator import decorate
 from cryptography.hazmat.backends import default_backend
 from cryptography.hazmat.primitives.asymmetric import ec
-import http_ece
+#import http_ece
 import base64
-import json
+#import json
 import blurhash
 
 try:
@@ -505,8 +505,8 @@
         params['client_id'] = self.client_id
         params['client_secret'] = self.client_secret
         
-        if agreement == False:
-            del params_initial['agreement']
+#        if agreement == False:
+#            del params_initial['agreement']
         
         # Step 1: Get a user-free token via oauth
         try:
@@ -2331,22 +2331,26 @@
         
         Returns the decoded webpush as a `push notification dict`_.
         """
-        salt = self.__decode_webpush_b64(encryption_header.split("salt=")[1].strip())
-        dhparams = self.__decode_webpush_b64(crypto_key_header.split("dh=")[1].split(";")[0].strip())
-        p256ecdsa = self.__decode_webpush_b64(crypto_key_header.split("p256ecdsa=")[1].strip())
-        dec_key = ec.derive_private_key(decrypt_params['privkey'], ec.SECP256R1(), default_backend())
-        decrypted = http_ece.decrypt(
-            data,
-            salt = salt,
-            key = p256ecdsa,
-            private_key = dec_key, 
-            dh = dhparams, 
-            auth_secret=decrypt_params['auth'],
-            keylabel = "P-256",
-            version = "aesgcm"
-        )
-        
-        return json.loads(decrypted.decode('utf-8'), object_hook = Mastodon.__json_hooks)
+        """
+        Debian - remove this as http_ece is not in the distribution
+        """
+        raise NotImplementedError('http_ece not in distribution')
+#        salt = self.__decode_webpush_b64(encryption_header.split("salt=")[1].strip())
+#        dhparams = self.__decode_webpush_b64(crypto_key_header.split("dh=")[1].split(";")[0].strip())
+#        p256ecdsa = self.__decode_webpush_b64(crypto_key_header.split("p256ecdsa=")[1].strip())
+#        dec_key = ec.derive_private_key(decrypt_params['privkey'], ec.SECP256R1(), default_backend())
+#        decrypted = http_ece.decrypt(
+#            data,
+#            salt = salt,
+#            key = p256ecdsa,
+#            private_key = dec_key, 
+#            dh = dhparams, 
+#            auth_secret=decrypt_params['auth'],
+#            keylabel = "P-256",
+#            version = "aesgcm"
+#        )
+#        
+#        return json.loads(decrypted.decode('utf-8'), object_hook = Mastodon.__json_hooks)
    
     ###
     # Blurhash utilities
