wbond / oscrypto

Compiler-free Python crypto library backed by the OS, supporting CPython and PyPy
MIT License
320 stars 70 forks source link

Fix encoding of unencrypted private keys. #8

Closed psagers closed 8 years ago

psagers commented 8 years ago

An indentation error in asymmetric.dump_private_key() causes PEM encoding to be skipped when there's no password.

wbond commented 8 years ago

To handle Python 2 and 3 you can add:

from asn1crypto import pem

and then check the result with:

self.assertTrue(pem.detect(pem_serialized))
wbond commented 8 years ago

Also, thanks for the fix!

psagers commented 8 years ago

That does sound like a better test. I would run tox if it were set up.

wbond commented 8 years ago

This is included in version 0.14.2, FYI