aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-02-20 15:18:54 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-02-20 15:18:54 -0800
commit5a2496b03ef3da161c96ddc6c891f081973739a9 (patch)
tree16372a9c8d3c6598f622fbd4c5440d48833bca92
parentdfee2f9522dac7c49a5d71e92397f182c20a259f (diff)
parentaa8af51fe6e3284e0913aa9f8bcfe2ebc2b881c5 (diff)
downloadcryptography-5a2496b03ef3da161c96ddc6c891f081973739a9.tar.gz
cryptography-5a2496b03ef3da161c96ddc6c891f081973739a9.tar.bz2
cryptography-5a2496b03ef3da161c96ddc6c891f081973739a9.zip
Merge pull request #656 from reaperhulk/fix-openssl-backend-variables
backend -> self
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 8a4aeac5..90d608fa 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -284,18 +284,19 @@ class Backend(object):
if key_size < 512:
raise ValueError("key_size must be at least 512-bits")
- ctx = backend._lib.RSA_new()
- ctx = backend._ffi.gc(ctx, backend._lib.RSA_free)
+ ctx = self._lib.RSA_new()
+ assert ctx != self._ffi.NULL
+ ctx = self._ffi.gc(ctx, self._lib.RSA_free)
- bn = backend._lib.BN_new()
+ bn = self._lib.BN_new()
assert bn != self._ffi.NULL
- bn = backend._ffi.gc(bn, backend._lib.BN_free)
+ bn = self._ffi.gc(bn, self._lib.BN_free)
- res = backend._lib.BN_set_word(bn, public_exponent)
+ res = self._lib.BN_set_word(bn, public_exponent)
assert res == 1
- res = backend._lib.RSA_generate_key_ex(
- ctx, key_size, bn, backend._ffi.NULL
+ res = self._lib.RSA_generate_key_ex(
+ ctx, key_size, bn, self._ffi.NULL
)
assert res == 1