mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Issue #25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
supported. Check if it is supported, it may not be supported on OpenBSD for example.
This commit is contained in:
parent
4b5d8018df
commit
6661d885a3
3 changed files with 6 additions and 3 deletions
|
@ -64,7 +64,7 @@ Module Attributes
|
||||||
|
|
||||||
A list of available password hashing algorithms, as
|
A list of available password hashing algorithms, as
|
||||||
``crypt.METHOD_*`` objects. This list is sorted from strongest to
|
``crypt.METHOD_*`` objects. This list is sorted from strongest to
|
||||||
weakest, and is guaranteed to have at least ``crypt.METHOD_CRYPT``.
|
weakest.
|
||||||
|
|
||||||
|
|
||||||
Module Functions
|
Module Functions
|
||||||
|
|
|
@ -54,9 +54,8 @@ METHOD_SHA256 = _Method('SHA256', '5', 16, 63)
|
||||||
METHOD_SHA512 = _Method('SHA512', '6', 16, 106)
|
METHOD_SHA512 = _Method('SHA512', '6', 16, 106)
|
||||||
|
|
||||||
methods = []
|
methods = []
|
||||||
for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5):
|
for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5, METHOD_CRYPT):
|
||||||
_result = crypt('', _method)
|
_result = crypt('', _method)
|
||||||
if _result and len(_result) == _method.total_size:
|
if _result and len(_result) == _method.total_size:
|
||||||
methods.append(_method)
|
methods.append(_method)
|
||||||
methods.append(METHOD_CRYPT)
|
|
||||||
del _result, _method
|
del _result, _method
|
||||||
|
|
|
@ -40,6 +40,10 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
|
||||||
|
supported. Check if it is supported, it may not be supported on OpenBSD for
|
||||||
|
example.
|
||||||
|
|
||||||
- Issue #23600: Default implementation of tzinfo.fromutc() was returning
|
- Issue #23600: Default implementation of tzinfo.fromutc() was returning
|
||||||
wrong results in some cases.
|
wrong results in some cases.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue