Initialize for libxcrypt

This commit is contained in:
zyppe 2024-02-09 18:59:50 +08:00
commit e8480c69e4
6 changed files with 277 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
libxcrypt-4.4.15.tar.gz

1
.libxcrypt.metadata Normal file
View file

@ -0,0 +1 @@
dea2cb242dc6f3c30dc7ca378f20a1c87e31affbdeb716c3ddad59d2fb9a0fc3 libxcrypt-4.4.15.tar.gz

7
baselibs.conf Normal file
View file

@ -0,0 +1,7 @@
libcrypt1
arch i586 provides "libowcrypt.so.1"
arch i586 provides "libowcrypt.so.1(OW_CRYPT_1.0)"
libxcrypt-devel
requires -libxcrypt-<targettype>
requires "libcrypt1-<targettype> = <version>"
conflicts "glibc-devel-<targettype> < 2.28"

View file

@ -0,0 +1,46 @@
diff --git a/doc/crypt.3 b/doc/crypt.3
index f93004f..1b00e4a 100644
--- a/doc/crypt.3
+++ b/doc/crypt.3
@@ -90,7 +90,7 @@ It has at least these fields:
struct crypt_data {
char output[CRYPT_OUTPUT_SIZE];
char setting[CRYPT_OUTPUT_SIZE];
- char phrase[CRYPT_MAX_PASSPHRASE_SIZE];
+ char input[CRYPT_MAX_PASSPHRASE_SIZE];
char initialized;
};
.Ed
@@ -100,11 +100,11 @@ Upon a successful return from
the hashed passphrase will be stored in
.Fa output .
Applications are encouraged, but not required, to use the
-.Fa phrase
+.Fa input
and
.Fa setting
fields to store the strings that they will pass as
-.Fa phrase
+.Fa input phrase
and
.Fa setting
to
@@ -126,7 +126,7 @@ before the first use.
(Of course, do this before storing anything in
.Fa setting
and
-.Fa phrase . )
+.Fa input . )
.Pp
The
.Fa data
@@ -143,7 +143,7 @@ When used with
the entire
.Fa data
object (except for the
-.Fa phrase
+.Fa input
and
.Fa setting
fields) must be zeroed before its first use;

73
libxcrypt.changes Normal file
View file

