Skip to content

Commit 2b7e504

Browse files
authored
Merge pull request #48 from sklemer1/hack-fix-privkey-leak
Quick, hacky fix for #47 "Private Key might leak"
2 parents 2a34bca + 23f99b6 commit 2b7e504

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/xmlsec/crypto.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,13 @@ def __init__(self, filename, private):
130130
if not isinstance(self.key, rsa.RSAPrivateKey):
131131
raise XMLSigException("We don't support non-RSA private keys at the moment.")
132132

133-
# XXX now we could implement encrypted-PEM-support
134-
self.cert_pem = self.key.private_bytes(
135-
encoding=serialization.Encoding.PEM,
136-
format=serialization.PrivateFormat.PKCS8,
137-
encryption_algorithm=serialization.NoEncryption())
133+
# XXX Do not leak private key -- is there any situation
134+
# where we might need this pem?
135+
self.cert_pem = None
136+
# self.cert_pem = self.key.private_bytes(
137+
# encoding=serialization.Encoding.PEM,
138+
# format=serialization.PrivateFormat.PKCS8,
139+
# encryption_algorithm=serialization.NoEncryption())
138140

139141
self.keysize = self.key.key_size
140142
else:

0 commit comments

Comments
 (0)