From b4ed1445c0e590a871cc5d7f1fc379032bd339a83e27ee03208df92ad5f1e389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 11:08:06 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main argon2 revision e8ee47fd3a68217c234a1ddc530c6647 --- .gitattributes | 23 ++++++++ _service | 16 ++++++ _servicedata | 6 +++ adjust-makefile.patch | 47 ++++++++++++++++ argon2-20190702.tar.gz | 3 ++ argon2.changes | 66 +++++++++++++++++++++++ argon2.spec | 118 +++++++++++++++++++++++++++++++++++++++++ baselibs.conf | 1 + 8 files changed, 280 insertions(+) create mode 100644 .gitattributes create mode 100644 _service create mode 100644 _servicedata create mode 100644 adjust-makefile.patch create mode 100644 argon2-20190702.tar.gz create mode 100644 argon2.changes create mode 100644 argon2.spec create mode 100644 baselibs.conf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/_service b/_service new file mode 100644 index 0000000..fbc5eac --- /dev/null +++ b/_service @@ -0,0 +1,16 @@ + + + argon2 + @PARENT_TAG@ + https://github.com/P-H-C/phc-winner-argon2.git + git + enable + + 20190702 + + + xz + *.tar + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..f729e34 --- /dev/null +++ b/_servicedata @@ -0,0 +1,6 @@ + + + https://github.com/P-H-C/phc-winner-argon2.git + d3639142fa71f8095ee36e64068f71b3c97baf6d + + \ No newline at end of file diff --git a/adjust-makefile.patch b/adjust-makefile.patch new file mode 100644 index 0000000..eb4e512 --- /dev/null +++ b/adjust-makefile.patch @@ -0,0 +1,47 @@ +diff -Nur argon2-20190702/Makefile new/Makefile +--- argon2-20190702/Makefile 2019-05-20 11:18:00.000000000 +0200 ++++ new/Makefile 2022-04-24 00:09:10.859729849 +0200 +@@ -37,7 +37,7 @@ + SRC_GENKAT = src/genkat.c + OBJ = $(SRC:.c=.o) + +-CFLAGS += -std=c89 -O3 -Wall -g -Iinclude -Isrc ++CFLAGS += $(OPTFLAGS) -Iinclude -Isrc + + ifeq ($(NO_THREADS), 1) + CFLAGS += -DARGON2_NO_THREADS +@@ -48,16 +48,12 @@ + CI_CFLAGS := $(CFLAGS) -Werror=declaration-after-statement -D_FORTIFY_SOURCE=2 \ + -Wextra -Wno-type-limits -Werror -coverage -DTEST_LARGE_RAM + +-OPTTARGET ?= native +-OPTTEST := $(shell $(CC) -Iinclude -Isrc -march=$(OPTTARGET) src/opt.c -c \ +- -o /dev/null 2>/dev/null; echo $$?) + # Detect compatible platform + ifneq ($(OPTTEST), 0) + $(info Building without optimizations) + SRC += src/ref.c + else +-$(info Building with optimizations for $(OPTTARGET)) +- CFLAGS += -march=$(OPTTARGET) ++$(info Building with optimizations) + SRC += src/opt.c + endif + +@@ -128,6 +124,7 @@ + HEADERS = include/argon2.h + + INSTALL = install ++LIB_INSTALL_PERM = 0755 + + # relative paths for different OS + ifeq ($(KERNEL_NAME), $(filter $(KERNEL_NAME),DragonFly FreeBSD)) +@@ -236,7 +233,7 @@ + $(INSTALL) -d $(INST_INCLUDE) + $(INSTALL) -m 0644 $(HEADERS) $(INST_INCLUDE) + $(INSTALL) -d $(INST_LIBRARY) +- $(INSTALL) -m 0644 $(LIBRARIES) $(INST_LIBRARY) ++ $(INSTALL) -m $(LIB_INSTALL_PERM) $(LIBRARIES) $(INST_LIBRARY) + ifdef LINKED_LIB_SH + cd $(INST_LIBRARY) && ln -s $(notdir $(LIB_SH) $(LINKED_LIB_SH)) + endif diff --git a/argon2-20190702.tar.gz b/argon2-20190702.tar.gz new file mode 100644 index 0000000..34c4c7c --- /dev/null +++ b/argon2-20190702.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daf972a89577f8772602bf2eb38b6a3dd3d922bf5724d45e7f9589b5e830442c +size 1505307 diff --git a/argon2.changes b/argon2.changes new file mode 100644 index 0000000..4a926b8 --- /dev/null +++ b/argon2.changes @@ -0,0 +1,66 @@ +------------------------------------------------------------------- +Wed Apr 27 07:14:43 UTC 2022 - Marcus Meissner + +- use a source url + +------------------------------------------------------------------- +Sat Apr 23 21:44:18 UTC 2022 - Ferdinand Thiessen + +- Fix version of package: 20171227 is the upstream version number + of the package +- Replaced optflags.patch with adjust-makefile.patch, the + patch will now also allow to set the file permissions of installed + libraries. This fixes the rpmlint error: shared-library-not-executable + +------------------------------------------------------------------- +Tue May 12 14:17:20 UTC 2020 - Wolfgang Frisch + +- Update to version 0.0+git20190520.62358ba (boo#1170512): + * Fix the Makefile to install libargon2.pc. + * Wait for already running threads if a thread creation failed. + * Added Argon2 Erlang binding. + * Additional JVM bindings (Jargon2). + +------------------------------------------------------------------- +Tue Jan 30 13:31:06 UTC 2018 - lnussel@suse.de + +- add baselibs.conf as cryptsetup also has 32bit variants + +------------------------------------------------------------------- +Tue Jan 9 10:56:17 UTC 2018 - jengelh@inai.de + +- Update description. + +------------------------------------------------------------------- +Tue Jan 09 08:10:20 UTC 2018 - lnussel@suse.de + +- Update to version 0.0+git20171227.670229c: + * Added ABI version number + * AVX2/AVX-512F optimizations of BLAMKA + * Set Argon2 version number from the command line + * New bindings + * Minor bug and warning fixes (no security issue) +- use _service file + +------------------------------------------------------------------- +Tue Apr 18 14:01:09 UTC 2017 - meissner@suse.com + +- ship libargon2.pc (bsc#1034441) + +------------------------------------------------------------------- +Thu Feb 23 22:32:49 UTC 2017 - adam@mizerski.pl + +- moved argon2-specs.pdf to doc subpackage +- added packaging of man page + +------------------------------------------------------------------- +Sat Jan 28 09:56:58 UTC 2017 - hpj@urpla.net + +- make sure to call cc with -pthread option (implies -lpthread) +- run test suite + +------------------------------------------------------------------- +Tue Dec 20 11:21:43 UTC 2016 - idonmez@suse.com + +- Initial release + diff --git a/argon2.spec b/argon2.spec new file mode 100644 index 0000000..677b12a --- /dev/null +++ b/argon2.spec @@ -0,0 +1,118 @@ +# +# spec file for package argon2 +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%ifarch i686 x86_64 +%define no_optimize 0 +%else +%define no_optimize 1 +%endif +# for convenience +%define make %__make %{?_smp_mflags} OPTFLAGS="%{optflags}" OPTTEST=%no_optimize LIB_ST= LIBRARY_REL=%_lib + +%define lname libargon2-1 +Name: argon2 +Version: 20190702 +Release: 0 +Summary: The reference C implementation of Argon2 +License: Apache-2.0 OR CC0-1.0 +Group: Productivity/Networking/Security +URL: https://github.com/P-H-C/phc-winner-argon2 +Source: https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: baselibs.conf +# PATCH-FIX-OPENSUSE adjust-makefile.patch -- Allow setting optflags and file permissions of installed libraries +Patch1: adjust-makefile.patch +BuildRequires: pkgconfig +BuildRequires: sed +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +This is the reference C implementation of Argon2, the password-hashing function +that won the Password Hashing Competition (PHC) in 2015. + +Argon2 is a password hashing function that is parametrized by a time cost, a +memory cost and a parallelism degree, used to guard against side-channel +attacks, attacks where lots of memory is available, or attacks where a lot of +processing is available. + +%package doc +Summary: Documentation for Argon2 +Group: Documentation/Other +BuildArch: noarch + +%description doc +Documentation for Argon2, the password hashing function that won the Password +Hashing Competition (PHC) in 2015. + +%package -n %{lname} +Summary: The reference C implementation of Argon2 +Group: System/Libraries + +%description -n %{lname} +Reference C implementation of Argon2, the password-hashing function +that won the Password Hashing Competition (PHC) in 2015. + +%package devel +Summary: Development files for argon2 +Group: Development/Libraries/C and C++ +Requires: %{lname} = %{version} + +%description devel +Headers for argon2, the reference C implementation of Argon2, the +password hashing function that won the Password Hashing Competition +(PHC) in 2015. + +%prep +%setup -n phc-winner-argon2-%version +%patch1 -p1 + +%build +%make + +%install +%make install DESTDIR=%{buildroot} + +install -D -m 644 man/argon2.1 %{buildroot}%{_mandir}/man1/argon2.1 + +%check +%make test + +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%license LICENSE +%doc CHANGELOG.md README.md +%{_bindir}/argon2 +%{_mandir}/man1/argon2.1%{ext_man} + +%files doc +%defattr(-,root,root) +%doc argon2-specs.pdf + +%files -n %{lname} +%defattr(-,root,root) +%{_libdir}/libargon2.so.1 + +%files devel +%defattr(-,root,root) +%{_includedir}/argon2.h +%{_libdir}/libargon2.so +%{_libdir}/pkgconfig/libargon2.pc + +%changelog diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..5a35d3a --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libargon2-1