diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-14 01:40:46 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-14 01:40:46 +0200 |
commit | fc8a0a7b82e9cb9434269bf64bd018882098d88c (patch) | |
tree | 30898977bd50e27752fc7b516c1a127c0276b2e2 | |
parent | 97869103ba09fb6a468312d303193902ff13160a (diff) | |
parent | 7f7b941fdcdfe28f3cd37e84bc5d7a298385b451 (diff) | |
download | cpython-git-fc8a0a7b82e9cb9434269bf64bd018882098d88c.tar.gz |
(Merge 3.3) Issue #18405: Improve the entropy of crypt.mksalt().
-rw-r--r-- | Lib/crypt.py | 2 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/crypt.py b/Lib/crypt.py index b90c81cc40..49ab96e140 100644 --- a/Lib/crypt.py +++ b/Lib/crypt.py @@ -28,7 +28,7 @@ def mksalt(method=None): if method is None: method = methods[0] s = '${}$'.format(method.ident) if method.ident else '' - s += ''.join(_sr.sample(_saltchars, method.salt_chars)) + s += ''.join(_sr.choice(_saltchars) for char in range(method.salt_chars)) return s @@ -28,6 +28,8 @@ Core and Builtins Library ------- +- Issue #18405: Improve the entropy of crypt.mksalt(). + - Issue #12015: The tempfile module now uses a suffix of 8 random characters instead of 6, to reduce the risk of filename collision. The entropy was reduced when uppercase letters were removed from the charset used to generate |