Skip to content

Commit

Permalink
fix: remove checks for ancient versions of Cryptography (#596)
Browse files Browse the repository at this point in the history
Refs #595 (comment) 

I see no point in checking whether someone is running a version of https://github.com/pyca/cryptography/ from 2014 that doesn't even compile against modern versions of OpenSSL anymore.
  • Loading branch information
akx committed Oct 8, 2020
1 parent 7f957ba commit 6407258
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
13 changes: 0 additions & 13 deletions google/auth/crypt/_cryptography_rsa.py
Expand Up @@ -25,23 +25,10 @@
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import padding
import cryptography.x509
import pkg_resources

from google.auth import _helpers
from google.auth.crypt import base

_IMPORT_ERROR_MSG = (
"cryptography>=1.4.0 is required to use cryptography-based RSA " "implementation."
)

try: # pragma: NO COVER
release = pkg_resources.get_distribution("cryptography").parsed_version
if release < pkg_resources.parse_version("1.4.0"):
raise ImportError(_IMPORT_ERROR_MSG)
except pkg_resources.DistributionNotFound: # pragma: NO COVER
raise ImportError(_IMPORT_ERROR_MSG)


_CERTIFICATE_MARKER = b"-----BEGIN CERTIFICATE-----"
_BACKEND = backends.default_backend()
_PADDING = padding.PKCS1v15()
Expand Down
12 changes: 0 additions & 12 deletions google/auth/crypt/es256.py
Expand Up @@ -25,22 +25,10 @@
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
from cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature
import cryptography.x509
import pkg_resources

from google.auth import _helpers
from google.auth.crypt import base

_IMPORT_ERROR_MSG = (
"cryptography>=1.4.0 is required to use cryptography-based ECDSA " "algorithms"
)

try: # pragma: NO COVER
release = pkg_resources.get_distribution("cryptography").parsed_version
if release < pkg_resources.parse_version("1.4.0"):
raise ImportError(_IMPORT_ERROR_MSG)
except pkg_resources.DistributionNotFound: # pragma: NO COVER
raise ImportError(_IMPORT_ERROR_MSG)


_CERTIFICATE_MARKER = b"-----BEGIN CERTIFICATE-----"
_BACKEND = backends.default_backend()
Expand Down

0 comments on commit 6407258

Please sign in to comment.