From 3521392d0ad75b411f0045b16a657d60366df26b Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 15 2020 18:05:51 +0000 Subject: Apply patch ci-utils-use-SystemRandom-when-generating-random-passwo.patch patch_name: ci-utils-use-SystemRandom-when-generating-random-passwo.patch present_in_specfile: true location_in_specfile: 9 --- diff --git a/cloudinit/util.py b/cloudinit/util.py index 9d9d5c7..5d51ba8 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -401,9 +401,10 @@ def translate_bool(val, addons=None): def rand_str(strlen=32, select_from=None): + r = random.SystemRandom() if not select_from: select_from = string.ascii_letters + string.digits - return "".join([random.choice(select_from) for _x in range(0, strlen)]) + return "".join([r.choice(select_from) for _x in range(0, strlen)]) def rand_dict_key(dictionary, postfix=None):