- dknewkey: On posix operating systems set file permissions to 600 for ed25519 private key files (as is already done for RSA) (LP: #1857827)

This commit is contained in:
Scott Kitterman
2019-12-31 01:17:19 -05:00
parent 73dbcc08a8
commit dc2f7f07f2
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -1,4 +1,6 @@
Verstion 1.1 2019-12-31 Version 1.0.2
- dknewkey: On posix operating systems set file permissions to 600 for
ed25519 private key files (as is already done for RSA) (LP: #1857827)
- Update documentation URL in README.md - Update documentation URL in README.md
- Set minimum dnspython version to 1.16 because previous versions can not - Set minimum dnspython version to 1.16 because previous versions can not
support the timeout parameter (LP: #1856546) support the timeout parameter (LP: #1856546)
+2
View File
@@ -63,6 +63,8 @@ def GenEd25519Keys(private_key_file):
priv_key = skg.generate() priv_key = skg.generate()
with open(private_key_file, 'w') as pkf: with open(private_key_file, 'w') as pkf:
pkf.write(priv_key.encode(encoder=nacl.encoding.Base64Encoder).decode("utf-8")) pkf.write(priv_key.encode(encoder=nacl.encoding.Base64Encoder).decode("utf-8"))
if os.name == 'posix':
os.chmod(private_key_file, 0o600)
return(priv_key) return(priv_key)
def ExtractRSADnsPublicKey(private_key_file, dns_file): def ExtractRSADnsPublicKey(private_key_file, dns_file):