google / python-adb

Python ADB + Fastboot implementation
Apache License 2.0
1.79k stars 357 forks source link

Fix load pem private key with the PEM encoded data #162

Open g1im2 opened 5 years ago

g1im2 commented 5 years ago

fix problem like this issues "https://github.com/pyca/cryptography/issues/2730", and it also happened in here.

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 43.623% when pulling f1c3d2415128215458ad9e8ff2ff443d02965b81 on g1im2:master into 0e507956dce7eca2e1e2fee066e9aa6a0a393f5a on google:master.

JeffLIrion commented 4 years ago

I created a new package adb-shell (see https://github.com/google/python-adb/issues/167) and incorporated @greateggsgreg's changes into sign_cryptography.py.

However, the CryptographySigner.Sign method raises an exception, and in the test_sign test I'm actually checking that the Sign method is broken. By contrast, the corresponding tests for PycryptodomeAuthSigner.Sign and PythonRSASigner.Sign are identical (aside from the exception catching) and they pass just fine.

If you submit a pull request that fixes this issue, that would be much appreciated!