summaryrefslogtreecommitdiffstats
path: root/Lib/crypt.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-13 23:39:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-13 23:39:14 (GMT)
commit7f7b941fdcdfe28f3cd37e84bc5d7a298385b451 (patch)
treec054580a869424e5b2b5df47f576f1929401db8a /Lib/crypt.py
parent4bfa6c54ca0d8d51be01ce45436a7f26b9926018 (diff)
downloadcpython-7f7b941fdcdfe28f3cd37e84bc5d7a298385b451.zip
cpython-7f7b941fdcdfe28f3cd37e84bc5d7a298385b451.tar.gz
cpython-7f7b941fdcdfe28f3cd37e84bc5d7a298385b451.tar.bz2
Issue #18405: Improve the entropy of crypt.mksalt().
Diffstat (limited to 'Lib/crypt.py')
-rw-r--r--Lib/crypt.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/crypt.py b/Lib/crypt.py
index b90c81c..49ab96e 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