aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/openssl/hashes.py5
-rw-r--r--src/cryptography/hazmat/primitives/hashes.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/hashes.py b/src/cryptography/hazmat/backends/openssl/hashes.py
index c39f57dc..e9a50705 100644
--- a/src/cryptography/hazmat/backends/openssl/hashes.py
+++ b/src/cryptography/hazmat/backends/openssl/hashes.py
@@ -47,7 +47,10 @@ class _HashContext(object):
return _HashContext(self._backend, self.algorithm, ctx=copied_ctx)
def update(self, data):
- res = self._backend._lib.EVP_DigestUpdate(self._ctx, data, len(data))
+ data_ptr = self._backend._ffi.from_buffer(data)
+ res = self._backend._lib.EVP_DigestUpdate(
+ self._ctx, data_ptr, len(data)
+ )
self._backend.openssl_assert(res != 0)
def finalize(self):
diff --git a/src/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py
index 35b7d646..0d6e47fb 100644
--- a/src/cryptography/hazmat/primitives/hashes.py
+++ b/src/cryptography/hazmat/primitives/hashes.py
@@ -82,7 +82,7 @@ class Hash(object):
def update(self, data):
if self._ctx is None:
raise AlreadyFinalized("Context was already finalized.")
- utils._check_bytes("data", data)
+ utils._check_byteslike("data", data)
self._ctx.update(data)
def copy(self):