diff --git a/add-loongarch-support-for-libxcrypt.patch b/add-loongarch-support-for-libxcrypt.patch index 9a7f82223b8ac36f76e9ad60a9463e638cc8ce67..6620e2d128f58e211aacd23770fc07e7f26bd087 100644 --- a/add-loongarch-support-for-libxcrypt.patch +++ b/add-loongarch-support-for-libxcrypt.patch @@ -9,7 +9,7 @@ Subject: [PATCH] add loongarch support for libxcrypt 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libcrypt.map.in b/lib/libcrypt.map.in -index 88ea911..2142757 100644 +index a56b7bf..e9d8fff 100644 --- a/lib/libcrypt.map.in +++ b/lib/libcrypt.map.in @@ -42,6 +42,6 @@ fcrypt - GLIBC_2.0 @@ -18,13 +18,13 @@ index 88ea911..2142757 100644 %chain GLIBC_2.3 GLIBC_2.4 GLIBC_2.12 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 -%chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.35 +%chain GLIBC_2.21 GLIBC_2.27 GLIBC_2.29 GLIBC_2.32 GLIBC_2.33 GLIBC_2.34 GLIBC_2.35 - %chain GLIBC_2.36 + %chain GLIBC_2.36 GLIBC_2.38 %chain OW_CRYPT_1.0 XCRYPT_2.0 XCRYPT_4.3 XCRYPT_4.4 diff --git a/lib/libcrypt.minver b/lib/libcrypt.minver -index 8478077..34cae9d 100644 +index c5a5bf2..68d58cb 100644 --- a/lib/libcrypt.minver +++ b/lib/libcrypt.minver -@@ -62,6 +62,7 @@ ERROR kfreebsd.*gnu . +@@ -63,6 +63,7 @@ ERROR kfreebsd.*gnu . # Linux with GNU libc GLIBC_2.36 linux.*gnu loongarch64 __WORDSIZE == 64 && ULONG_MAX != UINT_MAX /* lp64* ABI */ GLIBC_2.35 linux.*gnu or1k diff --git a/add-sm3-crypt-support.patch b/add-sm3-crypt-support.patch index a1f90f37f2a403114b98c2e007c949f96cc8ed27..a73556f2bd9eee032bc75432f25c9802d805677a 100644 --- a/add-sm3-crypt-support.patch +++ b/add-sm3-crypt-support.patch @@ -1,32 +1,31 @@ -From cd29b303d2590b8377cb2a38539efdf838e8c59c Mon Sep 17 00:00:00 2001 +From e71596d521a17e875864bee8d7c25da71d83ba72 Mon Sep 17 00:00:00 2001 From: houmingyong -Date: Mon, 20 Dec 2021 16:19:09 +0800 +Date: Wed, 1 Jan 2025 00:10:24 +0800 Subject: [PATCH] add sm3 crypt support --- Makefile.am | 7 + - README.md | 4 +- + README | 4 +- doc/crypt.5 | 8 + lib/alg-sm3.c | 419 +++++++++++++++++++++++++++++++++++++++ lib/alg-sm3.h | 62 ++++++ lib/crypt-port.h | 9 +- lib/crypt-sm3.c | 358 +++++++++++++++++++++++++++++++++ lib/hashes.conf | 1 + - libxcrypt.spec.rpkg | 2 +- test/alg-sm3.c | 124 ++++++++++++ test/badsetting.c | 9 + test/checksalt.c | 5 + test/crypt-badargs.c | 4 + test/gensalt-extradata.c | 3 + test/gensalt.c | 38 +++- - 15 files changed, 1048 insertions(+), 5 deletions(-) + 14 files changed, 1047 insertions(+), 4 deletions(-) create mode 100644 lib/alg-sm3.c create mode 100644 lib/alg-sm3.h create mode 100644 lib/crypt-sm3.c create mode 100644 test/alg-sm3.c diff --git a/Makefile.am b/Makefile.am -index c1f91d4..571473f 100644 +index 32e526f..3267cbd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,6 +79,7 @@ noinst_HEADERS = \ @@ -53,7 +52,7 @@ index c1f91d4..571473f 100644 lib/crypt-sha512.c \ lib/crypt-static.c \ lib/crypt-sunmd5.c \ -@@ -362,6 +365,7 @@ check_PROGRAMS = \ +@@ -366,6 +369,7 @@ check_PROGRAMS = \ test/alg-pbkdf-hmac-sha256 \ test/alg-sha1 \ test/alg-sha256 \ @@ -61,7 +60,7 @@ index c1f91d4..571473f 100644 test/alg-sha512 \ test/alg-yescrypt \ test/badsalt \ -@@ -574,6 +578,9 @@ test_crypt_gost_yescrypt_LDADD = \ +@@ -578,6 +582,9 @@ test_crypt_gost_yescrypt_LDADD = \ lib/libcrypt_la-util-xbzero.lo \ lib/libcrypt_la-util-xstrcpy.lo \ $(COMMON_TEST_OBJECTS) @@ -71,16 +70,16 @@ index c1f91d4..571473f 100644 test_explicit_bzero_LDADD = \ lib/libcrypt_la-util-xbzero.lo -diff --git a/README.md b/README.md +diff --git a/README b/README index 45b7f02..8a9abfd 100644 ---- a/README.md -+++ b/README.md +--- a/README ++++ b/README @@ -11,7 +11,7 @@ README for libxcrypt libxcrypt is a modern library for one-way hashing of passwords. It supports a wide variety of both modern and historical hashing methods: -yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, -+yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, sm3crypt ++yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, sm3crypt, md5crypt, SunMD5, sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. It provides the traditional Unix `crypt` and `crypt_r` interfaces, as well as a set of extended interfaces pioneered by Openwall Linux, @@ -94,11 +93,11 @@ index 45b7f02..8a9abfd 100644 option. The stated rationale for the option was to source all cryptographic primitives from a library that has undergone FIPS diff --git a/doc/crypt.5 b/doc/crypt.5 -index 0b81c10..326969e 100644 +index 637741d..8575820 100644 --- a/doc/crypt.5 +++ b/doc/crypt.5 -@@ -218,6 +218,14 @@ Acceptable for new hashes. - The default CPU time cost parameter is 5000, +@@ -227,6 +227,14 @@ Acceptable for new hashes. + The default processing cost parameter is 5000, which is too low for modern hardware. .hash "$5$" "\e$5\e$(rounds=[1-9][0-9]+\e$)?[^$:\(rsn]{1,16}\e$[./0-9A-Za-z]{43}" unlimited 8 256 256 "6 to 96" "1000 to 999,999,999" +.Ss sm3crypt @@ -217,7 +216,7 @@ index 0000000..5347e11 + + /* 1. Prepare the first part of the message schedule W. */ + sm3_be32dec_vect(W, block, 8); -+ ++ + A = state[0]; + B = state[1]; + C = state[2]; @@ -227,22 +226,22 @@ index 0000000..5347e11 + G = state[6]; + H = state[7]; + -+ W00 = W[0]; -+ W01 = W[1]; -+ W02 = W[2]; -+ W03 = W[3]; -+ W04 = W[4]; -+ W05 = W[5]; -+ W06 = W[6]; -+ W07 = W[7]; -+ W08 = W[8]; -+ W09 = W[9]; -+ W10 = W[10]; -+ W11 = W[11]; -+ W12 = W[12]; -+ W13 = W[13]; -+ W14 = W[14]; -+ W15 = W[15]; ++ W00 = W[0]; ++ W01 = W[1]; ++ W02 = W[2]; ++ W03 = W[3]; ++ W04 = W[4]; ++ W05 = W[5]; ++ W06 = W[6]; ++ W07 = W[7]; ++ W08 = W[8]; ++ W09 = W[9]; ++ W10 = W[10]; ++ W11 = W[11]; ++ W12 = W[12]; ++ W13 = W[13]; ++ W14 = W[14]; ++ W15 = W[15]; + + R1(A, B, C, D, E, F, G, H, 0x79CC4519, W00, W00 ^ W04); + W00 = EXPAND(W00, W07, W13, W03, W10); @@ -606,10 +605,10 @@ index 0000000..5c76e6b + +#endif /* !_SM3_H_ */ diff --git a/lib/crypt-port.h b/lib/crypt-port.h -index 307b526..7ad44b0 100644 +index a707939..4c72623 100644 --- a/lib/crypt-port.h +++ b/lib/crypt-port.h -@@ -357,7 +357,7 @@ extern size_t strcpy_or_abort (void *dst, size_t d_size, const void *src); +@@ -362,7 +362,7 @@ extern size_t strcpy_or_abort (void *dst, size_t d_size, const void *src); #define libcperciva_SHA512_Buf _crypt_SHA512_Buf #endif @@ -618,7 +617,7 @@ index 307b526..7ad44b0 100644 #define gensalt_sha_rn _crypt_gensalt_sha_rn #endif -@@ -392,6 +392,13 @@ extern size_t strcpy_or_abort (void *dst, size_t d_size, const void *src); +@@ -397,6 +397,13 @@ extern size_t strcpy_or_abort (void *dst, size_t d_size, const void *src); #define libcperciva_SHA256_Buf _crypt_SHA256_Buf #endif @@ -1008,19 +1007,6 @@ index 094f7cc..2676c24 100644 sha1crypt $sha1 20 NETBSD sunmd5 $md5 8 SOLARIS md5crypt $1$ 9 GLIBC,FREEBSD,NETBSD,OPENBSD,SOLARIS -diff --git a/libxcrypt.spec.rpkg b/libxcrypt.spec.rpkg -index 8d3fd06..7e86b99 100644 ---- a/libxcrypt.spec.rpkg -+++ b/libxcrypt.spec.rpkg -@@ -170,7 +170,7 @@ Recommends: mkpasswd - %description - libxcrypt is a modern library for one-way hashing of passwords. It - supports a wide variety of both modern and historical hashing methods: --yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, -+yescrypt, gost-yescrypt, scrypt, bcrypt, sha512crypt, sha256crypt, sm3crypt - md5crypt, SunMD5, sha1crypt, NT, bsdicrypt, bigcrypt, and descrypt. - It provides the traditional Unix crypt and crypt_r interfaces, as well - as a set of extended interfaces pioneered by Openwall Linux, crypt_rn, diff --git a/test/alg-sm3.c b/test/alg-sm3.c new file mode 100644 index 0000000..910a7dd @@ -1280,5 +1266,5 @@ index 834ccf5..e4c9624 100644 { "$6$", sha512_expected_output, 19, 0, 0 }, { "$6$", sha512_expected_output_r, 32, 0, 10191 }, -- -2.27.0 +2.46.0 diff --git a/libxcrypt-4.4.37.tar.xz b/libxcrypt-4.4.37.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..ab862bccf2624fe1505d8569b99ab95f7456d818 Binary files /dev/null and b/libxcrypt-4.4.37.tar.xz differ diff --git a/libxcrypt.spec b/libxcrypt.spec index 4328dd6a7768c783de6297db0c4a7b061ba7da6c..94e072c193067e46f2c1ca02ec520c3afdb85c5b 100644 --- a/libxcrypt.spec +++ b/libxcrypt.spec @@ -1,11 +1,10 @@ -%define libdir /lib64 Name: libxcrypt -Version: 4.4.36 -Release: 2 +Version: 4.4.37 +Release: 1 Summary: Extended crypt library for DES, MD5, Blowfish and others -License: LGPLv2+ and BSD and Public Domain +License: LGPL-2.1-or-later AND BSD-3-Clause AND BSD-2-Clause AND 0BSD AND Apache-2.0 AND CC0-1.0 AND Public Domain URL: https://github.com/besser82/%{name} -Source0: https://github.com/besser82/%{name}/archive/v%{version}.tar.gz +Source0: https://github.com/besser82/libxcrypt/releases/download/v%{version}/libxcrypt-%{version}.tar.xz Patch9000: add-sm3-crypt-support.patch Patch9001: add-loongarch-support-for-libxcrypt.patch @@ -39,18 +38,14 @@ Summary: Development files for %{name} Requires: %{name} = %{version}-%{release} Requires: glibc-devel glibc-static Obsoletes: %{name}-static < %{version}-%{release} -Provides: %{name}-static %{name}-static%{?_isa} %{name}-devel%{?_isa} = %{version}-%{release} +Provides: %{name}-static = %{version}-%{release} +Provides: %{name}-static%{?_isa} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%package help -Summary: Man page for API of %{name} -BuildArch: noarch - -%description help -%{summary}. +%package_help %prep %autosetup -n %{name}-%{version} -p1 @@ -59,7 +54,7 @@ BuildArch: noarch autoreconf -fiv %configure \ - --libdir=%{libdir} \ + --libdir=/%{_lib} \ --disable-silent-rules \ --enable-shared \ --enable-static \ @@ -68,30 +63,24 @@ autoreconf -fiv %make_build - %install %make_install - -%{_bindir}/find %{buildroot} -name '*.la' -print -delete +%delete_la %check %make_build check -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - %files %license COPYING.LIB LICENSING -%doc NEWS README README.md THANKS AUTHORS -%{libdir}/libcrypt.so.* +%doc NEWS README THANKS AUTHORS +/%{_lib}/libcrypt.so.* %files devel -%doc ChangeLog TODO TODO.md -%{libdir}/{libcrypt.so,libxcrypt.so} +%doc ChangeLog TODO +/%{_lib}/{libcrypt.so,libxcrypt.so} %{_includedir}/{crypt.h,xcrypt.h} %{_libdir}/pkgconfig/{libcrypt,%{name}}.pc -%{libdir}/{libcrypt.a,libxcrypt.a} +/%{_lib}/{libcrypt.a,libxcrypt.a} %files help %{_mandir}/man3/crypt{,_r,_ra,_rn}.3.* @@ -100,8 +89,11 @@ autoreconf -fiv %{_mandir}/man3/crypt_preferred_method.3.* %{_mandir}/man5/crypt.5.* - %changelog +* Tue Dec 31 2024 Funda Wang - 4.4.37-1 +- update to 4.4.37 +- adjust libdir definition + * Wed Mar 6 2024 Wenlong Zhang - 4.4.36-2 - Fix build error for loongarch64 diff --git a/libxcrypt.yaml b/libxcrypt.yaml index 260db4198ed70f2c56c9c5c4291f4f5492552655..07392ff282e62e6e8c3b3c619d2fc1220f518aa7 100644 --- a/libxcrypt.yaml +++ b/libxcrypt.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: besser82/libxcrypt tag_prefix: ^v -seperator: . +separator: . diff --git a/v4.4.36.tar.gz b/v4.4.36.tar.gz deleted file mode 100644 index 2912b828d29dc40faa2b7bb395ea45af3d4875c6..0000000000000000000000000000000000000000 Binary files a/v4.4.36.tar.gz and /dev/null differ