summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Carroll <jim@caroll.com>2016-07-28 14:43:01 -0400
committerMatěj Cepl <mcepl@cepl.eu>2017-09-15 14:42:51 +0200
commit7527cb115bc197895cd121220f4489fb44f4c9d9 (patch)
treef6cab6cca5a6fe0c13ac2b5d46eff7275346e975
parente3070bb00ea093efcd36ea3e8062ab86817c928a (diff)
downloadm2crypto-7527cb115bc197895cd121220f4489fb44f4c9d9.tar.gz
Migrated to m2.rsa_set_en_bin() and m2.rsa_set_en()
-rw-r--r--M2Crypto/PGP/RSA.py3
-rw-r--r--M2Crypto/RSA.py3
-rw-r--r--tests/test_rsa.py6
3 files changed, 5 insertions, 7 deletions
diff --git a/M2Crypto/PGP/RSA.py b/M2Crypto/PGP/RSA.py
index 16ec244..81475a1 100644
--- a/M2Crypto/PGP/RSA.py
+++ b/M2Crypto/PGP/RSA.py
@@ -24,6 +24,5 @@ def new_pub_key(e_n):
(e, n) = e_n
rsa = m2.rsa_new()
- m2.rsa_set_e_bin(rsa, e)
- m2.rsa_set_n_bin(rsa, n)
+ m2.rsa_set_en_bin(rsa, e, n)
return RSA_pub(rsa, 1)
diff --git a/M2Crypto/RSA.py b/M2Crypto/RSA.py
index b584037..c7d2709 100644
--- a/M2Crypto/RSA.py
+++ b/M2Crypto/RSA.py
@@ -429,6 +429,5 @@ def new_pub_key(e_n):
"""
(e, n) = e_n
rsa = m2.rsa_new()
- m2.rsa_set_e(rsa, e)
- m2.rsa_set_n(rsa, n)
+ m2.rsa_set_en(rsa, e, n)
return RSA_pub(rsa, 1)
diff --git a/tests/test_rsa.py b/tests/test_rsa.py
index 264be37..a4ad8de 100644
--- a/tests/test_rsa.py
+++ b/tests/test_rsa.py
@@ -176,10 +176,10 @@ class RSATestCase(unittest.TestCase):
def test_set_bn(self):
rsa = RSA.load_pub_key(self.pubkey)
- self.assertIsNone(m2.rsa_set_e(rsa.rsa,
- b'\000\000\000\003\001\000\001'))
with self.assertRaises(RSA.RSAError):
- m2.rsa_set_e(rsa.rsa, b'\000\000\000\003\001')
+ m2.rsa_set_en(rsa.rsa,
+ b'\000\000\000\003\001\000\001',
+ b'\000\000\000\003\001')
def test_newpub(self):
old = RSA.load_pub_key(self.pubkey)