From c9aff16c011b879d12a8fc8d7539e5521e82994f9ce29b24869c782f73f4f907 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 20 Dec 2016 14:06:16 +0000 Subject: [PATCH] Accepting request 447165 from home:namtrac I'd like to maintain argon2 in Factory. Please accept and set me as the maintainer. OBS-URL: https://build.opensuse.org/request/show/447165 OBS-URL: https://build.opensuse.org/package/show/security/argon2?expand=0&rev=1 --- .gitattributes | 23 ++++++++ .gitignore | 1 + argon2.changes | 5 ++ argon2.spec | 92 +++++++++++++++++++++++++++++++ optflags.patch | 66 ++++++++++++++++++++++ phc-winner-argon2-20161029.tar.gz | 3 + 6 files changed, 190 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 argon2.changes create mode 100644 argon2.spec create mode 100644 optflags.patch create mode 100644 phc-winner-argon2-20161029.tar.gz 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/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/argon2.changes b/argon2.changes new file mode 100644 index 0000000..ac4f49f --- /dev/null +++ b/argon2.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +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..d9e770d --- /dev/null +++ b/argon2.spec @@ -0,0 +1,92 @@ +# +# spec file for package argon2 +# +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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 http://bugs.opensuse.org/ +# + + +%define lname libargon2-0 +%define _version 20161029 +Name: argon2 +Version: 0.0+%{_version} +Release: 0 +Summary: The reference C implementation of Argon2 +License: CC0-1.0 or Apache-2.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/%{_version}.tar.gz#/phc-winner-argon2-%{_version}.tar.gz +Patch1: optflags.patch +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). + +Argon2 is a password-hashing function that summarizes the state of the art in +the design of memory-hard functions and can be used to hash passwords for +credential storage, key derivation, or other applications. + +%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). + +%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). + +%prep +%setup -q -n phc-winner-argon2-%{_version} +%patch1 -p1 + +sed -i s,"LIBRARY_REL = lib","LIBRARY_REL = %{_lib}", Makefile + +%build +make %{?_smp_mflags} CFLAGS="%{optflags} -Iinclude -Isrc" LDFLAGS="-lpthread" %{?_smp_mflags} + +%install +make %{?_smp_mflags} DESTDIR=%{buildroot} install + +chmod -x %{buildroot}%{_includedir}/argon2.h + +mv %{buildroot}%{_libdir}/libargon2.so %{buildroot}%{_libdir}/libargon2.so.0 +ln -s %{_libdir}/libargon2.so.0 %{buildroot}%{_libdir}/libargon2.so + +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc LICENSE CHANGELOG.md README.md argon2-specs.pdf +%{_bindir}/argon2 + +%files -n %{lname} +%defattr(-,root,root) +%{_libdir}/libargon2.so.0 + +%files devel +%defattr(-,root,root) +%{_includedir}/argon2.h +%{_libdir}/libargon2.so + +%changelog diff --git a/optflags.patch b/optflags.patch new file mode 100644 index 0000000..2da25a8 --- /dev/null +++ b/optflags.patch @@ -0,0 +1,66 @@ +Index: phc-winner-argon2-20161029/Makefile +=================================================================== +--- phc-winner-argon2-20161029.orig/Makefile ++++ phc-winner-argon2-20161029/Makefile +@@ -21,28 +21,14 @@ GENKAT = genkat + + DIST = phc-winner-argon2 + +-SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c ++SRC = src/argon2.c src/core.c src/blake2/blake2b.c src/thread.c src/encoding.c src/opt.c + SRC_RUN = src/run.c + SRC_BENCH = src/bench.c + SRC_GENKAT = src/genkat.c + OBJ = $(SRC:.c=.o) + +-CFLAGS += -std=c89 -pthread -O3 -Wall -g -Iinclude -Isrc +-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) +- SRC += src/opt.c +-endif + + BUILD_PATH := $(shell pwd) + KERNEL_NAME := $(shell uname -s) +@@ -88,7 +74,7 @@ endif + + LIB_SH := lib$(LIB_NAME).$(LIB_EXT) + LIB_ST := lib$(LIB_NAME).a +-LIBRARIES = $(LIB_SH) $(LIB_ST) ++LIBRARIES = $(LIB_SH) + HEADERS = include/argon2.h + + INSTALL = install +@@ -105,11 +91,11 @@ INST_BINARY = $(DESTDIR)$(PREFIX)/$(BINA + + .PHONY: clean dist format $(GENKAT) all install + +-all: clean $(RUN) libs ++all: $(RUN) libs + libs: $(LIBRARIES) + + $(RUN): $(SRC) $(SRC_RUN) +- $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ ++ $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) + + $(BENCH): $(SRC) $(SRC_BENCH) + $(CC) $(CFLAGS) $^ -o $@ +@@ -118,7 +104,7 @@ $(GENKAT): $(SRC) $(SRC_GENKAT) + $(CC) $(CFLAGS) $^ -o $@ -DGENKAT + + $(LIB_SH): $(SRC) +- $(CC) $(CFLAGS) $(LIB_CFLAGS) $(LDFLAGS) $(SO_LDFLAGS) $^ -o $@ ++ $(CC) $(CFLAGS) $(LIB_CFLAGS) $(SO_LDFLAGS) $^ -o $@ $(LDFLAGS) + + $(LIB_ST): $(OBJ) + ar rcs $@ $^ diff --git a/phc-winner-argon2-20161029.tar.gz b/phc-winner-argon2-20161029.tar.gz new file mode 100644 index 0000000..adf850b --- /dev/null +++ b/phc-winner-argon2-20161029.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe0049728b946b58b94cc6db89b34e2d050c62325d16316a534d2bedd78cd5e7 +size 1506864