Make pw-token-gen.py more random

This fix utilizes the urandom method in the os mmodule and provides
more randomness in our generation tool.

Closes-bug: 1732295
Change-Id: I060976d243dfc4ddc7fd67aff36f3a888a0a363e
This commit is contained in:
Cameron Loader 2017-11-15 01:21:16 +00:00
parent d78e63a67d
commit e9f957861b

View File

@ -22,7 +22,6 @@ import random
import tarfile
import uuid
from Crypto import Random
try:
import yaml
except ImportError:
@ -69,7 +68,7 @@ class CredentialGenerator(object):
@staticmethod
def _random_bytes():
"""Returns 1024 random bytes of data."""
return Random.get_random_bytes(1024)
return os.urandom(1024)
def _encode_bytes(self):
"""Builds random strings based on random data.