From 0946f2a3b0a425180b61fceda0d763b55baf9949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 21 Jun 2021 14:49:14 +0200 Subject: [PATCH] Add a patch to fix the parameter type of YESCRYPT_salt_cost() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Esser --- ....1-fix_YESCRYPT_salt_cost_param_type.patch | 39 +++++++++++++++++++ shadow-utils.spec | 4 ++ 2 files changed, 43 insertions(+) create mode 100644 shadow-4.8.1-fix_YESCRYPT_salt_cost_param_type.patch diff --git a/shadow-4.8.1-fix_YESCRYPT_salt_cost_param_type.patch b/shadow-4.8.1-fix_YESCRYPT_salt_cost_param_type.patch new file mode 100644 index 0000000..a3aadd2 --- /dev/null +++ b/shadow-4.8.1-fix_YESCRYPT_salt_cost_param_type.patch @@ -0,0 +1,39 @@ +From 8d987bc55ccb65a3ef3a541cc5e351cfcbef0c90 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Sat, 12 Jun 2021 19:05:07 +0200 +Subject: [PATCH] libmisc/salt.c: Use int pointer for YESCRYPT_salt_cost(). +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The corresponding functions for the other hash methods all take +a pointer to an integer value as the only paramater, so this +particular function should do so as well. + +Signed-off-by: Björn Esser +--- + libmisc/salt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmisc/salt.c b/libmisc/salt.c +index c35c6797..1bfa015b 100644 +--- a/libmisc/salt.c ++++ b/libmisc/salt.c +@@ -34,7 +34,7 @@ static /*@observer@*/const char *BCRYPT_salt_rounds (/*@null@*/int *prefered_rou + #endif /* USE_BCRYPT */ + #ifdef USE_YESCRYPT + static /*@observer@*/const char *gensalt_yescrypt (void); +-static /*@observer@*/const char *YESCRYPT_salt_cost (/*@null@*/long *prefered_rounds); ++static /*@observer@*/const char *YESCRYPT_salt_cost (/*@null@*/int *prefered_cost); + #endif /* USE_YESCRYPT */ + + #ifndef HAVE_L64A +@@ -277,7 +277,7 @@ static /*@observer@*/const char *gensalt_bcrypt (void) + /* + * Return a salt prefix specifying the cost for the YESCRYPT method. + */ +-static /*@observer@*/const char *YESCRYPT_salt_cost (/*@null@*/long *prefered_cost) ++static /*@observer@*/const char *YESCRYPT_salt_cost (/*@null@*/int *prefered_cost) + { + static char cost_prefix[5]; + long cost; diff --git a/shadow-utils.spec b/shadow-utils.spec index 5511d03..0f8a51e 100644 --- a/shadow-utils.spec +++ b/shadow-utils.spec @@ -97,6 +97,8 @@ Patch56: shadow-4.8.1-man_clarify_subid_delegation.patch Patch57: shadow-4.8.1-libsubid_make_logfd_not_extern.patch # https://github.com/shadow-maint/shadow/commit/5cd04d03f94622c12220d4a6352824af081b8531 Patch58: shadow-4.8.1-yescrypt-support.patch +# https://github.com/shadow-maint/shadow/pull/358 +Patch59: shadow-4.8.1-fix_YESCRYPT_salt_cost_param_type.patch License: BSD and GPLv2+ BuildRequires: make @@ -180,6 +182,7 @@ Development files for shadow-utils-subid. %patch56 -p1 -b .man_clarify_subid_delegation %patch57 -p1 -b .libsubid_make_logfd_not_extern %patch58 -p1 -b .yescrypt +%patch59 -p1 -b .YESCRYPT_salt_cost_param_type iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8 cp -f doc/HOWTO.utf8 doc/HOWTO @@ -351,6 +354,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.la %changelog * Mon Jun 21 2021 Björn Esser - 2:4.8.1-12 - Backport support for yescrypt hash method +- Add a patch to fix the parameter type of YESCRYPT_salt_cost() * Mon Jun 21 2021 Iker Pedrosa - 2:4.8.1-11 - libsubid: don't print error messages on stderr by default