aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'cryptography/hazmat')
-rw-r--r--cryptography/hazmat/backends/multibackend.py16
-rw-r--r--cryptography/hazmat/backends/openssl/dsa.py8
-rw-r--r--cryptography/hazmat/primitives/hmac.py8
3 files changed, 16 insertions, 16 deletions
diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py
index e873f504..c62b790c 100644
--- a/cryptography/hazmat/backends/multibackend.py
+++ b/cryptography/hazmat/backends/multibackend.py
@@ -47,33 +47,33 @@ class MultiBackend(object):
if isinstance(b, interface):
yield b
- def cipher_supported(self, algorithm, mode):
+ def cipher_supported(self, cipher, mode):
return any(
- b.cipher_supported(algorithm, mode)
+ b.cipher_supported(cipher, mode)
for b in self._filtered_backends(CipherBackend)
)
- def create_symmetric_encryption_ctx(self, algorithm, mode):
+ def create_symmetric_encryption_ctx(self, cipher, mode):
for b in self._filtered_backends(CipherBackend):
try:
- return b.create_symmetric_encryption_ctx(algorithm, mode)
+ return b.create_symmetric_encryption_ctx(cipher, mode)
except UnsupportedAlgorithm:
pass
raise UnsupportedAlgorithm(
"cipher {0} in {1} mode is not supported by this backend.".format(
- algorithm.name, mode.name if mode else mode),
+ cipher.name, mode.name if mode else mode),
_Reasons.UNSUPPORTED_CIPHER
)
- def create_symmetric_decryption_ctx(self, algorithm, mode):
+ def create_symmetric_decryption_ctx(self, cipher, mode):
for b in self._filtered_backends(CipherBackend):
try:
- return b.create_symmetric_decryption_ctx(algorithm, mode)
+ return b.create_symmetric_decryption_ctx(cipher, mode)
except UnsupportedAlgorithm:
pass
raise UnsupportedAlgorithm(
"cipher {0} in {1} mode is not supported by this backend.".format(
- algorithm.name, mode.name if mode else mode),
+ cipher.name, mode.name if mode else mode),
_Reasons.UNSUPPORTED_CIPHER
)
diff --git a/cryptography/hazmat/backends/openssl/dsa.py b/cryptography/hazmat/backends/openssl/dsa.py
index 2298e7d9..8652d50b 100644
--- a/cryptography/hazmat/backends/openssl/dsa.py
+++ b/cryptography/hazmat/backends/openssl/dsa.py
@@ -131,8 +131,8 @@ class _DSAPrivateKey(object):
key_size = utils.read_only_property("_key_size")
- def signer(self, algorithm):
- return _DSASignatureContext(self._backend, self, algorithm)
+ def signer(self, signature_algorithm):
+ return _DSASignatureContext(self._backend, self, signature_algorithm)
def private_numbers(self):
return dsa.DSAPrivateNumbers(
@@ -180,9 +180,9 @@ class _DSAPublicKey(object):
key_size = utils.read_only_property("_key_size")
- def verifier(self, signature, algorithm):
+ def verifier(self, signature, signature_algorithm):
return _DSAVerificationContext(
- self._backend, self, signature, algorithm
+ self._backend, self, signature, signature_algorithm
)
def public_numbers(self):
diff --git a/cryptography/hazmat/primitives/hmac.py b/cryptography/hazmat/primitives/hmac.py
index 23292432..b85fb2aa 100644
--- a/cryptography/hazmat/primitives/hmac.py
+++ b/cryptography/hazmat/primitives/hmac.py
@@ -42,12 +42,12 @@ class HMAC(object):
else:
self._ctx = ctx
- def update(self, msg):
+ def update(self, data):
if self._ctx is None:
raise AlreadyFinalized("Context was already finalized.")
- if not isinstance(msg, bytes):
- raise TypeError("msg must be bytes.")
- self._ctx.update(msg)
+ if not isinstance(data, bytes):
+ raise TypeError("data must be bytes.")
+ self._ctx.update(data)
def copy(self):
if self._ctx is None: