diff --git a/libxcrypt-4.4.28.tar.xz b/libxcrypt-4.4.28.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..20fced6376a64b28bf3f26d4af8d114453862447 Binary files /dev/null and b/libxcrypt-4.4.28.tar.xz differ diff --git a/libxcrypt-4.4.28.tar.xz.asc b/libxcrypt-4.4.28.tar.xz.asc new file mode 100644 index 0000000000000000000000000000000000000000..a2de990453fbeca5e76efe143f97135209556e29 --- /dev/null +++ b/libxcrypt-4.4.28.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEEZ4zj/uQwMRWW24wW9S6YAHWUwh0FAmH5tQIACgkQ9S6YAHWU +wh0Vsg/7BG+aIoVGuE5aEl9ILoCaujen52ezT+z0wbmwW75sz+QSRgvCsN7DeF6v +KqXfQVdD6tvRPKY2tzJ9wJerzeKTDbYSYhgiQ5Ic4cS3YwGi6fJ+I7j67MTnG0ci +dtUPwL05XcpO5tVCiUj/NOSVo9KZwl3Fj1/SvCs3VzS1ECJ47Fr2jlOftHkLcdy7 +FEGji8WKsEIdLEtszKk1r9TmuXIacYESFxrNSMEqR19B6hVMMSzEtDfxD258p7xz +0lVUetsSrpU7BJ7jVJrariicKs7BuRvTBnpylkXp2Oep+AkD70sfRFUhauMkWfvr +6qjhHRmerqaN2+GTU/A55oPY3gbtvrKqaIMRf+qIEvr4o/Ju/hyTgRQUe2cHXK1t +zduSr52Ctjj3FUBBFIeseA24YkWpgouHoVmeKjrDn8NbXB2oeR6SlZdbrp0eXFjD +J4GhJIjWmArJP3FE8qLbw2OD72Bxruwr2906osVMtvV/XpyWUTGAcjqWSu+YxZHk +KB9RpHlaF0AALqfBJZlWeft7PAIJxzw8CCgGucAVqnQmF6y1QWVYaIubh0jX8Pla +ehG3re76C1XFm5atRsasSP8au+JYFZN8ARuPhLzKrRDQpLr3Ro0Fg9gSoCvMgjW6 +S3l5fOd2GmKpelzEHjnRgj9srSNFDH6ID3KVKX861tbkC8lSeQU= +=ZNX1 +-----END PGP SIGNATURE----- diff --git a/libxcrypt-4.4.28.tar.xz.sha256sum b/libxcrypt-4.4.28.tar.xz.sha256sum new file mode 100644 index 0000000000000000000000000000000000000000..29dc4942afa3b6ad28eaf8bacf6583530cbd754c --- /dev/null +++ b/libxcrypt-4.4.28.tar.xz.sha256sum @@ -0,0 +1,2 @@ +9e936811f9fad11dbca33ca19bd97c55c52eb3ca15901f27ade046cc79e69e87 libxcrypt-4.4.28.tar.xz +746ddc76239e00ae3a4085049538266e08791de88f0b974c68ceaa59669fc9c6 libxcrypt-4.4.28.tar.xz.asc diff --git a/libxcrypt-gpgkey.gpg b/libxcrypt-gpgkey.gpg new file mode 100644 index 0000000000000000000000000000000000000000..fb4a4563028e6eb450092a6103f529a5bcab5e76 Binary files /dev/null and b/libxcrypt-gpgkey.gpg differ diff --git a/libxcrypt.spec b/libxcrypt.spec new file mode 100644 index 0000000000000000000000000000000000000000..2a210ca73172c547934a4a98dbb2588a93058c78 --- /dev/null +++ b/libxcrypt.spec @@ -0,0 +1,455 @@ +%bcond_without new_api +%bcond_without compat_pkg +%bcond_without enosys_stubs +%bcond_without staticlib +%bcond_with bootstrap + + +%if %{with new_api} +%global soc 2 +%global sol 0 +%global sof 0 +%global sov %{soc}.%{sol}.%{sof} +%else +%global soc 1 +%global sol 1 +%global sof 0 +%global sov %{soc}.%{sol}.%{sof} +%endif + +%if %{with compat_pkg} +%global csoc 1 +%global csol 1 +%global csof 0 +%global csov %{csoc}.%{csol}.%{csof} +%endif + + +%global glibc_minver 2.28 +%global man_pages_minver 4.15-3 +%global hash_methods all +%if %{with new_api} +%global obsolete_api no +%else +%global obsolete_api glibc +%endif + +%if %{with compat_pkg} +%global compat_methods all +%global compat_api glibc +%endif + + +%if %{with enosys_stubs} +%global enosys_stubs yes +%else +%global enosys_stubs no +%endif + + +%global distname .openAnolis +%global _configure "$(realpath ../configure)" + +%global common_configure_options \\\ + --disable-failure-tokens \\\ + --disable-silent-rules \\\ + --enable-shared \\\ +%if %{with staticlib} \ + --enable-static \\\ +%else \ + --disable-static \\\ +%endif \ + --disable-valgrind \\\ + --srcdir=$(realpath ..) \\\ + --with-pkgconfigdir=%{_libdir}/pkgconfig + + +%global _fipsdir %{_libdir}/fipscheck + + +%define __spec_install_post \ +%{?__debug_package:%{__debug_install_post}} \ +%{__arch_install_post} \ +%{__os_install_post} \ +libdir="%{buildroot}%{_libdir}" \ +fipsdir="$libdir/fipscheck" \ +mkdir -p $fipsdir \ +fipshmac -d $fipsdir \\\ + $libdir/libcrypt.so.%{sov} \ +ln -s libcrypt.so.%{sov}.hmac \\\ + $fipsdir/libcrypt.so.%{soc}.hmac \ +if [[ %{with staticlib} == 1 ]]; then \ + fipshmac -d $fipsdir \\\ + $libdir/libcrypt.a \ + if [[ %{without new_api} == 1 ]]; then \ + ln -s .libcrypt.a.hmac \\\ + $fipsdir/libxcrypt.a.hmac \ + fi \ +fi \ +if [[ %{with compat_pkg} == 1 ]]; then \ + fipshmac -d $fipsdir \\\ + $libdir/libcrypt.so.%{csov} \ + ln -s libcrypt.so.%{csov}.hmac \\\ + $fipsdir/libcrypt.so.%{csoc}.hmac \ +fi \ +%{nil} + +%global _ld_strict_symbol_defs 1 + + +Name: libxcrypt +Version: 4.4.28 +Release: 1%{?dist} +Summary: Extended crypt library for descrypt, md5crypt, bcrypt, and others + +License: LGPLv2+ and BSD and Public Domain +URL: https://github.com/besser82/%{name} +Source0: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz +Source1: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz.asc +Source2: %{url}/releases/download/v%{version}/%{name}-gpgkey.gpg +Source3: %{url}/releases/download/v%{version}/%{name}-%{version}.tar.xz.sha256sum + +BuildRequires: fipscheck +BuildRequires: gcc +BuildRequires: glibc-devel >= %{glibc_minver} +BuildRequires: make +BuildRequires: perl-core + +%if %{without bootstrap} +BuildRequires: gnupg2 +BuildRequires: %{_bindir}/sha256sum +%endif + +Obsoletes: libcrypt-nss < %{glibc_minver} +Provides: libcrypt-nss = %{glibc_minver} +Provides: libcrypt-nss%{?_isa} = %{glibc_minver} + +Obsoletes: libcrypt < %{glibc_minver} +Provides: libcrypt = %{glibc_minver} +Provides: libcrypt%{?_isa} = %{glibc_minver} + +Obsoletes: %{name}-common < 4.3.3-4 +Provides: %{name}-common = %{version}-%{release} + +%if %{with new_api} && %{without compat_pkg} +Obsoletes: %{name}-compat < %{version}-%{release} +%endif + +Requires: glibc%{?_isa} >= %{glibc_minver} +Requires: 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, +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, +crypt_ra, crypt_gensalt, crypt_gensalt_rn, and crypt_gensalt_ra. + +libxcrypt is intended to be used by login(1), passwd(1), and other +similar programs; that is, to hash a small number of passwords during +an interactive authentication dialogue with a human. It is not suitable +for use in bulk password-cracking applications, or in any other situation +where speed is more important than careful handling of sensitive data. +However, it is intended to be fast and lightweight enough for use in +servers that must field thousands of login attempts per minute. +%if %{with new_api} +This version of the library does not provide the legacy API functions +that have been provided by glibc's libcrypt.so.1. +%endif + + +%if %{with compat_pkg} +%package compat +Summary: Compatibility library providing legacy API functions + +# For testing the glibc compatibility symbols. +BuildRequires: libxcrypt-compat + +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description compat +This package contains the library providing the compatibility API +for applications that are linked against glibc's libxcrypt, or that +are still using the unsafe and deprecated, encrypt, encrypt_r, +setkey, setkey_r, and fcrypt functions, which are still required by +recent versions of POSIX, the Single UNIX Specification, and various +other standards. + +All existing binary executables linked against glibc's libcrypt should +work unmodified with the library supplied by this package. +%endif + + +%package devel +Summary: Development files for %{name} + +Conflicts: man-pages < %{man_pages_minver} + +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: glibc-devel%{?_isa} >= %{glibc_minver} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%if %{with staticlib} +%package static +Summary: Static library for -static linking with %{name} + +Requires: %{name}-devel%{?_isa} = %{version}-%{release} +Requires: glibc-devel%{?_isa} >= %{glibc_minver} +Requires: glibc-static%{?_isa} >= %{glibc_minver} + +%description static +This package contains the libxcrypt static library for -static +linking. + +You don't need this, unless you link statically, which is highly +discouraged. +%endif + + +%prep +%if %{without bootstrap} +%{gpgverify} --keyring=%{SOURCE2} --signature=%{SOURCE1} --data=%{SOURCE0} +pushd %{_sourcedir} +sha256sum -c %{SOURCE3} +popd +%endif + +%autosetup -p 1 + +%if %{with new_api} +cat << EOF >> README%{distname} +This version of the %{name} package ships the libcrypt.so.2 +library and does not provide the legacy API functions that have +been provided by glibc's libcrypt.so.1. The removed functions +by name are encrypt, encrypt_r, setkey, setkey_r, and fcrypt. +%if %{with compat_pkg} + +If you are using a third-party application that links against +those functions, or that is linked against glibc's libcrypt, +you may need to install the %{name}-compat package manually. + +All existing binary executables linked against glibc's libcrypt +should work unmodified with the libcrypt.so.1 library supplied +by the %{name}-compat package. +%endif +EOF +%endif + +%if %{with enosys_stubs} +cat << EOF >> README.posix +This version of the libcrypt.so.1 library has entirely removed +the functionality of the encrypt, encrypt_r, setkey, setkey_r, +and fcrypt functions, while keeping fully binary compatibility +with existing (third-party) applications possibly still using +those funtions. If such an application attemps to call one of +these functions, the corresponding function will indicate that +it is not supported by the system in a POSIX-compliant way. + +For security reasons, the encrypt and encrypt_r functions will +also overwrite their data-block argument with random bits. + +All existing binary executables linked against glibc's libcrypt +should work unmodified with the provided version of the +libcrypt.so.1 library in place. +EOF +%endif + +%if %{with staticlib} +cat << EOF >> README.static +Applications that use certain legacy APIs supplied by glibc’s +libcrypt (encrypt, encrypt_r, setkey, setkey_r, and fcrypt) +cannot be compiled nor linked against the supplied build of +the object files provided in the static library libcrypt.a. +EOF +%endif + + +%build +mkdir -p %{_vpath_builddir} + +pushd %{_vpath_builddir} +%configure \ + %{common_configure_options} \ + --enable-hashes=%{hash_methods} \ + --enable-obsolete-api=%{obsolete_api} \ +%if %{with new_api} + --enable-obsolete-api-enosys=%{obsolete_api} +%else + --enable-obsolete-api-enosys=%{enosys_stubs} +%endif +%make_build +%make_build test-programs +popd + +%if %{with compat_pkg} +mkdir -p %{_vpath_builddir}-compat + +pushd %{_vpath_builddir}-compat +%configure \ + %{common_configure_options} \ + --enable-hashes=%{compat_methods} \ + --enable-obsolete-api=%{compat_api} \ + --enable-obsolete-api-enosys=%{enosys_stubs} +%make_build +%make_build test-programs +popd +%endif + +mkdir -p %{_vpath_builddir}-all_possible_tests + +%global system_lto_cflags_bak %{_lto_cflags} +%define _lto_cflags %{nil} + +unset CFLAGS +unset CXXFLAGS +unset FFLAGS +unset FCFLAGS +unset LDFLAGS +unset LT_SYS_LIBRARY_PATH + +pushd %{_vpath_builddir}-all_possible_tests +%configure \ +%if %{with compat_pkg} + %{common_configure_options} \ + --enable-hashes=all \ + --enable-obsolete-api=%{compat_api} \ + --enable-obsolete-api-enosys=%{enosys_stubs} +%else + %{common_configure_options} \ + --enable-hashes=%{hash_methods} \ + --enable-obsolete-api=%{obsolete_api} \ +%if %{with new_api} + --enable-obsolete-api-enosys=%{obsolete_api} +%else + --enable-obsolete-api-enosys=%{enosys_stubs} +%endif +%endif +%define _lto_cflags %{system_lto_cflags_bak} +%make_build +%make_build test-programs +popd + + +%install +%if %{with compat_pkg} +%make_install -C %{_vpath_builddir}-compat + +find %{buildroot} -xtype f -not -name 'libcrypt.so.%{csoc}*' -delete -print +find %{buildroot} -type l -not -name 'libcrypt.so.%{csoc}*' -delete -print +%endif + +%make_install -C %{_vpath_builddir} + +find %{buildroot} -name '*.la' -delete -print + +install -Dpm 0644 -t %{buildroot}%{_pkgdocdir} \ + ChangeLog NEWS README* THANKS TODO + +rm -f %{buildroot}%{_pkgdocdir}/README.md + + +%check +build_dirs="%{_vpath_builddir}" +%if %{with compat_pkg} +build_dirs="${build_dirs} %{_vpath_builddir}-compat" +%endif +build_dirs="${build_dirs} %{_vpath_builddir}-all_possible_tests" +for dir in ${build_dirs}; do + %make_build -C ${dir} check || \ + { + rc=$?; + echo "-----BEGIN TESTLOG: ${dir}-----"; + cat ${dir}/test-suite.log; + echo "-----END TESTLOG: ${dir}-----"; + exit $rc; + } +done + + +%ldconfig_scriptlets +%if %{with compat_pkg} +%ldconfig_scriptlets compat +%endif + + +%files +%dir %{_fipsdir} +%doc %dir %{_pkgdocdir} +%doc %{_pkgdocdir}/NEWS +%doc %{_pkgdocdir}/README +%if %{with new_api} +%doc %{_pkgdocdir}/README%{distname} +%endif +%if %{with enosys_stubs} && %{without compat_pkg} +%doc %{_pkgdocdir}/README.posix +%endif +%doc %{_pkgdocdir}/THANKS +%license AUTHORS COPYING.LIB LICENSING +%{_fipsdir}/libcrypt.so.%{soc}.hmac +%{_fipsdir}/libcrypt.so.%{sov}.hmac +%{_libdir}/libcrypt.so.%{soc} +%{_libdir}/libcrypt.so.%{sov} +%{_mandir}/man5/crypt.5* + + +%if %{with compat_pkg} +%files compat +%dir %{_fipsdir} +%if %{with enosys_stubs} +%doc %{_pkgdocdir}/README.posix +%endif +%{_fipsdir}/libcrypt.so.%{csoc}.hmac +%{_fipsdir}/libcrypt.so.%{csov}.hmac +%{_libdir}/libcrypt.so.%{csoc} +%{_libdir}/libcrypt.so.%{csov} +%endif + + +%files devel +%doc %{_pkgdocdir}/ChangeLog +%doc %{_pkgdocdir}/TODO +%{_libdir}/libcrypt.so +%if %{without new_api} +%{_libdir}/libxcrypt.so +%endif +%{_includedir}/crypt.h +%if %{without new_api} +%{_includedir}/xcrypt.h +%endif +%{_libdir}/pkgconfig/libcrypt.pc +%{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/crypt.3* +%{_mandir}/man3/crypt_r.3* +%{_mandir}/man3/crypt_ra.3* +%{_mandir}/man3/crypt_rn.3* +%{_mandir}/man3/crypt_checksalt.3* +%{_mandir}/man3/crypt_gensalt.3* +%{_mandir}/man3/crypt_gensalt_ra.3* +%{_mandir}/man3/crypt_gensalt_rn.3* +%{_mandir}/man3/crypt_preferred_method.3* + + +%if %{with staticlib} +%files static +%dir %{_fipsdir} +%doc %{_pkgdocdir}/README.static +%{_fipsdir}/libcrypt.a.hmac +%if %{without new_api} +%{_fipsdir}/libxcrypt.a.hmac +%endif +%{_libdir}/libcrypt.a +%if %{without new_api} +%{_libdir}/libxcrypt.a +%endif +%endif + + +%changelog +* Thu Mar 17 2022 forrest_ly - 4.4.28-1 +- Init for Anolis OS 23