banksy-git / lidl-gateway-freedom

Freeing the Silvercrest (Lidl/Tuya) Smart Home Gateway from the cloud.
https://paulbanks.org/projects/lidl-zigbee/
GNU General Public License v3.0
211 stars 66 forks source link

Use cryptography lib to be compatible with python-3.10 #23

Closed davidcampelo closed 2 years ago

davidcampelo commented 2 years ago

From version 3.10 on, python module(s) that use the # variant when parsing arguments need to have a #define PY_SSIZE_T_CLEAN before including Python.h. This is not done in pycrypto library and unfortunately this library is archived.

This patch fixes a SystemError when creating the AES cipher instance in the decode script by switching to cryptography library, a more popular and active python library than pycrypto.

banksy-git commented 2 years ago

Thanks for the patch!