Open BetterAutomations opened 3 years ago
Please include the following information when submitting a bug report:
The Pycom board you are using: WiPy 2.0
The firmware version you are using.
(sysname='WiPy', nodename='WiPy', release='1.20.0.rc13', version='94bb382c9 on 2021-05-06', machine='WiPy with ESP32')
Exact steps to cause this issue
pk = open('cert/WiPy2-pk8.key').read() import ucrypto ucrypto.generate_rsa_signature("Hello world", pk)
What you expected I expected a signed string
What happened instead Instead, I got the following:
Traceback (most recent call last): (..) ValueError: Invalid Private Key, error code: -4480
I then did some testing on various firmware. The ucrypto.generate_rsa_signature() function is failing on firmware greater than 1.20.0.rc13.
When I tried on that firmware, I see the correct output:
>>> pk = open('cert/WiPy2-pk8.key').read() >>> import ucrypto >>> ucrypto.generate_rsa_signature("Hello world", pk) b'\x04\xac\xa6\xedo\xca\xc6\x88\xc9\x14h\xbd}\x10\x8dD%\x96E\xf6A.Y> \xf3\x18\x83\x99\x1c\xa4(..)\x05\x80\x04\x04|' >>>
I did a diff and found that esp32/mods/moducrypto.c had indeed been changed in newer versions, specifically having to do with mod_pycom_generate_rsa_signature. But I don't know enough C to tell you why what had changed is having this effect.
Here is some forum discussion I've had on it: https://forum.pycom.io/topic/7022/mqtt-with-ssl-gives-error-oserror-4480?_=1620323774849
Thank you!
Please include the following information when submitting a bug report:
The Pycom board you are using: WiPy 2.0
The firmware version you are using.
Exact steps to cause this issue
What you expected I expected a signed string
What happened instead Instead, I got the following:
I then did some testing on various firmware. The ucrypto.generate_rsa_signature() function is failing on firmware greater than 1.20.0.rc13.
When I tried on that firmware, I see the correct output:
I did a diff and found that esp32/mods/moducrypto.c had indeed been changed in newer versions, specifically having to do with mod_pycom_generate_rsa_signature. But I don't know enough C to tell you why what had changed is having this effect.
Here is some forum discussion I've had on it: https://forum.pycom.io/topic/7022/mqtt-with-ssl-gives-error-oserror-4480?_=1620323774849
Thank you!