Skip to content

Commit

Permalink
Create private/public key with correct mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbockelm committed Feb 9, 2019
1 parent 2db446d commit 766431e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions credmon/utils/utils.py
Expand Up @@ -29,7 +29,7 @@ def atomic_output(file_contents, output_fname, mode=stat.S_IRUSR):
fp.write(file_contents)

# atomically move new tokens in place
atomic_rename(tmp_file_name, output_fname)
atomic_rename(tmp_file_name, output_fname, mode=mode)

finally:
try:
Expand Down Expand Up @@ -70,7 +70,7 @@ def create_credentials():
format=serialization.PrivateFormat.TraditionalOpenSSL,
encryption_algorithm=serialization.NoEncryption()
)
atomic_output(private_pem, private_keyfile)
atomic_output(private_pem, private_keyfile, mode=0o600)

public_pem = public_key.public_bytes(
encoding=serialization.Encoding.PEM,
Expand Down

0 comments on commit 766431e

Please sign in to comment.