3.4.1 fixes and changelog bump (#5761)
* Try to assist folks having issues with older pips (#5757)
* Try to assist folks having issues with older pips
* Update setup.py
* Update setup.py
* fix import cycle with asymmetricpadding (#5758)
* fix import cycle with asymmetricpadding
* Update src/cryptography/hazmat/primitives/_asymmetric.py
* bump for 3.4.1
Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 15f9454..5fb6c47 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,15 @@
Changelog
=========
+.. _v3-4-1:
+
+3.4.1 - 2021-02-07
+~~~~~~~~~~~~~~~~~~
+
+* Fixed a circular import issue.
+* Added additional debug output to assist users seeing installation errors
+ due to outdated ``pip`` or missing ``rustc``.
+
.. _v3-4:
3.4 - 2021-02-07
diff --git a/setup.py b/setup.py
index 58de2f4..9fb3e32 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,21 @@
from setuptools import find_packages, setup
-from setuptools_rust import RustExtension
+try:
+ from setuptools_rust import RustExtension
+except ImportError:
+ print(
+ """
+ =============================DEBUG ASSISTANCE==========================
+ If you are seeing an error here please try the following to
+ successfully install cryptography:
+
+ Upgrade to the latest pip and try again. This will fix errors for most
+ users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
+ =============================DEBUG ASSISTANCE==========================
+ """
+ )
+ raise
base_dir = os.path.dirname(__file__)
diff --git a/src/cryptography/__about__.py b/src/cryptography/__about__.py
index 2e71757..339a934 100644
--- a/src/cryptography/__about__.py
+++ b/src/cryptography/__about__.py
@@ -21,7 +21,7 @@
)
__uri__ = "https://github.com/pyca/cryptography"
-__version__ = "3.4"
+__version__ = "3.4.1"
__author__ = "The Python Cryptographic Authority and individual contributors"
__email__ = "cryptography-dev@python.org"
diff --git a/src/cryptography/hazmat/primitives/_asymmetric.py b/src/cryptography/hazmat/primitives/_asymmetric.py
new file mode 100644
index 0000000..cdadbde
--- /dev/null
+++ b/src/cryptography/hazmat/primitives/_asymmetric.py
@@ -0,0 +1,17 @@
+# This file is dual licensed under the terms of the Apache License, Version
+# 2.0, and the BSD License. See the LICENSE file in the root of this repository
+# for complete details.
+
+import abc
+
+
+# This exists to break an import cycle. It is normally accessible from the
+# asymmetric padding module.
+
+
+class AsymmetricPadding(metaclass=abc.ABCMeta):
+ @abc.abstractproperty
+ def name(self) -> str:
+ """
+ A string naming this padding (e.g. "PSS", "PKCS1").
+ """
diff --git a/src/cryptography/hazmat/primitives/asymmetric/padding.py b/src/cryptography/hazmat/primitives/asymmetric/padding.py
index a3b850f..301c64c 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/padding.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/padding.py
@@ -3,21 +3,13 @@
# for complete details.
-import abc
import typing
from cryptography.hazmat.primitives import hashes
+from cryptography.hazmat.primitives._asymmetric import AsymmetricPadding
from cryptography.hazmat.primitives.asymmetric import rsa
-class AsymmetricPadding(metaclass=abc.ABCMeta):
- @abc.abstractproperty
- def name(self) -> str:
- """
- A string naming this padding (e.g. "PSS", "PKCS1").
- """
-
-
class PKCS1v15(AsymmetricPadding):
name = "EMSA-PKCS1-v1_5"
diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
index 3753560..213e518 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -12,12 +12,12 @@
from cryptography.hazmat.backends import _get_backend
from cryptography.hazmat.backends.interfaces import RSABackend
from cryptography.hazmat.primitives import _serialization, hashes
+from cryptography.hazmat.primitives._asymmetric import AsymmetricPadding
from cryptography.hazmat.primitives.asymmetric import (
AsymmetricSignatureContext,
AsymmetricVerificationContext,
utils as asym_utils,
)
-from cryptography.hazmat.primitives.asymmetric.padding import AsymmetricPadding
class RSAPrivateKey(metaclass=abc.ABCMeta):
diff --git a/vectors/cryptography_vectors/__about__.py b/vectors/cryptography_vectors/__about__.py
index bed5270..82e697f 100644
--- a/vectors/cryptography_vectors/__about__.py
+++ b/vectors/cryptography_vectors/__about__.py
@@ -18,7 +18,7 @@
__uri__ = "https://github.com/pyca/cryptography"
-__version__ = "3.4"
+__version__ = "3.4.1"
__author__ = "The Python Cryptographic Authority and individual contributors"
__email__ = "cryptography-dev@python.org"