From 2717ef93405f49c20fb28ed70853c3837b4d9aa0 Mon Sep 17 00:00:00 2001 From: lujie42 Date: Thu, 28 Oct 2021 20:12:40 +0800 Subject: [PATCH] add sm3 crypt support (cherry picked from commit 0f9094f1ec39c3761d9b3897ead43a85d1061099) --- add-sm3-crypt-support.patch | 27 +++++++++++++++++++++++++++ passwd.spec | 10 +++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 add-sm3-crypt-support.patch diff --git a/add-sm3-crypt-support.patch b/add-sm3-crypt-support.patch new file mode 100644 index 0000000..c8555d6 --- /dev/null +++ b/add-sm3-crypt-support.patch @@ -0,0 +1,27 @@ +From 87c95887b93ffac388b30ea81d41f83782e8cd34 Mon Sep 17 00:00:00 2001 +From: lujie42 +Date: Thu, 28 Oct 2021 20:06:53 +0800 +Subject: [PATCH] add sm3 crypt support + +Signed-off-by: lujie42 +--- + libuser.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libuser.c b/libuser.c +index 7a36520..f5bedc1 100644 +--- a/libuser.c ++++ b/libuser.c +@@ -298,6 +298,9 @@ pwdb_display_status(const char *username) + } else if (strncmp(current, "$6$", 3) == + 0) { + msg = _("Password set, SHA512 crypt."); ++ } else if (strncmp(current, "$sm3$", 5) == ++ 0) { ++ msg = _("Password set, SM3 crypt."); + } else { + msg = _("Password set, unknown crypt variant."); + } +-- +1.8.3.1 + diff --git a/passwd.spec b/passwd.spec index 409c75b..cec68c4 100644 --- a/passwd.spec +++ b/passwd.spec @@ -1,11 +1,13 @@ Name: passwd Version: 0.80 -Release: 8 +Release: 9 Summary: An implementation of the password setting/changing utility through PAM and libuser libraries License: BSD or GPL+ URL: https://pagure.io/passwd Source0: https://releases.pagure.org/passwd/passwd-%{version}.autotoolized.tar.bz2 +Patch9000: add-sm3-crypt-support.patch + BuildRequires:libselinux-devel >= 2.1.6-3 gcc glib2-devel, libuser-devel, pam-devel, libuser >= 0.53-1 BuildRequires: gettext, popt-devel audit-libs-devel >= 2.4.5 Requires:libselinux >= 2.1.6-3 audit-libs >= 2.4.5 pam >= 1.0.90, /etc/pam.d/system-auth @@ -55,6 +57,12 @@ make check %{_mandir}/man1/*.gz %changelog +* Thu Oct 28 2021 lujie - 0.80-9 +- Type:requirement +- ID:NA +- SUG:NA +- DESC:add sm3 crypt support + * Fri Sep 10 2021 Hugel - 0.80-8 - Type:enhancement - ID:NA