Closed kueblc closed 3 years ago
Thanks for the detailed report and kind words, @kueblc .
I've never tried with a non-UTF8-compatible psk or identity hint before.
Can you please try with this branch: https://github.com/drbild/sslpsk/tree/use-byte-string-for-identity-hints? It updates the whole library to use byte-strings, instead of unicode strings, for both psks and identity hints.
Hi @drbild, thanks for getting back to me so quickly. I'm having some unrelated computer issues so I haven't been able to test this yet. I will do so ASAP and get back to you then.
I can confirm this resolves the issue for me on Ubuntu 18.04, OpenSSL 1.1.1, Python 3.6.8.
Thank you so much for the quick resolution!
Ping! It'd be great to see a release with this + #11 merged in :)
Fixed by #20
Hi @drbild, great work on this library. I have a script that is running fine with python2 but fails in python3. It seems to have problems when either the hint or identity contain non-unicode sequences.
This fork had intended to fix it, but it doesn't seem to be working with my system. https://github.com/M4dmartig4n/sslpsk/commit/157f063b66a0d5f148860c45de04458eac96935d
When hint is of type
bytes
:Here the identity is non-unicode, position 20 is indeed 0xfc.
For reference, the script being used is part of tuya-convert, which creates a connection with Tuya IoT devices. As a workaround we're forcing python2, but since python2 is being deprecated I'd like to get it working in python3.
Oddly this only seems to impact some users, others have reported that python3 works fine for them. This makes me think it might be a problem with part of the build process in different environments.
Thanks in advance for any insight you might have into this issue.