Kaydet (Commit) 7f7b941f authored tarafından Victor Stinner's avatar Victor Stinner

Issue #18405: Improve the entropy of crypt.mksalt().

üst 4bfa6c54
...@@ -28,7 +28,7 @@ def mksalt(method=None): ...@@ -28,7 +28,7 @@ def mksalt(method=None):
if method is None: if method is None:
method = methods[0] method = methods[0]
s = '${}$'.format(method.ident) if method.ident else '' 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 return s
......
...@@ -66,6 +66,8 @@ Core and Builtins ...@@ -66,6 +66,8 @@ Core and Builtins
Library Library
------- -------
- Issue #18405: Improve the entropy of crypt.mksalt().
- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get - Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
docstrings and ValueError messages. Patch by Zhongyue Luo docstrings and ValueError messages. Patch by Zhongyue Luo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment