aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-08 13:44:22 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-08 13:44:22 -0500
commit8eda85f7d24d7604121e3a86f64e3a1d6e2a2f95 (patch)
tree6d1441483c8f1d4661c885437258eb796cccb609
parentb64162c9091fb91b50c19e48ddfb23d81074d4f4 (diff)
downloadcryptography-8eda85f7d24d7604121e3a86f64e3a1d6e2a2f95.tar.gz
cryptography-8eda85f7d24d7604121e3a86f64e3a1d6e2a2f95.tar.bz2
cryptography-8eda85f7d24d7604121e3a86f64e3a1d6e2a2f95.zip
move RSA blinding to rsa_cdata creation methods rather than evp_pkey
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 900d25c2..3d93e8d8 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -346,9 +346,6 @@ class Backend(object):
evp_pkey = self._new_evp_pkey()
rsa_cdata = self._rsa_cdata_from_private_key(private_key)
- res = self._lib.RSA_blinding_on(rsa_cdata, self._ffi.NULL)
- assert res == 1
-
res = self._lib.EVP_PKEY_assign_RSA(evp_pkey, rsa_cdata)
assert res == 1
@@ -358,9 +355,6 @@ class Backend(object):
evp_pkey = self._new_evp_pkey()
rsa_cdata = self._rsa_cdata_from_public_key(public_key)
- res = self._lib.RSA_blinding_on(rsa_cdata, self._ffi.NULL)
- assert res == 1
-
res = self._lib.EVP_PKEY_assign_RSA(evp_pkey, rsa_cdata)
assert res == 1
@@ -391,6 +385,9 @@ class Backend(object):
ctx.dmp1 = self._int_to_bn(private_key.dmp1)
ctx.dmq1 = self._int_to_bn(private_key.dmq1)
ctx.iqmp = self._int_to_bn(private_key.iqmp)
+ res = self._lib.RSA_blinding_on(ctx, self._ffi.NULL)
+ assert res == 1
+
return ctx
def _rsa_cdata_from_public_key(self, public_key):
@@ -401,6 +398,9 @@ class Backend(object):
assert ctx != self._ffi.NULL
ctx.e = self._int_to_bn(public_key.e)
ctx.n = self._int_to_bn(public_key.n)
+ res = self._lib.RSA_blinding_on(ctx, self._ffi.NULL)
+ assert res == 1
+
return ctx
def create_rsa_signature_ctx(self, private_key, padding, algorithm):