Skip to content

Commit

Permalink
Quickfix unexpected encrypted PEM format
Browse files Browse the repository at this point in the history
This quickfix changes the PEM format from PKSC8 to
PKSC5 (TraditionalOpenSSL) in pyca_crypto's variant of
`create_rsa_encrypted_pem`.
PKSC5 has the PEM headers expected by other PEM parsing functions,
e.g. `is_pem_private` and `extract_pem`.

See secure-systems-lab#54 for more details
  • Loading branch information
lukpueh committed Sep 15, 2017
1 parent a0aa625 commit 6ebcb3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion securesystemslib/pyca_crypto_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def create_rsa_encrypted_pem(private_key, passphrase):

encrypted_pem = \
private_key.private_bytes(encoding=serialization.Encoding.PEM,
format=serialization.PrivateFormat.PKCS8,
format=serialization.PrivateFormat.TraditionalOpenSSL,
encryption_algorithm=serialization.BestAvailableEncryption(passphrase.encode('utf-8')))

return encrypted_pem.decode()
Expand Down

0 comments on commit 6ebcb3d

Please sign in to comment.