aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-09-26 09:55:15 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-09-26 09:55:15 -0400
commit915e0a1194400203b0e49e05de5facbc4ac8eb66 (patch)
treec2d328a451b25e9b66fbbbea74384def147e69b6 /src/cryptography/hazmat
parent3f3f20c7b429a19819e90e0bb181c5895e18c7dc (diff)
downloadcryptography-915e0a1194400203b0e49e05de5facbc4ac8eb66.tar.gz
cryptography-915e0a1194400203b0e49e05de5facbc4ac8eb66.tar.bz2
cryptography-915e0a1194400203b0e49e05de5facbc4ac8eb66.zip
converted a few more asserts
Diffstat (limited to 'src/cryptography/hazmat')
-rw-r--r--src/cryptography/hazmat/backends/openssl/dsa.py2
-rw-r--r--src/cryptography/hazmat/backends/openssl/hashes.py2
-rw-r--r--src/cryptography/hazmat/backends/openssl/hmac.py2
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]]