diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-06 08:52:57 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-06 08:52:57 -0500 |
commit | 4c8bc092a56744f6af9041cb3c4e579731472deb (patch) | |
tree | 906940e1e96172eac4c8fa3c3b91f4f15cf245e2 | |
parent | 6b99130f2e49271cf46af0b5a5f1fa364f9b2465 (diff) | |
parent | 3873dae7aacece2ec80c9a24f4885993eaa4c281 (diff) | |
download | cryptography-4c8bc092a56744f6af9041cb3c4e579731472deb.tar.gz cryptography-4c8bc092a56744f6af9041cb3c4e579731472deb.tar.bz2 cryptography-4c8bc092a56744f6af9041cb3c4e579731472deb.zip |
Merge pull request #1723 from public/strict-bn-int
Stricter asserts on _bn_to_int and _int_to_bn
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/backend.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py index de653032..27d5e353 100644 --- a/src/cryptography/hazmat/backends/openssl/backend.py +++ b/src/cryptography/hazmat/backends/openssl/backend.py @@ -320,6 +320,7 @@ class Backend(object): ) def _bn_to_int(self, bn): + assert bn != self._ffi.NULL if six.PY3: # Python 3 has constant time from_bytes, so use that. @@ -346,6 +347,7 @@ class Backend(object): ownership of the object). Be sure to register it for GC if it will be discarded after use. """ + assert bn is None or bn != self._ffi.NULL if bn is None: bn = self._ffi.NULL |