From e9f957861b4160640f6debb2b939084ec43b43b2 Mon Sep 17 00:00:00 2001 From: Cameron Loader Date: Wed, 15 Nov 2017 01:21:16 +0000 Subject: [PATCH] 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 --- scripts/pw-token-gen.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/pw-token-gen.py b/scripts/pw-token-gen.py index 0e6b3595bb..6638d027ea 100755 --- a/scripts/pw-token-gen.py +++ b/scripts/pw-token-gen.py @@ -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.