diff --git a/fix_OpenSSL111c.patch b/fix_OpenSSL111c.patch new file mode 100644 index 0000000..7c7f88d --- /dev/null +++ b/fix_OpenSSL111c.patch @@ -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. diff --git a/python-M2Crypto.changes b/python-M2Crypto.changes index a5df67f..dd14892 100644 --- a/python-M2Crypto.changes +++ b/python-M2Crypto.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 7 22:21:23 CEST 2019 - Matej Cepl + +- Add fix_OpenSSL111c.patch patch to ensure compatibility with + OpenSSL 1.1.1c. gl#m2crypto/m2crypto#258 + ------------------------------------------------------------------- Thu Jun 6 12:27:35 UTC 2019 - Ondřej Súkup diff --git a/python-M2Crypto.spec b/python-M2Crypto.spec index 45e02e5..c5db753 100644 --- a/python-M2Crypto.spec +++ b/python-M2Crypto.spec @@ -26,6 +26,7 @@ License: MIT Group: Development/Languages/Python Url: https://gitlab.com/m2crypto/m2crypto Source: https://files.pythonhosted.org/packages/source/M/M2Crypto/M2Crypto-%{version}.tar.gz +Patch0: fix_OpenSSL111c.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module typing}