From 599fe1a0f5c046da6f99448ac43599b2681069d5 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 7 Aug 2008 09:21:32 -0400 Subject: Use larger set from which to choose chars for random passwords. Use SystemRandom() instead of Random() so that the randomicity is non-deterministic. --- ipa-python/ipautil.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ipa-python/ipautil.py') diff --git a/ipa-python/ipautil.py b/ipa-python/ipautil.py index f3018ed09..117171c4c 100644 --- a/ipa-python/ipautil.py +++ b/ipa-python/ipautil.py @@ -365,10 +365,9 @@ def parse_generalized_time(timestr): def ipa_generate_password(): rndpwd = '' - r = random.Random() + r = random.SystemRandom() for x in range(12): -# rndpwd += chr(r.randint(32,126)) - rndpwd += chr(r.randint(65,90)) #stricter set for testing + rndpwd += chr(r.randint(32,126)) return rndpwd -- cgit