summaryrefslogtreecommitdiffstats
path: root/ipa-server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-08-07 09:21:32 -0400
committerSimo Sorce <ssorce@redhat.com>2008-08-11 18:30:40 -0400
commit599fe1a0f5c046da6f99448ac43599b2681069d5 (patch)
treec94fdad3fe848ad77b01401940e43410340c0a52 /ipa-server
parent1b613fafa6f6e52bc888fcccdd25c7f607967959 (diff)
downloadfreeipa-599fe1a0f5c046da6f99448ac43599b2681069d5.tar.gz
freeipa-599fe1a0f5c046da6f99448ac43599b2681069d5.tar.xz
freeipa-599fe1a0f5c046da6f99448ac43599b2681069d5.zip
Use larger set from which to choose chars for random passwords.
Use SystemRandom() instead of Random() so that the randomicity is non-deterministic.
Diffstat (limited to 'ipa-server')
-rw-r--r--ipa-server/ipa-gui/ipagui/subcontrollers/user.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/user.py b/ipa-server/ipa-gui/ipagui/subcontrollers/user.py
index 734d867fb..d8fabb6b5 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