[Bug 263585] security/py-keyrings.alt: tests failing, update needed

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 26 Apr 2022 14:59:45 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263585

            Bug ID: 263585
           Summary: security/py-keyrings.alt: tests failing, update needed
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: amdmi3@FreeBSD.org
                CC: douglas@douglasthrift.net
                CC: douglas@douglasthrift.net
             Flags: maintainer-feedback?(douglas@douglasthrift.net)

security/py-keyrings.alt needs to be updated to the latest 4.1.0. Most tests
currently fail because ancient pycrypto is used which is not compatible with
our current python 3.8.

__________________ CryptedFileKeyringTestCase.test_credential
__________________

self = <tests.test_crypto.CryptedFileKeyringTestCase
testMethod=test_credential>

    def test_credential(self):
        keyring = self.keyring

        cred = keyring.get_credential('service', None)
        assert cred is None

>       self.set_password('service1', 'user1', 'password1')

/usr/local/lib/python3.8/site-packages/keyring/tests/test_backend.py:144: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.8/site-packages/keyring/tests/test_backend.py:53: in
set_password
    self.keyring.set_password(service, username, password)
keyrings/alt/file_base.py:135: in set_password
    password_encrypted = self.encrypt(password.encode('utf-8'), assoc)
keyrings/alt/file.py:203: in encrypt
    salt = get_random_bytes(self.block_size)
/usr/local/lib/python3.8/site-packages/Crypto/Random/__init__.py:41: in
get_random_bytes
    return _UserFriendlyRNG.get_random_bytes(n)
/usr/local/lib/python3.8/site-packages/Crypto/Random/_UserFriendlyRNG.py:228:
in get_random_bytes
    return _get_singleton().read(n)
/usr/local/lib/python3.8/site-packages/Crypto/Random/_UserFriendlyRNG.py:178:
in read
    return _UserFriendlyRNG.read(self, bytes)
/usr/local/lib/python3.8/site-packages/Crypto/Random/_UserFriendlyRNG.py:129:
in read
    self._ec.collect()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Crypto.Random._UserFriendlyRNG._EntropyCollector object at 0x80344ffd0>

    def collect(self):
        # Collect 64 bits of entropy from the operating system and feed it to
Fortuna.
        self._osrng_es.feed(self._osrng.read(8))

        # Add the fractional part of time.time()
        t = time.time()
        self._time_es.feed(struct.pack("@I", int(2**30 * (t - floor(t)))))

        # Add the fractional part of time.clock()
>       t = time.clock()
E       AttributeError: module 'time' has no attribute 'clock'

/usr/local/lib/python3.8/site-packages/Crypto/Random/_UserFriendlyRNG.py:77:
AttributeError

-- 
You are receiving this mail because:
You are the assignee for the bug.