From 915e0a1194400203b0e49e05de5facbc4ac8eb66 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 26 Sep 2015 09:55:15 -0400 Subject: converted a few more asserts --- src/cryptography/hazmat/backends/openssl/dsa.py | 2 +- src/cryptography/hazmat/backends/openssl/hashes.py | 2 +- src/cryptography/hazmat/backends/openssl/hmac.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cryptography/hazmat/backends/openssl/dsa.py b/src/cryptography/hazmat/backends/openssl/dsa.py index a442bfb7..9b4c1aff 100644 --- a/src/cryptography/hazmat/backends/openssl/dsa.py +++ b/src/cryptography/hazmat/backends/openssl/dsa.py @@ -83,7 +83,7 @@ class _DSASignatureContext(object): 0, data_to_sign, len(data_to_sign), sig_buf, buflen, self._private_key._dsa_cdata) self._backend.openssl_assert(res == 1) - assert buflen[0] + self._backend.openssl_assert(buflen[0]) return self._backend._ffi.buffer(sig_buf)[:buflen[0]] diff --git a/src/cryptography/hazmat/backends/openssl/hashes.py b/src/cryptography/hazmat/backends/openssl/hashes.py index a6b65f22..02ce5f0d 100644 --- a/src/cryptography/hazmat/backends/openssl/hashes.py +++ b/src/cryptography/hazmat/backends/openssl/hashes.py @@ -56,7 +56,7 @@ class _HashContext(object): outlen = self._backend._ffi.new("unsigned int *") res = self._backend._lib.EVP_DigestFinal_ex(self._ctx, buf, outlen) self._backend.openssl_assert(res != 0) - assert outlen[0] == self.algorithm.digest_size + self._backend.openssl_assert(outlen[0] == self.algorithm.digest_size) res = self._backend._lib.EVP_MD_CTX_cleanup(self._ctx) self._backend.openssl_assert(res == 1) return self._backend._ffi.buffer(buf)[:outlen[0]] diff --git a/src/cryptography/hazmat/backends/openssl/hmac.py b/src/cryptography/hazmat/backends/openssl/hmac.py index 52c691a5..dcf2fbaf 100644 --- a/src/cryptography/hazmat/backends/openssl/hmac.py +++ b/src/cryptography/hazmat/backends/openssl/hmac.py @@ -71,7 +71,7 @@ class _HMACContext(object): self._ctx, buf, outlen ) self._backend.openssl_assert(res != 0) - assert outlen[0] == self.algorithm.digest_size + self._backend.openssl_assert(outlen[0] == self.algorithm.digest_size) self._backend._lib.HMAC_CTX_cleanup(self._ctx) return self._backend._ffi.buffer(buf)[:outlen[0]] -- cgit v1.2.3