diff options
author | Simo Sorce <ssorce@redhat.com> | 2008-08-07 09:21:32 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2008-08-11 18:30:40 -0400 |
commit | 599fe1a0f5c046da6f99448ac43599b2681069d5 (patch) | |
tree | c94fdad3fe848ad77b01401940e43410340c0a52 /ipa-python | |
parent | 1b613fafa6f6e52bc888fcccdd25c7f607967959 (diff) | |
download | freeipa-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-python')
-rw-r--r-- | ipa-python/ipautil.py | 5 |
1 files changed, 2 insertions, 3 deletions
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 |