Skip to content
Snippets Groups Projects
Commit 2f7df511 authored by jkerdreu's avatar jkerdreu
Browse files

Switch from pycryto to cryptodomex (pycrypto doesn't work w/ Py3.10)

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2742 b32b6428-25c9-4566-ad07-03861ab6144f
parent 23e27beb
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,6 @@ setup(
install_requires=[
'xaal.lib',
'gevent',
'pycrypto',
'pycryptodomex',
]
)
......@@ -6,7 +6,7 @@ import logging
import socket
import binascii
from Crypto.Cipher import AES
from Cryptodome.Cipher import AES
GW_PORT = 9898
AQARA_ENCRYPT_IV = b'\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e'
......@@ -279,7 +279,7 @@ class Gateway(AqaraDev):
@secret.setter
def secret(self,value):
logger.debug('Seting GW secret to %s' % value)
self._secret = value
self._secret = value.encode('utf-8')
def make_key(self):
cipher = AES.new(self.secret, AES.MODE_CBC, IV=AQARA_ENCRYPT_IV)
......@@ -445,7 +445,7 @@ class Gateway(AqaraDev):
# extract the token before normal parsing
token = pkt.get('token',None)
if token:
self.token = token
self.token = token.encode('utf8')
AqaraDev.parse(self,pkt)
def on_heartbeat(self,data):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment