passwd/add-sm3-crypt-support.patch
lujie42 2717ef9340 add sm3 crypt support
(cherry picked from commit 0f9094f1ec39c3761d9b3897ead43a85d1061099)
2022-01-24 10:11:26 +08:00

28 lines
744 B
Diff

From 87c95887b93ffac388b30ea81d41f83782e8cd34 Mon Sep 17 00:00:00 2001
From: lujie42 <lujie42@huawei.com>
Date: Thu, 28 Oct 2021 20:06:53 +0800
Subject: [PATCH] add sm3 crypt support
Signed-off-by: lujie42 <lujie42@huawei.com>
---
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