File: 01-use-pycryptodomex-package.patch

package info (click to toggle)
python-pyaarlo 0.8.0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 556 kB
  • sloc: python: 6,064; makefile: 6; sh: 1
file content (57 lines) | stat: -rw-r--r-- 1,531 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Description: Debian uses "pycryptodomex" instead of "pycryptodome"
 The modules of the packages use different names
Author: Carles Pina i Estany <carles@pina.cat>
Origin: Debian
Forwarded: not-needed
Last-Update: 2023-12-11
--- a/pyaarlo/main.py
+++ b/pyaarlo/main.py
@@ -113,10 +113,10 @@ def _casecmp(s1, s2):
 
 
 def encrypt_to_string(obj):
-    from Crypto.Cipher import AES
-    from Crypto.Random import get_random_bytes
-    from Crypto.PublicKey import RSA
-    from Crypto.Cipher import PKCS1_OAEP
+    from Cryptodome.Cipher import AES
+    from Cryptodome.Random import get_random_bytes
+    from Cryptodome.PublicKey import RSA
+    from Cryptodome.Cipher import PKCS1_OAEP
 
     try:
         # pickle and resize object
@@ -148,9 +148,9 @@ def encrypt_to_string(obj):
 
 
 def decrypt_from_string(key_obj):
-    from Crypto.Cipher import AES
-    from Crypto.PublicKey import RSA
-    from Crypto.Cipher import PKCS1_OAEP
+    from Cryptodome.Cipher import AES
+    from Cryptodome.PublicKey import RSA
+    from Cryptodome.Cipher import PKCS1_OAEP
 
     try:
         # decode key/object dictionary then unpickle it
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
 requests
 click
-pycryptodome
+pycryptodomex
 unidecode
 cloudscraper>=1.2.71
 paho-mqtt
--- a/setup.py
+++ b/setup.py
@@ -18,7 +18,7 @@ setup(
     install_requires=[
         'requests',
         'click',
-        'pycryptodome',
+        'pycryptodomex',
         'unidecode',
         'cloudscraper>=1.2.71',
         'paho-mqtt',