On 12/30/20 11:21 AM, Sebastian Ramacher wrote: > Hi Thomas > > FYI: you need to CC the submitter otherwise I don't see the mail. > > On 2020-11-22 12:41:29 +0100, Thomas Goirand wrote: >> Hi Sebastian, >> >> Thanks for your bug report, and sorry it took that long to address. >> >> In many of the OpenStack team packages, I was able to simply remove >> python3-crypto, and it built fine. But in that one, when I remove it, or >> replace it by python3-pycryptodome (as you suggested), the package fails >> to build. So I don't think python3-pycryptodome is a "drop-in" >> replacement as you wrote. >> >> Any suggestion for that particular package? > > Any concrete error message? In some cases you might need to adopt > setup.py (change crypto in install_requires to the corresponding name > from python3-pycryptodome) or slightly adopt the imports. > > Cheers
Hi Sebastian, Here is the dump of unit testing that fails if I switch to cryptodome. Any hint? Cheers, Thomas Goirand (zigo) ====================================================================== ERROR: test_from_string_bad_key (tests.test__pycrypto_crypt.TestPyCryptoSigner) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test__pycrypto_crypt.py", line 72, in test_from_string_bad_key crypt.PyCryptoSigner.from_string(key_bytes) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_from_string_unicode_key (tests.test__pycrypto_crypt.TestPyCryptoVerifier) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test__pycrypto_crypt.py", line 62, in test_from_string_unicode_key verifier = crypt.PyCryptoVerifier.from_string( AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_bad_key (tests.test__pycrypto_crypt.TestPyCryptoVerifier) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test__pycrypto_crypt.py", line 54, in test_verify_bad_key verifier = crypt.PyCryptoVerifier.from_string( AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_failure (tests.test__pycrypto_crypt.TestPyCryptoVerifier) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test__pycrypto_crypt.py", line 48, in test_verify_failure verifier = crypt.PyCryptoVerifier.from_string( AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_success (tests.test__pycrypto_crypt.TestPyCryptoVerifier) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test__pycrypto_crypt.py", line 39, in test_verify_success signer = crypt.PyCryptoSigner.from_string( AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_from_string_non_509_cert (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 225, in test_from_string_non_509_cert verifier = self.verifier.from_string(public_key, is_x509_cert=False) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_sign_and_verify (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 57, in test_sign_and_verify self._check_sign_and_verify('privatekey.' + self.format_) File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 71, in _check_sign_and_verify signer = self.signer.from_string(private_key, AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_sign_and_verify_from_converted_pkcs12 (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 63, in test_sign_and_verify_from_converted_pkcs12 self._check_sign_and_verify('pem_from_pkcs12.pem') File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 71, in _check_sign_and_verify signer = self.signer.from_string(private_key, AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_id_token (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 108, in test_verify_id_token jwt = self._create_signed_jwt() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 95, in _create_signed_jwt signer = self.signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_id_token_bad_tokens (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 181, in test_verify_id_token_bad_tokens signer = self.signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_id_token_with_certs_uri (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 124, in test_verify_id_token_with_certs_uri jwt = self._create_signed_jwt() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 95, in _create_signed_jwt signer = self.signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_id_token_with_certs_uri_default_http (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 137, in test_verify_id_token_with_certs_uri_default_http jwt = self._create_signed_jwt() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 95, in _create_signed_jwt signer = self.signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_verify_id_token_with_certs_uri_fails (tests.test_jwt.PEMCryptTestsPyCrypto) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 152, in test_verify_id_token_with_certs_uri_fails jwt = self._create_signed_jwt() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 95, in _create_signed_jwt signer = self.signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_credentials_good (tests.test_jwt.PEMSignedJwtAssertionCredentialsPyCryptoTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 273, in test_credentials_good credentials = self._make_credentials() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 257, in _make_credentials signer = crypt.Signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_credentials_refresh_with_storage (tests.test_jwt.PEMSignedJwtAssertionCredentialsPyCryptoTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 312, in test_credentials_refresh_with_storage credentials = self._make_credentials() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 257, in _make_credentials signer = crypt.Signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_credentials_refresh_without_storage (tests.test_jwt.PEMSignedJwtAssertionCredentialsPyCryptoTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 307, in test_credentials_refresh_without_storage credentials = self._make_credentials() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 257, in _make_credentials signer = crypt.Signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string' ====================================================================== ERROR: test_credentials_to_from_json (tests.test_jwt.PEMSignedJwtAssertionCredentialsPyCryptoTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 284, in test_credentials_to_from_json credentials = self._make_credentials() File "/<<PKGBUILDDIR>>/tests/test_jwt.py", line 257, in _make_credentials signer = crypt.Signer.from_string(private_key) AttributeError: 'NoneType' object has no attribute 'from_string'