summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/crypt.py2
-rw-r--r--Misc/NEWS2
2 files changed, 3 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
diff --git a/Misc/NEWS b/Misc/NEWS
index 2c7938b..e1af655 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -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