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-server/ipa-gui/ipagui/subcontrollers/user.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ipa-server/ipa-gui/ipagui/subcontrollers/user.py') diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py index 734d867f..d8fabb6b 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py @@ -744,8 +744,7 @@ class UserController(IPAController): password = "" generator = random.SystemRandom() for char in range(8): - index = generator.randint(0, len(password_chars) - 1) - password += password_chars[index] + password += generator.choice(password_chars) return password -- cgit