diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-09-28 12:35:33 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-09-28 13:50:59 +0100 |
commit | 9c2227b97ff7b3aabe0f0a957a92c7628c447da1 (patch) | |
tree | 2b83c9bbe6a66eebff0c504bb7f77d3bef273f3b | |
parent | 68c9826cad2842e026a3f3fd6096f563315b988e (diff) | |
download | cryptography-9c2227b97ff7b3aabe0f0a957a92c7628c447da1.tar.gz cryptography-9c2227b97ff7b3aabe0f0a957a92c7628c447da1.tar.bz2 cryptography-9c2227b97ff7b3aabe0f0a957a92c7628c447da1.zip |
Rename some ctx vars to ec_cdata
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index ab083d88..2540a51f 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -980,14 +980,14 @@ class Backend(object): if self.elliptic_curve_supported(curve): curve_nid = self._elliptic_curve_to_nid(curve) - ctx = self._lib.EC_KEY_new_by_curve_name(curve_nid) - assert ctx != self._ffi.NULL - ctx = self._ffi.gc(ctx, self._lib.EC_KEY_free) + ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid) + assert ec_cdata != self._ffi.NULL + ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free) - res = self._lib.EC_KEY_generate_key(ctx) + res = self._lib.EC_KEY_generate_key(ec_cdata) assert res == 1 - res = self._lib.EC_KEY_check_key(ctx) + res = self._lib.EC_KEY_check_key(ec_cdata) assert res == 1 return _EllipticCurvePrivateKey(self, ec_cdata) @@ -1011,15 +1011,15 @@ class Backend(object): curve_nid = self._elliptic_curve_to_nid(public.curve) - ctx = self._lib.EC_KEY_new_by_curve_name(curve_nid) - assert ctx != self._ffi.NULL - ctx = self._ffi.gc(ctx, self._lib.EC_KEY_free) + ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid) + assert ec_cdata != self._ffi.NULL + ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free) - ctx = self._ec_key_set_public_key_affine_coordinates( - ctx, public.x, public.y) + ec_cdata = self._ec_key_set_public_key_affine_coordinates( + ec_cdata, public.x, public.y) res = self._lib.EC_KEY_set_private_key( - ctx, self._int_to_bn(numbers.private_value)) + ec_cdata, self._int_to_bn(numbers.private_value)) assert res == 1 return _EllipticCurvePrivateKey(self, ec_cdata) @@ -1036,12 +1036,12 @@ class Backend(object): def load_elliptic_curve_public_numbers(self, numbers): curve_nid = self._elliptic_curve_to_nid(numbers.curve) - ctx = self._lib.EC_KEY_new_by_curve_name(curve_nid) - assert ctx != self._ffi.NULL - ctx = self._ffi.gc(ctx, self._lib.EC_KEY_free) + ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid) + assert ec_cdata != self._ffi.NULL + ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free) - ctx = self._ec_key_set_public_key_affine_coordinates( - ctx, numbers.x, numbers.y) + ec_cdata = self._ec_key_set_public_key_affine_coordinates( + ec_cdata, numbers.x, numbers.y) return _EllipticCurvePublicKey(self, ec_cdata) |