-
Notifications
You must be signed in to change notification settings - Fork 356
Bugfix - sign_cryptography.CryptographySigner - keyfile opened as text (breaks on Python 3) #172
base: master
Are you sure you want to change the base?
Conversation
Resync with original repository
Fixed an issue where files were being opened in "read text" mode, instead of "read binary" mode. This cause Python 3 systems to read a str instead of bytes, which breaks the execution pretty quickly.
The signer still doesn't work. I have these changes in
|
That's odd. I have tested ConnectDevice on multiple machines using |
I haven't investigated why the test fails, but here's the Travis CI output from this draft pull request:
|
Alright, I'm not really crypto-savvy, but I looked a bit into it. So, I went and debugged But why does it fail when it's not the right size? Notice how you intantiate the signer object, with My conclusion is that there is no bug in |
Thanks for investigating this! I fixed my unit test: |
This should fix an issue caused by the
CryptographySigner
initializer method,which opens the RSA public/private key files for reading in "text mode" instead of "binary mode".
Python 2.x does work with this, but on Python 3 this breaks pretty quickly.