summaryrefslogtreecommitdiff
path: root/dev-python/cryptography
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-22 07:31:18 +0100
commit908778078736bd36f7a60a2d576d415cb8e000fa (patch)
treec6a4796c48b608c14dc7e9674cdbd38f905e3c15 /dev-python/cryptography
parent185fa19bbf68a4d4dca534d2b46729207a177f16 (diff)
gentoo resync : 22.05.2021
Diffstat (limited to 'dev-python/cryptography')
-rw-r--r--dev-python/cryptography/Manifest8
-rw-r--r--dev-python/cryptography/cryptography-3.3.2.ebuild66
-rw-r--r--dev-python/cryptography/cryptography-3.4.7-r1.ebuild (renamed from dev-python/cryptography/cryptography-3.4.7.ebuild)8
-rw-r--r--dev-python/cryptography/files/cryptography-3.4.7-py310.patch301
-rw-r--r--dev-python/cryptography/metadata.xml3
5 files changed, 310 insertions, 76 deletions
diff --git a/dev-python/cryptography/Manifest b/dev-python/cryptography/Manifest
index 89255e81fada..cd9da2a21abd 100644
--- a/dev-python/cryptography/Manifest
+++ b/dev-python/cryptography/Manifest
@@ -1,7 +1,5 @@
-DIST cryptography-3.3.2.tar.gz 539883 BLAKE2B e35de90362b24170c4025f67914e60c16fbf37fce6bcd5d6f3fe32e5a9bb60de8edbebcb1ff0450fabc9c244d4b1a4618c720b630f28c747fea17e9bf008f01f SHA512 55f6ee13342b3209b1fcb310f4c4d33d22856ee785cb2347e6ad36c34e9b42f6e0d5bece8e458b09663a5b78e34c4567fe7a211b51ca71f55ccc93e3f62dc5e4
+AUX cryptography-3.4.7-py310.patch 8611 BLAKE2B 6cabc8056658f6a0c895a75b287ebfaa3d25c4ba9f95e28bf63c34bb87ccccdb4b04e42c5d72fdb4d889560e1ca13c602755fa05b9bab3b1fe05788abe110964 SHA512 d1c89a6c50fd4032d6aedcf026592b52b1e38922ecc2a83e8defcee5b7b4845a66de45de897fd3c2022c6118591811b9fc25df7fdd33d219647e0923cd906a66
DIST cryptography-3.4.7.tar.gz 546893 BLAKE2B 49bc1e098ed1ba0181059b645f6668cda6332d196eaca55270ebce6e07e5bb6ab6724c5050fde20e89b7025773960d74ec782bb875badbbd5dc9a04db0a536f1 SHA512 3c4cf64bc0b067ccdbb71efe04c32ac9d673faea6cc4ccd13d6b1b61920be4785806d19359b7657d032a2ff1c011a8b4f16ec4924d9df8a59d1a875a7f844473
-DIST cryptography_vectors-3.3.2.tar.gz 35168168 BLAKE2B 3991a16556ae5be0d153cfe302dd9a860918a80bd0bdef7104f3c170ba63941c4b1ff74750bc12329422a6061161cb6452bea60e191d85c0d79e0852566c6c0b SHA512 18590adb96a6f04b8a41d4346b126b8adfc854cbcec85f8c1c0a23b1b363f215b37da60ea94a481b8fd7752f07fba515b08fc18faf2e29fb858e133129971f7c
DIST cryptography_vectors-3.4.7.tar.gz 35168102 BLAKE2B fbefd3ff96548dde012fd290aba1c99d57db376023d486910e486cc9c143461ef1ae9b77824cc03307723d35142f0360bc961b548a4edc02357d3f1a0e7e4e9f SHA512 269b50fa4c5300da6758006d12be42f998630d23053ef9af0eb588fc9e6994b044d8822cff105e338f4d0d746ed0e204a4a9c42f54667e355e1ce86e6754bbe9
-EBUILD cryptography-3.3.2.ebuild 1872 BLAKE2B a31b6dfac777d7f2f5231ace6f6756db1346828ca9a133983f5dc8b53da962094f8f21c6d3ac7fd022887e349482a3b880ba2ff3596dbdcd21917cb86a843185 SHA512 58d9903f52d9e7fef3f5199f458d78a6a3ba4d0c0739ad9c84e961d73d58677d1912a965bbc40d3cb8096e7444efef6b673efd713253370410f812cdf90ecde5
-EBUILD cryptography-3.4.7.ebuild 1871 BLAKE2B 5519a7695f3dab9518287891ee4d90f931f350645a5a435f86a1cba42717eb7583bcc204040b3449af0a9ba4a8226db0b6dd40e92581f4539b07f2d914006564 SHA512 4a570f33b371e44d1a4d6ffbfbb1f073ab6b7a3a8d29efa4f0433e9f8b34921c0677284bfad2341efe312386fdce21075e1487bff17aceb3c884418db02e1750
-MISC metadata.xml 499 BLAKE2B 2e4c37917ebb1604f399b0db4abe27b02b133a2cc8fb69fbbf52b6fdc0aee079dde61be188bfa5bca043a1804a670ffb53f6ab1e79147230166f696741fadad8 SHA512 26eda8b0a2ac91dce2946e18e941e2e75df15e4583e4ddb1f1329403eaae30db9976017f92981c462bfb8c8a559de2a2ea9531f4ac5ccb2d57cadb00e68e05ec
+EBUILD cryptography-3.4.7-r1.ebuild 1924 BLAKE2B 118c9da25288dd0ea6d0c263cab76effd59a21e445d295686c0a68b19581df9d0cf16ce72568bc03433cf2ff6c52d0f445823d35c239cf88afb3409d88bf9066 SHA512 b64add0ac3073045a970932e4f0486e32a18932d401b5c892e1f1922eddb895419d24b027ca033e7fa425447cfea2e5d8b3961108cdf2deb64bffcfaa18a52f0
+MISC metadata.xml 384 BLAKE2B 6dbfdd39bb24b2df61454716e308605ae1d35c3babd01f16556bbbab240e425434315cb2b80a2c3e8e9b18b237899b5fb96566a7ffefde2af3af1dcc2e08362b SHA512 c2806f846608bdd0720b589494e13f57ab2d64026747f2b13f412c9a0e9d2bef6b16fc357e4d16b74ad7a2a2af8daa5e28d0b6bfe4d2141ce68881c724fd24c7
diff --git a/dev-python/cryptography/cryptography-3.3.2.ebuild b/dev-python/cryptography/cryptography-3.3.2.ebuild
deleted file mode 100644
index fd7468560e2d..000000000000
--- a/dev-python/cryptography/cryptography-3.3.2.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 multiprocessing
-
-VEC_P=cryptography_vectors-${PV}
-DESCRIPTION="Library providing cryptographic recipes and primitives"
-HOMEPAGE="https://github.com/pyca/cryptography/ https://pypi.org/project/cryptography/"
-SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
- test? ( mirror://pypi/c/cryptography_vectors/${VEC_P}.tar.gz )"
-
-LICENSE="|| ( Apache-2.0 BSD )"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="idna"
-
-RDEPEND="
- >=dev-python/six-1.4.1[${PYTHON_USEDEP}]
- idna? ( >=dev-python/idna-2.1[${PYTHON_USEDEP}] )
- $(python_gen_cond_dep '
- >=dev-python/cffi-1.8:=[${PYTHON_USEDEP}]
- ' 'python*')
- "
-BDEPEND="
- test? (
- >=dev-python/hypothesis-1.11.4[${PYTHON_USEDEP}]
- dev-python/iso8601[${PYTHON_USEDEP}]
- dev-python/pretend[${PYTHON_USEDEP}]
- dev-python/pyasn1-modules[${PYTHON_USEDEP}]
- dev-python/pytz[${PYTHON_USEDEP}]
- dev-python/pytest-xdist[${PYTHON_USEDEP}]
- )"
-
-distutils_enable_tests pytest
-
-DEPEND="
- >=dev-libs/openssl-1.0.2o-r6:0=
- "
-RDEPEND+=${DEPEND}
-
-DOCS=( AUTHORS.rst CONTRIBUTING.rst README.rst )
-
-src_prepare() {
- default
-
- # work around availability macros not supported in GCC (yet)
- if [[ ${CHOST} == *-darwin* ]] ; then
- local darwinok=0
- if [[ ${CHOST##*-darwin} -ge 16 ]] ; then
- darwinok=1
- fi
- sed -i -e 's/__builtin_available(macOS 10\.12, \*)/'"${darwinok}"'/' \
- src/_cffi_src/openssl/src/osrandom_engine.c || die
- fi
-}
-
-python_test() {
- local -x PYTHONPATH=${PYTHONPATH}:${WORKDIR}/${VEC_P}
- pytest -vv -n "$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")" ||
- die "Tests fail with ${EPYTHON}"
-}
diff --git a/dev-python/cryptography/cryptography-3.4.7.ebuild b/dev-python/cryptography/cryptography-3.4.7-r1.ebuild
index 59b98063ce3e..97946e3dd07f 100644
--- a/dev-python/cryptography/cryptography-3.4.7.ebuild
+++ b/dev-python/cryptography/cryptography-3.4.7-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
+PYTHON_COMPAT=( python3_{7..10} pypy3 )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 multiprocessing
@@ -16,7 +16,7 @@ SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
LICENSE="|| ( Apache-2.0 BSD )"
SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ppc ppc64 ~riscv sparc x86"
RDEPEND="
$(python_gen_cond_dep '
@@ -41,6 +41,10 @@ DEPEND="
"
RDEPEND+=${DEPEND}
+PATCHES=(
+ "${FILESDIR}/${P}-py310.patch"
+)
+
src_prepare() {
default
diff --git a/dev-python/cryptography/files/cryptography-3.4.7-py310.patch b/dev-python/cryptography/files/cryptography-3.4.7-py310.patch
new file mode 100644
index 000000000000..d961af82b774
--- /dev/null
+++ b/dev-python/cryptography/files/cryptography-3.4.7-py310.patch
@@ -0,0 +1,301 @@
+diff --git a/src/cryptography/exceptions.py b/src/cryptography/exceptions.py
+index f5860590..3bd98d82 100644
+--- a/src/cryptography/exceptions.py
++++ b/src/cryptography/exceptions.py
+@@ -3,10 +3,10 @@
+ # for complete details.
+
+
+-from enum import Enum
++from cryptography import utils
+
+
+-class _Reasons(Enum):
++class _Reasons(utils.Enum):
+ BACKEND_MISSING_INTERFACE = 0
+ UNSUPPORTED_HASH = 1
+ UNSUPPORTED_CIPHER = 2
+diff --git a/src/cryptography/hazmat/primitives/_serialization.py b/src/cryptography/hazmat/primitives/_serialization.py
+index 96a5ed9b..160a6b89 100644
+--- a/src/cryptography/hazmat/primitives/_serialization.py
++++ b/src/cryptography/hazmat/primitives/_serialization.py
+@@ -3,13 +3,14 @@
+ # for complete details.
+
+ import abc
+-from enum import Enum
++
++from cryptography import utils
+
+ # This exists to break an import cycle. These classes are normally accessible
+ # from the serialization module.
+
+
+-class Encoding(Enum):
++class Encoding(utils.Enum):
+ PEM = "PEM"
+ DER = "DER"
+ OpenSSH = "OpenSSH"
+@@ -18,14 +19,14 @@ class Encoding(Enum):
+ SMIME = "S/MIME"
+
+
+-class PrivateFormat(Enum):
++class PrivateFormat(utils.Enum):
+ PKCS8 = "PKCS8"
+ TraditionalOpenSSL = "TraditionalOpenSSL"
+ Raw = "Raw"
+ OpenSSH = "OpenSSH"
+
+
+-class PublicFormat(Enum):
++class PublicFormat(utils.Enum):
+ SubjectPublicKeyInfo = "X.509 subjectPublicKeyInfo with PKCS#1"
+ PKCS1 = "Raw PKCS#1"
+ OpenSSH = "OpenSSH"
+@@ -34,7 +35,7 @@ class PublicFormat(Enum):
+ UncompressedPoint = "X9.62 Uncompressed Point"
+
+
+-class ParameterFormat(Enum):
++class ParameterFormat(utils.Enum):
+ PKCS3 = "PKCS3"
+
+
+diff --git a/src/cryptography/hazmat/primitives/kdf/kbkdf.py b/src/cryptography/hazmat/primitives/kdf/kbkdf.py
+index ac36474f..75fe7d51 100644
+--- a/src/cryptography/hazmat/primitives/kdf/kbkdf.py
++++ b/src/cryptography/hazmat/primitives/kdf/kbkdf.py
+@@ -4,7 +4,6 @@
+
+
+ import typing
+-from enum import Enum
+
+ from cryptography import utils
+ from cryptography.exceptions import (
+@@ -19,11 +18,11 @@ from cryptography.hazmat.primitives import constant_time, hashes, hmac
+ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
+
+
+-class Mode(Enum):
++class Mode(utils.Enum):
+ CounterMode = "ctr"
+
+
+-class CounterLocation(Enum):
++class CounterLocation(utils.Enum):
+ BeforeFixed = "before_fixed"
+ AfterFixed = "after_fixed"
+
+diff --git a/src/cryptography/hazmat/primitives/serialization/pkcs7.py b/src/cryptography/hazmat/primitives/serialization/pkcs7.py
+index bcd9e330..57aac7e3 100644
+--- a/src/cryptography/hazmat/primitives/serialization/pkcs7.py
++++ b/src/cryptography/hazmat/primitives/serialization/pkcs7.py
+@@ -3,8 +3,8 @@
+ # for complete details.
+
+ import typing
+-from enum import Enum
+
++from cryptography import utils
+ from cryptography import x509
+ from cryptography.hazmat.backends import _get_backend
+ from cryptography.hazmat.primitives import hashes, serialization
+@@ -35,7 +35,7 @@ _ALLOWED_PRIVATE_KEY_TYPES = typing.Union[
+ ]
+
+
+-class PKCS7Options(Enum):
++class PKCS7Options(utils.Enum):
+ Text = "Add text/plain MIME type"
+ Binary = "Don't translate input data into canonical MIME format"
+ DetachedSignature = "Don't embed data in the PKCS7 structure"
+diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
+index ef0fc443..9e571cfd 100644
+--- a/src/cryptography/utils.py
++++ b/src/cryptography/utils.py
+@@ -4,6 +4,7 @@
+
+
+ import abc
++import enum
+ import inspect
+ import sys
+ import typing
+@@ -162,3 +163,13 @@ int_from_bytes = deprecated(
+ "int_from_bytes is deprecated, use int.from_bytes instead",
+ DeprecatedIn34,
+ )
++
++
++# Python 3.10 changed representation of enums. We use well-defined object
++# representation and string representation from Python 3.9.
++class Enum(enum.Enum):
++ def __repr__(self):
++ return f"<{self.__class__.__name__}.{self._name_}: {self._value_!r}>"
++
++ def __str__(self):
++ return f"{self.__class__.__name__}.{self._name_}"
+diff --git a/src/cryptography/x509/base.py b/src/cryptography/x509/base.py
+index 5505fa3b..e3846c33 100644
+--- a/src/cryptography/x509/base.py
++++ b/src/cryptography/x509/base.py
+@@ -7,9 +7,9 @@ import abc
+ import datetime
+ import os
+ import typing
+-from enum import Enum
+
+ from cryptography.hazmat._types import _PRIVATE_KEY_TYPES, _PUBLIC_KEY_TYPES
++from cryptography import utils
+ from cryptography.hazmat.backends import _get_backend
+ from cryptography.hazmat.primitives import hashes, serialization
+ from cryptography.hazmat.primitives.asymmetric import (
+@@ -66,7 +66,7 @@ def _convert_to_naive_utc_time(time: datetime.datetime) -> datetime.datetime:
+ return time
+
+
+-class Version(Enum):
++class Version(utils.Enum):
+ v1 = 0
+ v3 = 2
+
+diff --git a/src/cryptography/x509/certificate_transparency.py b/src/cryptography/x509/certificate_transparency.py
+index d51bee92..d80f051a 100644
+--- a/src/cryptography/x509/certificate_transparency.py
++++ b/src/cryptography/x509/certificate_transparency.py
+@@ -5,15 +5,16 @@
+
+ import abc
+ import datetime
+-from enum import Enum
+
++from cryptography import utils
+
+-class LogEntryType(Enum):
++
++class LogEntryType(utils.Enum):
+ X509_CERTIFICATE = 0
+ PRE_CERTIFICATE = 1
+
+
+-class Version(Enum):
++class Version(utils.Enum):
+ v1 = 0
+
+
+diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
+index 6cae016a..742f1fa2 100644
+--- a/src/cryptography/x509/extensions.py
++++ b/src/cryptography/x509/extensions.py
+@@ -8,7 +8,6 @@ import datetime
+ import hashlib
+ import ipaddress
+ import typing
+-from enum import Enum
+
+ from cryptography import utils
+ from cryptography.hazmat._der import (
+@@ -634,7 +633,7 @@ class DistributionPoint(object):
+ crl_issuer = utils.read_only_property("_crl_issuer")
+
+
+-class ReasonFlags(Enum):
++class ReasonFlags(utils.Enum):
+ unspecified = "unspecified"
+ key_compromise = "keyCompromise"
+ ca_compromise = "cACompromise"
+@@ -978,7 +977,7 @@ class TLSFeature(ExtensionType):
+ return hash(tuple(self._features))
+
+
+-class TLSFeatureType(Enum):
++class TLSFeatureType(utils.Enum):
+ # status_request is defined in RFC 6066 and is used for what is commonly
+ # called OCSP Must-Staple when present in the TLS Feature extension in an
+ # X.509 certificate.
+diff --git a/src/cryptography/x509/name.py b/src/cryptography/x509/name.py
+index a579aa21..9069a9f4 100644
+--- a/src/cryptography/x509/name.py
++++ b/src/cryptography/x509/name.py
+@@ -3,14 +3,13 @@
+ # for complete details.
+
+ import typing
+-from enum import Enum
+
+ from cryptography import utils
+ from cryptography.hazmat.backends import _get_backend
+ from cryptography.x509.oid import NameOID, ObjectIdentifier
+
+
+-class _ASN1Type(Enum):
++class _ASN1Type(utils.Enum):
+ UTF8String = 12
+ NumericString = 18
+ PrintableString = 19
+diff --git a/src/cryptography/x509/ocsp.py b/src/cryptography/x509/ocsp.py
+index 1c5de73e..bcf210c1 100644
+--- a/src/cryptography/x509/ocsp.py
++++ b/src/cryptography/x509/ocsp.py
+@@ -6,8 +6,8 @@
+ import abc
+ import datetime
+ import typing
+-from enum import Enum
+
++from cryptography import utils
+ from cryptography import x509
+ from cryptography.hazmat.primitives import hashes, serialization
+ from cryptography.x509.base import (
+@@ -27,12 +27,12 @@ _OIDS_TO_HASH = {
+ }
+
+
+-class OCSPResponderEncoding(Enum):
++class OCSPResponderEncoding(utils.Enum):
+ HASH = "By Hash"
+ NAME = "By Name"
+
+
+-class OCSPResponseStatus(Enum):
++class OCSPResponseStatus(utils.Enum):
+ SUCCESSFUL = 0
+ MALFORMED_REQUEST = 1
+ INTERNAL_ERROR = 2
+@@ -58,7 +58,7 @@ def _verify_algorithm(algorithm):
+ )
+
+
+-class OCSPCertStatus(Enum):
++class OCSPCertStatus(utils.Enum):
+ GOOD = 0
+ REVOKED = 1
+ UNKNOWN = 2
+diff --git a/tests/test_cryptography_utils.py b/tests/test_cryptography_utils.py
+index 6b795e0c..803997ac 100644
+--- a/tests/test_cryptography_utils.py
++++ b/tests/test_cryptography_utils.py
+@@ -2,6 +2,7 @@
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
+ # for complete details.
+
++import enum
+ import typing
+
+ import pytest
+@@ -51,3 +52,13 @@ class TestCachedProperty(object):
+ assert len(accesses) == 1
+ assert t.t == 14
+ assert len(accesses) == 1
++
++
++def test_enum():
++ class TestEnum(utils.Enum):
++ value = "something"
++
++ assert issubclass(TestEnum, enum.Enum)
++ assert isinstance(TestEnum.value, enum.Enum)
++ assert repr(TestEnum.value) == "<TestEnum.value: 'something'>"
++ assert str(TestEnum.value) == "TestEnum.value"
diff --git a/dev-python/cryptography/metadata.xml b/dev-python/cryptography/metadata.xml
index ff02c2b32ae2..2dfa57bc0fb6 100644
--- a/dev-python/cryptography/metadata.xml
+++ b/dev-python/cryptography/metadata.xml
@@ -5,9 +5,6 @@
<email>python@gentoo.org</email>
<name>Python</name>
</maintainer>
- <use>
- <flag name="idna">enable support for the old, deprecated IDNA specification (RFC 3490)</flag>
- </use>
<upstream>
<remote-id type="pypi">cryptography</remote-id>
<remote-id type="github">pyca/cryptography</remote-id>