@ -0,0 +1,73 @@
* Tue Dec 12 2023 pgajdos@suse.com
- fix variable name for datamember in 'struct crypt_data' [bsc#1215496]
- added patches
fix https://github.com/besser82/libxcrypt/commit/b212d601549a0fc84cbbcaf21b931f903787d7e2
+ libxcrypt-man-fix-variable-name.patch
* Sat Feb 6 2021 dmueller@suse.com
- add compatibility provides for Step 15 as well (bsc#1181571)
* Tue Sep 1 2020 schwab@suse.de
- Add compatibility provides for SLE15
* Mon Mar 2 2020 schwab@suse.de
- Update to version 4.4.15
* The compatibility symbols crypt_gensalt_r, xcrypt, xcrypt_r,
xcrypt_gensalt, and xcrypt_gensalt_r are deprecated further
* Speed up ka-sunmd5 by skipping most of the test phrases
- Package README.md and TODO.md (bsc#1165389)
* Thu Jan 30 2020 schwab@suse.de
- Update to version 4.4.12
* Another fix for GCC v10.x, which occurs on s390 architectures only.
* Wed Jan 22 2020 schwab@suse.de
- Update to version 4.4.11
* Fixes for GCC v10.x
* Change how the known-answer tests are parallelized
- gcc10.patch: remove
* Thu Dec 12 2019 schwab@suse.de
- gcc10.patch: fix build with gcc10 (bsc#1158192)
* Sat Dec 7 2019 schwab@suse.de
- Update to version 4.4.10
* Fix alignment problem for GOST 34.11 (Streebog) in gost-yestcrypt.
* The crypt_* functions will now all fail and set errno to ERANGE if
their 'phrase' argument is longer than CRYPT_MAX_PASSPHRASE_SIZE
characters (this is currently 512)
* The NT hashing method no longer truncates passphrases at 128
characters; Windows does not do this.
- format-overflow.patch: remove
* Thu Jun 20 2019 mliska@suse.cz
- Disable LTO due to symbol versioning (boo#1138833).
* Tue Feb 19 2019 schwab@suse.de
- format-overflow.patch: Fix -Werror=format-overflow
* Thu Feb 14 2019 mliska@suse.cz
- Update to version 4.4.3:
* Add libxcrypt.so, libxcrypt.a and xcrypt.h.
* Add new man3 manual pages.
* Tue Oct 9 2018 schwab@suse.de
- Set compatibility level to suse
* Wed Aug 8 2018 schwab@suse.de
- Add conflicts with glibc-devel < 2.28
* Mon Aug 6 2018 jengelh@inai.de
- Fix RPM groups for Factory.
* Wed Aug 1 2018 schwab@suse.de
- Update to libxcrypt 4.1.0
* Fix spelling of SUSE.
* Lower the minimum required automake version to 1.14.
* Fix build with USE_SWAPCONTEXT turned off.
* Extend --enable-weak-hashes configure option to accept optional
"glibc" parameter.
* Fix the leak of obtained random bytes.
* Check expected output strings for deterministic methods.
* Fix memory leak in crypt_sha1_rn.
* Fix read of random bytes out of bounds in gensalt_sha1_rn.
* Make it possible to disable individual hashes at configure time.
* Make salt validation pickier.
* Replace crypt-sunmd5.c with BSD-licensed cleanroom reimplementation.
* Make crypt_gensalt for $sha1 deterministic.
* Fix incorrect output-size computation in crypt_sha1_rn.
* Add docs for SHA1, MD5/Sun, NTHASH.
* Introduce CRYPT_GENSALT_IMPLEMENTS_* feature test macros.
* Install libcrypt.pc symlink along with libxcrypt.pc.
* Extend --enable-obsolete-api configure option.
* Extend overall test coverage.
* Wed May 23 2018 schwab@suse.de
- Update to libxcrypt 4.0.1
* Wed May 9 2018 schwab@suse.de
- ABI compatible replacement for libcypt from glibc

149
libxcrypt.spec Normal file
View file

@ -0,0 +1,149 @@
#
# spec file for package libxcrypt
#
# Copyright (c) 2022-2023 ZhuningOS
#
Name: libxcrypt
Version: 4.4.15
Release: 150300.4.7.1
Summary: Extended crypt library for DES, MD5, Blowfish and others
License: GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND SUSE-Public-Domain
Group: Development/Libraries/C and C++
URL: https://github.com/besser82/%{name}
Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: baselibs.conf
# https://github.com/besser82/libxcrypt/commit/b212d601549a0fc84cbbcaf21b931f903787d7e2
Patch0: libxcrypt-man-fix-variable-name.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: pkgconfig
%description
libxcrypt is a modern library for one-way hashing of passwords. It
supports DES, MD5, SHA-2-256, SHA-2-512, and bcrypt-based password
hashes, and provides the traditional Unix 'crypt' and 'crypt_r'
interfaces, as well as a set of extended interfaces pioneered by
Openwall Linux, 'crypt_rn', 'crypt_ra', 'crypt_gensalt',
'crypt_gensalt_rn', and 'crypt_gensalt_ra'.
%package -n libcrypt1
Summary: Extended crypt library for DES, MD5, Blowfish and others
License: LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND SUSE-Public-Domain
Group: System/Libraries
# Compatibility provides to help the transition from libowcrypt.so.1
# to libcrypt.so.1, which provides all symbols of the former
%ifarch x86_64 s390x ppc64le aarch64 riscv64
Provides: libowcrypt.so.1()(64bit)
Provides: libowcrypt.so.1(OW_CRYPT_1.0)(64bit)
%endif
%ifarch %ix86 %{arm}
Provides: libowcrypt.so.1
Provides: libowcrypt.so.1(OW_CRYPT_1.0)
%endif
%description -n libcrypt1
libxcrypt is a modern library for one-way hashing of passwords. It
supports DES, MD5, SHA-2-256, SHA-2-512, and bcrypt-based password
hashes, and provides the traditional Unix 'crypt' and 'crypt_r'
interfaces, as well as a set of extended interfaces pioneered by
Openwall Linux, 'crypt_rn', 'crypt_ra', 'crypt_gensalt',
'crypt_gensalt_rn', and 'crypt_gensalt_ra'.
%package devel
Summary: Development files for %{name}
License: LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND SUSE-Public-Domain
Group: Development/Languages/C and C++
Requires: libcrypt1 = %{version}
Requires: pkgconfig
Provides: glibc-devel:%{_libdir}/libcrypt.so
Conflicts: glibc-devel < 2.28
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package devel-static
Summary: Static library for -static linking with %{name}
License: GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND SUSE-Public-Domain
Group: Development/Libraries/C and C++
Requires: %{name}-devel = %{version}
Requires: glibc-devel-static
Provides: glibc-devel-static:%{_libdir}/libcrypt.a
Conflicts: glibc-devel-static < 2.28
%description devel-static
This package contains the libxcrypt static libraries for -static
linking. You don't need this, unless you link statically, which
is highly discouraged.
%prep
%autosetup -p1
%build
# Disable LTO due to symbol versioning (boo#1138833):
# (https://en.opensuse.org/openSUSE:LTO#Symbol_versioning).
%define _lto_cflags %{nil}
autoreconf -fi
%configure \
--disable-silent-rules \
--enable-shared \
--enable-static \
--enable-obsolete-api=suse \
--enable-hashes=all \
--with-pkgconfigdir=%{_libdir}/pkgconfig
%make_build
%install
%make_install
find %{buildroot}%{_libdir} -name '*.la' -print -delete
%check
%make_build check || \
{
rc=$?;
echo "-----BEGIN TESTLOG-----";
%{__cat} test-suite.log;
echo "-----END TESTLOG-----";
exit $rc;
}
%post -n libcrypt1 -p /sbin/ldconfig
%postun -n libcrypt1 -p /sbin/ldconfig
%files -n libcrypt1
%license COPYING.LIB LICENSING
%doc AUTHORS NEWS README README.md THANKS
%{_libdir}/libcrypt.so.*
%{_libdir}/libowcrypt.so.*
%files devel
%doc TODO TODO.md
%{_libdir}/libcrypt.so
%{_libdir}/libxcrypt.so
%{_libdir}/libowcrypt.so
%{_includedir}/crypt.h
%{_includedir}/xcrypt.h
%{_libdir}/pkgconfig/libcrypt.pc
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man3/crypt_rn.3.*
%{_mandir}/man3/crypt_gensalt.3.*
%{_mandir}/man3/crypt.3.*
%{_mandir}/man3/crypt_checksalt.3.*
%{_mandir}/man3/crypt_gensalt_ra.3.*
%{_mandir}/man3/crypt_gensalt_rn.3.*
%{_mandir}/man3/crypt_preferred_method.3.*
%{_mandir}/man3/crypt_r.3.*
%{_mandir}/man3/crypt_ra.3.*
%{_mandir}/man5/crypt.5.*
%files devel-static
%{_libdir}/libcrypt.a
%{_libdir}/libxcrypt.a
%{_libdir}/libowcrypt.a
%changelog