aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 09:52:20 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2013-10-20 09:52:20 -0700
commitfb84cadbe89aceee31ba42f1c4aec10391864897 (patch)
tree5f7940fd15b3a2d6dd6843b2de3adb8007ea8e1d
parent56ac648704e5515f44ffc3607faa36fb6f7fd2e5 (diff)
downloadcryptography-fb84cadbe89aceee31ba42f1c4aec10391864897.tar.gz
cryptography-fb84cadbe89aceee31ba42f1c4aec10391864897.tar.bz2
cryptography-fb84cadbe89aceee31ba42f1c4aec10391864897.zip
Use more precise assertions
-rw-r--r--cryptography/bindings/openssl/api.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py
index f6b6677f..9d5cbfbc 100644
--- a/cryptography/bindings/openssl/api.py
+++ b/cryptography/bindings/openssl/api.py
@@ -144,7 +144,7 @@ class API(object):
res = self.lib.EVP_EncryptFinal_ex(ctx, buf, outlen)
assert res != 0
res = self.lib.EVP_CIPHER_CTX_cleanup(ctx)
- assert res != 0
+ assert res == 1
return self.ffi.buffer(buf)[:outlen[0]]
def supports_hash(self, hash_cls):
@@ -169,7 +169,7 @@ class API(object):
res = self.lib.EVP_DigestFinal_ex(ctx, buf, self.ffi.NULL)
assert res != 0
res = self.lib.EVP_MD_CTX_cleanup(ctx)
- assert res != 0
+ assert res == 1
return self.ffi.buffer(buf)[:digest_size]
def copy_hash_context(self, ctx):