forked from pool/python-M2Crypto
Accepting request 708462 from home:mcepl:branches:devel:languages:python
- Add fix_OpenSSL111c.patch patch to ensure compatibility with OpenSSL 1.1.1c. gl#m2crypto/m2crypto#258 OBS-URL: https://build.opensuse.org/request/show/708462 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-M2Crypto?expand=0&rev=82
This commit is contained in:
28
fix_OpenSSL111c.patch
Normal file
28
fix_OpenSSL111c.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
--- a/tests/test_rsa.py
|
||||
+++ b/tests/test_rsa.py
|
||||
@@ -113,6 +113,8 @@ class RSATestCase(unittest.TestCase):
|
||||
with self.assertRaises(TypeError):
|
||||
priv.private_encrypt(self.gen_callback, RSA.pkcs1_padding)
|
||||
|
||||
+ @unittest.skipIf(m2.OPENSSL_VERSION_NUMBER < 0x1010103f,
|
||||
+ 'Relies on fix which happened only in OpenSSL 1.1.1c')
|
||||
def test_public_encrypt(self):
|
||||
priv = RSA.load_key(self.privkey)
|
||||
# pkcs1_padding, pkcs1_oaep_padding
|
||||
@@ -124,13 +126,11 @@ class RSATestCase(unittest.TestCase):
|
||||
|
||||
# sslv23_padding
|
||||
ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding)
|
||||
- with self.assertRaises(RSA.RSAError):
|
||||
- priv.private_decrypt(ctxt, RSA.sslv23_padding)
|
||||
- with self.assertRaises(RSA.RSAError):
|
||||
- priv.private_decrypt(ctxt, RSA.sslv23_padding)
|
||||
+ res = priv.private_decrypt(ctxt, RSA.sslv23_padding)
|
||||
+ self.assertEqual(res, self.data)
|
||||
|
||||
# no_padding
|
||||
- with self.assertRaises(RSA.RSAError):
|
||||
+ with six.assertRaisesRegex(self, TypeError, 'data too small'):
|
||||
priv.public_encrypt(self.data, RSA.no_padding)
|
||||
|
||||
# Type-check the data to be encrypted.
|
||||
Reference in New Issue
Block a user