Initial import (#1560764).
This commit is contained in:
parent
73e170d312
commit
30b89d7096
|
@ -0,0 +1 @@
|
|||
/argon2_0.2-0.tar.gz
|
|
@ -0,0 +1,88 @@
|
|||
From 1fef97eb3dfa1b7e3a88884b2eb448ad7f47363c Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Mon, 26 Mar 2018 01:33:04 -0400
|
||||
Subject: [PATCH] Build against system libraries.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
src/Makevars | 14 +++-----------
|
||||
src/argon2.c | 2 +-
|
||||
src/blake2.c | 4 ++--
|
||||
src/raw_as_char.c | 1 -
|
||||
4 files changed, 6 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/Makevars b/src/Makevars
|
||||
index 3f6df55..7b82ba7 100644
|
||||
--- a/src/Makevars
|
||||
+++ b/src/Makevars
|
||||
@@ -1,17 +1,9 @@
|
||||
-PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
|
||||
-PKG_LIBS = $(SHLIB_OPENMP_CFLAGS)
|
||||
-
|
||||
-ARGON2_OBJS = \
|
||||
- argon2/blake2/blake2b.o \
|
||||
- argon2/argon2.o \
|
||||
- argon2/core.o \
|
||||
- argon2/encoding.o \
|
||||
- argon2/ref.o \
|
||||
- argon2/thread.o
|
||||
+PKG_CFLAGS = $(shell pkg-config --cflags libargon2) $(SHLIB_OPENMP_CFLAGS)
|
||||
+PKG_LIBS = $(shell pkg-config --libs libargon2) -lb2 $(SHLIB_OPENMP_CFLAGS)
|
||||
|
||||
R_OBJS = argon2_native.o argon2.o blake2.o gen_nonce.o raw_as_char.o
|
||||
|
||||
-OBJECTS = $(ARGON2_OBJS) $(R_OBJS)
|
||||
+OBJECTS = $(R_OBJS)
|
||||
|
||||
all: $(SHLIB)
|
||||
|
||||
diff --git a/src/argon2.c b/src/argon2.c
|
||||
index e5099a7..46ff6ba 100644
|
||||
--- a/src/argon2.c
|
||||
+++ b/src/argon2.c
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
#include "common.h"
|
||||
-#include "argon2/argon2.h"
|
||||
+#include "argon2.h"
|
||||
|
||||
#define CHECKRET(check) if (check != ARGON2_OK) error("%s\n", argon2_error_message(check))
|
||||
|
||||
diff --git a/src/blake2.c b/src/blake2.c
|
||||
index 286bed1..a8e91ae 100644
|
||||
--- a/src/blake2.c
|
||||
+++ b/src/blake2.c
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
#include "common.h"
|
||||
-#include "argon2/blake2/blake2.h"
|
||||
+#include "blake2.h"
|
||||
|
||||
#define HASHLEN 64
|
||||
|
||||
@@ -81,7 +81,7 @@ SEXP R_blake2b(SEXP in_, SEXP key_)
|
||||
PROTECT(ret = allocVector(RAWSXP, HASHLEN));
|
||||
uchar_t *const hash = RAW(ret);
|
||||
|
||||
- blake2b(hash, HASHLEN, in, inlen, key, keylen);
|
||||
+ blake2b(hash, in, key, HASHLEN, inlen, keylen);
|
||||
|
||||
UNPROTECT(1);
|
||||
return ret;
|
||||
diff --git a/src/raw_as_char.c b/src/raw_as_char.c
|
||||
index 3ea80cd..67fc383 100644
|
||||
--- a/src/raw_as_char.c
|
||||
+++ b/src/raw_as_char.c
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include "common.h"
|
||||
-#include "argon2/blake2/blake2.h"
|
||||
|
||||
|
||||
SEXP R_raw_as_char(SEXP rawvec_, SEXP upper_, SEXP spaces_)
|
||||
--
|
||||
2.14.3
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
%global packname argon2
|
||||
%global rlibdir %{_libdir}/R/library
|
||||
|
||||
|
||||
Name: R-%{packname}
|
||||
Version: 0.2.0
|
||||
Release: 1%{?dist}
|
||||
Summary: Secure Password Hashing
|
||||
|
||||
License: BSD
|
||||
URL: https://cran.r-project.org/web/packages/%{packname}/index.html
|
||||
Source0: https://cran.r-project.org/src/contrib/%{packname}_0.2-0.tar.gz
|
||||
Patch0001: 0001-Build-against-system-libraries.patch
|
||||
|
||||
# Here's the R view of the dependencies world:
|
||||
# Depends:
|
||||
# Imports:
|
||||
# Suggests:
|
||||
# LinkingTo:
|
||||
# Enhances:
|
||||
|
||||
BuildRequires: R-devel tex(latex)
|
||||
BuildRequires: libargon2-devel >= 20161029
|
||||
BuildRequires: libb2-devel
|
||||
|
||||
%description
|
||||
Utilities for secure password hashing via the argon2 algorithm. It is a
|
||||
relatively new hashing algorithm and is believed to be very secure. The
|
||||
'argon2' implementation included in the package is the reference
|
||||
implementation. The package also includes some utilities that should be
|
||||
useful for digest authentication, including a wrapper of 'blake2b'. For
|
||||
similar R packages, see sodium and 'bcrypt'. See
|
||||
<https://en.wikipedia.org/wiki/Argon2> or
|
||||
<https://eprint.iacr.org/2015/430.pdf> for more information.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -c -n %{packname}
|
||||
|
||||
# Delete bundled libraries.
|
||||
pushd %{packname}
|
||||
rm -r src/argon2
|
||||
%patch0001 -p1
|
||||
popd
|
||||
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{rlibdir}
|
||||
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
|
||||
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
|
||||
rm -f %{buildroot}%{rlibdir}/R.css
|
||||
|
||||
|
||||
%check
|
||||
%{_bindir}/R CMD check %{packname}
|
||||
|
||||
|
||||
%files
|
||||
%dir %{rlibdir}/%{packname}
|
||||
%doc %{rlibdir}/%{packname}/html
|
||||
%{rlibdir}/%{packname}/DESCRIPTION
|
||||
%doc %{rlibdir}/%{packname}/CITATION
|
||||
%license %{rlibdir}/%{packname}/COPYRIGHTS
|
||||
%license %{rlibdir}/%{packname}/LICENSE
|
||||
%{rlibdir}/%{packname}/INDEX
|
||||
%{rlibdir}/%{packname}/NAMESPACE
|
||||
%{rlibdir}/%{packname}/Meta
|
||||
%{rlibdir}/%{packname}/R
|
||||
%{rlibdir}/%{packname}/help
|
||||
%dir %{rlibdir}/%{packname}/libs
|
||||
%{rlibdir}/%{packname}/libs/%{packname}.so
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Mar 17 2018 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.2.0-1
|
||||
- initial package for Fedora
|
Loading…
Reference in New Issue