diff options
author | Kubilay Kocak <koobs@FreeBSD.org> | 2019-06-03 05:23:26 +0000 |
---|---|---|
committer | Kubilay Kocak <koobs@FreeBSD.org> | 2019-06-03 05:23:26 +0000 |
commit | cabc32bb88b56b15aaa3043f30b7ef794b6c288a (patch) | |
tree | c0ca86461815d392c885d07afa40befbdcdf73ec /security/py-argon2-cffi | |
parent | 08110940c77668d74895c075d49f9d361a8c4b88 (diff) | |
download | ports-cabc32bb88b56b15aaa3043f30b7ef794b6c288a.tar.gz ports-cabc32bb88b56b15aaa3043f30b7ef794b6c288a.zip |
[NEW] security/py-argon2-cffi: Secure Argon2 password hashing algorithm
Argon2 won the Password Hashing Competition and argon2_cffi is the simplest
way to use it in Python and PyPy:
passlib 1.7.0 and later offers Argon2 support using this library too.
WWW: https://argon2-cffi.readthedocs.io/
Notes
Notes:
svn path=/head/; revision=503350
Diffstat (limited to 'security/py-argon2-cffi')
-rw-r--r-- | security/py-argon2-cffi/Makefile | 43 | ||||
-rw-r--r-- | security/py-argon2-cffi/distinfo | 3 | ||||
-rw-r--r-- | security/py-argon2-cffi/files/patch-tests_test__low__level.py | 22 | ||||
-rw-r--r-- | security/py-argon2-cffi/pkg-descr | 6 |
4 files changed, 74 insertions, 0 deletions
diff --git a/security/py-argon2-cffi/Makefile b/security/py-argon2-cffi/Makefile new file mode 100644 index 000000000000..76c3de758d6a --- /dev/null +++ b/security/py-argon2-cffi/Makefile @@ -0,0 +1,43 @@ +# $FreeBSD$ + +PORTNAME= argon2-cffi +PORTVERSION= 19.1.0 +CATEGORIES= security python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= ${PORTNAME:S/-/_/}-${PORTVERSION} + +MAINTAINER= koobs@FreeBSD.org +COMMENT= Secure Argon2 password hashing algorithm + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cffi>=1.0.0:devel/py-cffi@${PY_FLAVOR} +LIB_DEPENDS= libargon2.so:security/libargon2 +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cffi>=1.0.0:devel/py-cffi@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR} +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}hypothesis>0:devel/py-hypothesis@${PY_FLAVOR} + +USES= python localbase +USE_PYTHON= autoplist distutils + +MAKE_ENV+= ARGON2_CFFI_USE_SYSTEM=1 + +PYDISTUTILS_BUILD_TARGET= build_ext +PYDISTUTILS_BUILDARGS+= --inplace + +post-install: + ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/argon2/*.so + +do-test: + @cd ${WRKSRC} && PYTHONPATH=src ${PYTHON_CMD} -m pytest -v -rs + +.include <bsd.port.pre.mk> + +.if ${PYTHON_VER} < 3.4 +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}enum34>0:devel/py-enum34@${PY_FLAVOR} +.endif + +.include <bsd.port.post.mk> diff --git a/security/py-argon2-cffi/distinfo b/security/py-argon2-cffi/distinfo new file mode 100644 index 000000000000..eb7fc1783bd3 --- /dev/null +++ b/security/py-argon2-cffi/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1559532624 +SHA256 (argon2_cffi-19.1.0.tar.gz) = 81548a27b919861040cb928a350733f4f9455dd67c7d1ba92eb5960a1d7f8b26 +SIZE (argon2_cffi-19.1.0.tar.gz) = 1808120 diff --git a/security/py-argon2-cffi/files/patch-tests_test__low__level.py b/security/py-argon2-cffi/files/patch-tests_test__low__level.py new file mode 100644 index 000000000000..cdcde1e7d3e9 --- /dev/null +++ b/security/py-argon2-cffi/files/patch-tests_test__low__level.py @@ -0,0 +1,22 @@ +# Disable deadline on test_argument_ranges +# https://github.com/hynek/argon2_cffi/pull/52 + +--- tests/test_low_level.py.orig 2018-06-17 05:51:36 UTC ++++ tests/test_low_level.py +@@ -5,7 +5,7 @@ import os + + import pytest + +-from hypothesis import assume, given ++from hypothesis import assume, given, settings + from hypothesis import strategies as st + + from argon2.exceptions import ( +@@ -253,6 +253,7 @@ class TestVerify(object): + hash_len=st.integers(lib.ARGON2_MIN_OUTLEN, 513), + salt_len=st.integers(lib.ARGON2_MIN_SALT_LENGTH, 513), + ) ++@settings(deadline=None) + def test_argument_ranges( + password, time_cost, parallelism, memory_cost, hash_len, salt_len + ): diff --git a/security/py-argon2-cffi/pkg-descr b/security/py-argon2-cffi/pkg-descr new file mode 100644 index 000000000000..2c7c6261eba4 --- /dev/null +++ b/security/py-argon2-cffi/pkg-descr @@ -0,0 +1,6 @@ +Argon2 won the Password Hashing Competition and argon2_cffi is the simplest +way to use it in Python and PyPy: + +passlib 1.7.0 and later offers Argon2 support using this library too. + +WWW: https://argon2-cffi.readthedocs.io/ |