aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Stapleton <alexs@prol.etari.at>2015-02-16 09:18:25 +0000
committerAlex Stapleton <alexs@prol.etari.at>2015-02-16 09:18:25 +0000
commitebc1717d73eaccffeddc32cee9eb0ad5936f7a4b (patch)
treeb75a606f28146b74b496fb45216f55a864a09e11
parentb8dc2f03ff2af2139ef9d77552562b0dce18d6bd (diff)
parente0a879f72fbd5bb9050c3637bdd012c25ad5e300 (diff)
downloadcryptography-ebc1717d73eaccffeddc32cee9eb0ad5936f7a4b.tar.gz
cryptography-ebc1717d73eaccffeddc32cee9eb0ad5936f7a4b.tar.bz2
cryptography-ebc1717d73eaccffeddc32cee9eb0ad5936f7a4b.zip
Merge pull request #1664 from alex/flake8
Fixed new flake8 warnings from teh latest version
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py15
-rw-r--r--tests/utils.py4
2 files changed, 10 insertions, 9 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index 75d7e32f..8441e891 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -225,8 +225,8 @@ class Backend(object):
)
def create_symmetric_encryption_ctx(self, cipher, mode):
- if (isinstance(mode, CTR) and isinstance(cipher, AES)
- and not self._evp_cipher_supported(cipher, mode)):
+ if (isinstance(mode, CTR) and isinstance(cipher, AES) and
+ not self._evp_cipher_supported(cipher, mode)):
# This is needed to provide support for AES CTR mode in OpenSSL
# 0.9.8. It can be removed when we drop 0.9.8 support (RHEL 5
# extended life ends 2020).
@@ -235,8 +235,8 @@ class Backend(object):
return _CipherContext(self, cipher, mode, _CipherContext._ENCRYPT)
def create_symmetric_decryption_ctx(self, cipher, mode):
- if (isinstance(mode, CTR) and isinstance(cipher, AES)
- and not self._evp_cipher_supported(cipher, mode)):
+ if (isinstance(mode, CTR) and isinstance(cipher, AES) and
+ not self._evp_cipher_supported(cipher, mode)):
# This is needed to provide support for AES CTR mode in OpenSSL
# 0.9.8. It can be removed when we drop 0.9.8 support (RHEL 5
# extended life ends 2020).
@@ -671,9 +671,10 @@ class Backend(object):
def cmac_algorithm_supported(self, algorithm):
return (
- self._lib.Cryptography_HAS_CMAC == 1
- and self.cipher_supported(algorithm, CBC(
- b"\x00" * algorithm.block_size))
+ self._lib.Cryptography_HAS_CMAC == 1 and
+ self.cipher_supported(
+ algorithm, CBC(b"\x00" * algorithm.block_size)
+ )
)
def create_cmac_ctx(self, algorithm):
diff --git a/tests/utils.py b/tests/utils.py
index 37efc580..65c99fbf 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -83,8 +83,8 @@ def load_nist_vectors(vector_data):
line = line.strip()
# Blank lines, comments, and section headers are ignored
- if not line or line.startswith("#") or (line.startswith("[")
- and line.endswith("]")):
+ if not line or line.startswith("#") or (line.startswith("[") and
+ line.endswith("]")):
continue
if line.strip() == "FAIL":