Bug 263586 - security/py-pycrypto: not compatible with python 3.8
Summary: security/py-pycrypto: not compatible with python 3.8
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-26 15:15 UTC by Dmitry Marakasov
Modified: 2022-05-14 15:54 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer freebsd_triage 2022-04-26 15:15:22 UTC
- pycrypto is no longer maintained (see https://www.pycrypto.org/)
- it's also not compatible with python 3.8, for instance it uses time.clock() (https://github.com/pycrypto/pycrypto/blob/master/lib/Crypto/Random/_UserFriendlyRNG.py#L77) not present in python 3.8 (which results in problems such as https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263585)

So:
- The port should be marked DEPRECATED
- time.clock() call should be replaced with something compatible, for the time being

For instance, this may work:

    self._clock_es.feed(struct.pack('=Q', time.monotonic_ns()))

Instead of fractional part of time.clock() converted to 4 bytes, it feeds 8 bytes of monotonic time with nanosecond precision, which should be even more random.
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-04-27 11:43:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0a452342de5da5db62f493d6d556fa308419e2dc

commit 0a452342de5da5db62f493d6d556fa308419e2dc
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-04-26 15:16:43 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-04-27 11:42:13 +0000

    security/py-keyrings.alt: convert to USES=pytest

    The tests still fail because of pycrypto which is not compatible
    with our python 3.8. This may be fixed by either updating [1] this
    port to a newer version which drops the pycrypto dependency, or
    fixing pycrypto [2].

    PR:             263585 [1], 263586 [2]
    Reported by:    reprise
    Approved by:    portmgr blanket

 security/py-keyrings.alt/Makefile | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-05-13 11:50:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=641046531d466db8ca742980607c08455dbe700e

commit 641046531d466db8ca742980607c08455dbe700e
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-05-13 11:31:33 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-05-13 11:39:36 +0000

    security/py-pycrypto: Mark DEPRECATED and set EXPIRATION_DATE to 2022-06-30

    PR:             263586
    Reported by:    amdmi3

 security/py-pycrypto/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)