aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/ciphers/base.py34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/cryptography/hazmat/primitives/ciphers/base.py b/src/cryptography/hazmat/primitives/ciphers/base.py
index 826e23ef..f8570414 100644
--- a/src/cryptography/hazmat/primitives/ciphers/base.py
+++ b/src/cryptography/hazmat/primitives/ciphers/base.py
@@ -6,8 +6,6 @@ from __future__ import absolute_import, division, print_function
import abc
-import cffi
-
import six
from cryptography import utils
@@ -150,19 +148,10 @@ class _CipherContext(object):
raise AlreadyFinalized("Context was already finalized.")
return self._ctx.update(data)
- # cffi 1.7 supports from_buffer on bytearray, which is required. We can
- # remove this check in the future when we raise our minimum PyPy version.
- if cffi.__version_info__ >= (1, 7):
- def update_into(self, data, buf):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return self._ctx.update_into(data, buf)
- else:
- def update_into(self, data, buf):
- raise NotImplementedError(
- "update_into requires cffi 1.7+. To use this method please "
- "update cffi."
- )
+ def update_into(self, data, buf):
+ if self._ctx is None:
+ raise AlreadyFinalized("Context was already finalized.")
+ return self._ctx.update_into(data, buf)
def finalize(self):
if self._ctx is None:
@@ -199,18 +188,9 @@ class _AEADCipherContext(object):
self._check_limit(len(data))
return self._ctx.update(data)
- # cffi 1.7 supports from_buffer on bytearray, which is required. We can
- # remove this check in the future when we raise our minimum PyPy version.
- if cffi.__version_info__ >= (1, 7):
- def update_into(self, data, buf):
- self._check_limit(len(data))
- return self._ctx.update_into(data, buf)
- else:
- def update_into(self, data, buf):
- raise NotImplementedError(
- "update_into requires cffi 1.7+. To use this method please "
- "update cffi."
- )
+ def update_into(self, data, buf):
+ self._check_limit(len(data))
+ return self._ctx.update_into(data, buf)
def finalize(self):
if self._ctx is None: