diff --git a/add-the-sm3-method-for-obtaining-the-salt-value.patch b/add-the-sm3-method-for-obtaining-the-salt-value.patch new file mode 100644 index 0000000000000000000000000000000000000000..e267562bcbe613811894fc91f9539b5de67ad372 --- /dev/null +++ b/add-the-sm3-method-for-obtaining-the-salt-value.patch @@ -0,0 +1,34 @@ +From 537c5000a4014c79192c32d3b879c07b32f99893 Mon Sep 17 00:00:00 2001 +From: hanxinke +Date: Tue, 3 Aug 2021 09:34:30 +0800 +Subject: [PATCH] add the sm3 method for obtaining the salt value + +Signed-off-by: hanxinke +--- + Lib/crypt.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/Lib/crypt.py b/Lib/crypt.py +index 33dbc46..3a7cea1 100644 +--- a/Lib/crypt.py ++++ b/Lib/crypt.py +@@ -55,7 +55,7 @@ def mksalt(method=None, *, rounds=None): + if not 4 <= log_rounds <= 31: + raise ValueError('rounds out of the range 2**4 to 2**31') + s += f'{log_rounds:02d}$' +- elif method.ident in ('5', '6'): # SHA-2 ++ elif method.ident in ('5', '6', 'sm3'): # SHA-2 and sm3 + if rounds is not None: + if not 1000 <= rounds <= 999_999_999: + raise ValueError('rounds out of the range 1000 to 999_999_999') +@@ -117,4 +117,7 @@ for _v in 'b', 'y', 'a', '': + _add_method('MD5', '1', 8, 34) + _add_method('CRYPT', None, 2, 13) + ++# support the sm3 method ++_add_method('SM3', 'sm3', 16, 63) ++ + del _v, _add_method +-- +2.23.0 + diff --git a/python3.spec b/python3.spec index 006b7d20d1616144b32d58e8ae8def8be1801fbd..db33623663815d56d4b19b3591972c1ff67a6d53 100644 --- a/python3.spec +++ b/python3.spec @@ -3,7 +3,7 @@ Summary: Interpreter of the Python3 programming language URL: https://www.python.org/ Version: 3.9.9 -Release: 1 +Release: 2 License: Python %global branchversion 3.9 @@ -92,6 +92,8 @@ Patch205: 00205-make-libpl-respect-lib64.patch Patch251: 00251-change-user-install-location.patch Patch6000: backport-Add--with-wheel-pkg-dir-configure-option.patch +Patch9000: add-the-sm3-method-for-obtaining-the-salt-value.patch + Provides: python%{branchversion} = %{version}-%{release} Provides: python(abi) = %{branchversion} Provides: python(abi) = 3.8 @@ -179,6 +181,8 @@ rm -r Modules/expat %patch251 -p1 %patch6000 -p1 +%patch9000 -p1 + rm Lib/ensurepip/_bundled/*.whl rm configure pyconfig.h.in @@ -794,6 +798,12 @@ export BEP_GTDLIST="$BEP_GTDLIST_TMP" %{_mandir}/*/* %changelog +* Fri Jan 14 2022 hanxinke - 3.9.9-2 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:add the sm3 method for obtaining the salt value + * Thu Dec 23 2021 shixuantong - 3.9.9-1 - Type:enhancement - ID:NA