aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/backends/openssl/hashes.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-16 22:07:17 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2019-01-16 23:07:17 -0500
commitb480d2d4dbc6339f476d49faa0900eae2f4c1d07 (patch)
tree6e2345d51feefdec0abbdc878b44b84bdb859628 /src/cryptography/hazmat/backends/openssl/hashes.py
parentbfc6fae472457c37abafb3818b44f0bd639be6cc (diff)
downloadcryptography-b480d2d4dbc6339f476d49faa0900eae2f4c1d07.tar.gz
cryptography-b480d2d4dbc6339f476d49faa0900eae2f4c1d07.tar.bz2
cryptography-b480d2d4dbc6339f476d49faa0900eae2f4c1d07.zip
support byteslike in hash updates (#4702)
This is needed to handle keying material in some of the KDFs
Diffstat (limited to 'src/cryptography/hazmat/backends/openssl/hashes.py')
-rw-r--r--src/cryptography/hazmat/backends/openssl/hashes.py5
1 files changed, 4 insertions, 1 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):