You need to sign in or sign up before continuing.
tests fail in 2029
While working on reproducible builds for openSUSE, I found that building the openSUSE python-M2Crypto-0.35.2 package with the fix from MR#235 in the year 2029, tests fail from expired SSL certs.
test_pubkey_from_der (tests.test_ecdh.ECDHTestCase) ... ok
test_genparam (tests.test_ecdsa.ECDSATestCase) ... ok
test_loadkey (tests.test_ecdsa.ECDSATestCase) ... ok
test_loadkey_junk (tests.test_ecdsa.ECDSATestCase) ... ok
test_loadpubkey (tests.test_ecdsa.ECDSATestCase) ... ok
test_pub_key_from_params (tests.test_ecdsa.ECDSATestCase) ... ok
test_sign_dsa_asn1 (tests.test_ecdsa.ECDSATestCase) ... ok
test_verify_dsa (tests.test_ecdsa.ECDSATestCase) ... ok
test_ec_curves_ECDSA (tests.test_ec_curves.ECCurveTests) ... ok
test_ec_get_builtin_curves (tests.test_ec_curves.ECCurveTests) ... ok
======================================================================
ERROR: test_signEncryptDecryptVerify (tests.test_smime.SMIMETestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_smime.py", line 317, in test_signEncryptDecryptVerify
v = s.verify(p7)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SMIME.py", line 258, in verify
self.x509_store._ptr(), flags)
PKCS7_Error: certificate verify error (Verify error:certificate has expired)
======================================================================
ERROR: test_verify (tests.test_smime.SMIMETestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_smime.py", line 138, in test_verify
v = s.verify(p7, data)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SMIME.py", line 262, in verify
data_bio._ptr(), flags)
PKCS7_Error: certificate verify error (Verify error:certificate has expired)
======================================================================
ERROR: test_verify_with_method_callback (tests.test_smime.SMIMETestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_smime.py", line 192, in test_verify_with_method_callback
v = s.verify(p7, data)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SMIME.py", line 262, in verify
data_bio._ptr(), flags)
PKCS7_Error: certificate verify error (Verify error:certificate has expired)
======================================================================
ERROR: test_verify_with_static_callback (tests.test_smime.SMIMETestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_smime.py", line 166, in test_verify_with_static_callback
v = s.verify(p7, data)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SMIME.py", line 262, in verify
data_bio._ptr(), flags)
PKCS7_Error: certificate verify error (Verify error:certificate has expired)
======================================================================
ERROR: test_HTTPSConnection_secure_context (tests.test_ssl.HttpslibSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 219, in test_HTTPSConnection_secure_context
c.request('GET', '/')
File "/usr/lib64/python2.7/httplib.py", line 1069, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1109, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1065, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 892, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 854, in send
self.connect()
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/httpslib.py", line 75, in connect
sock.connect((self.host, self.port))
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 308, in connect
ret = self.connect_ssl()
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 294, in connect_ssl
return m2.ssl_connect(self.ssl, self._timeout)
SSLError: certificate verify failed
======================================================================
ERROR: test_urllib2_secure_context (tests.test_ssl.Urllib2SSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 970, in test_urllib2_secure_context
u = opener.open('https://%s:%s/' % (srv_host, self.srv_port))
File "/usr/lib64/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib64/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib64/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/m2urllib2.py", line 115, in https_open
h.request(req.get_method(), request_uri, req.data, headers)
File "/usr/lib64/python2.7/httplib.py", line 1069, in request
self._send_request(method, url, body, headers)
File "/usr/lib64/python2.7/httplib.py", line 1109, in _send_request
self.endheaders(body)
File "/usr/lib64/python2.7/httplib.py", line 1065, in endheaders
self._send_output(message_body)
File "/usr/lib64/python2.7/httplib.py", line 892, in _send_output
self.send(msg)
File "/usr/lib64/python2.7/httplib.py", line 854, in send
self.connect()
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/httpslib.py", line 75, in connect
sock.connect((self.host, self.port))
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 308, in connect
ret = self.connect_ssl()
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 294, in connect_ssl
return m2.ssl_connect(self.ssl, self._timeout)
SSLError: certificate verify failed
======================================================================
ERROR: test_server_simple_secure_context (tests.test_ssl.MiscSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 338, in test_server_simple_secure_context
s.connect(self.srv_addr)
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 308, in connect
ret = self.connect_ssl()
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/M2Crypto/SSL/Connection.py", line 294, in connect_ssl
return m2.ssl_connect(self.ssl, self._timeout)
SSLError: certificate verify failed
======================================================================
FAIL: test_verify_cert (tests.test_ssl.MiscSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 702, in test_verify_cert
self.fail(e)
AssertionError: certificate verify failed
======================================================================
FAIL: test_verify_cert_mutual_auth (tests.test_ssl.MiscSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 736, in test_verify_cert_mutual_auth
self.fail(e)
AssertionError: certificate verify failed
======================================================================
FAIL: test_verify_cert_mutual_auth_servernbio (tests.test_ssl.MiscSSLClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/M2Crypto-0.35.2/tests/test_ssl.py", line 756, in test_verify_cert_mutual_auth_servernbio
self.fail(e)
AssertionError: certificate verify failed
----------------------------------------------------------------------
Ran 297 tests in 130.662s
FAILED (failures=3, errors=7, skipped=1)
Test failed: <unittest.runner.TextTestResult run=297 errors=7 failures=3>
error: Test failed: <unittest.runner.TextTestResult run=297 errors=7 failures=3>
error: Bad exit status from /var/tmp/rpm-tmp.qt2mX9 (%check)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.qt2mX9 (%check)
failed "build python-M2Crypto.spec" at Sat Apr 28 09:24:59 UTC 2029.
Background: As part of my work on reproducible builds for openSUSE, I check that software still gives identical build results in the future. The usual offset is +15 years, because that is how long I expect some software will be used in some places. This showed up failing tests in our package build. See https://reproducible-builds.org/ for why this matters.