◐ Shell
clean mode source ↗

Issue 38270: Tests: Avoid MD5 or check for MD5 availablity

MD5 hash digest algorithm has known security issues and is getting blocked on systems with strict security policies.

Python uses MD5 in several unittests. These tests should either avoid MD5 and use SHA256 instead. Or tests that really require MD5 should check for the availability of MD5 and skip these tests. The latter are network-related tests that check for digest auth or CRAM-MD5 auth.

Avoidable use of MD5:
* test_hmac tests for default constructor
* test_tarfile checksum

Tests that require MD5:
* test_urllib2_localnet digest auth
* CRAM-MD5 in test_imaplib, test_poplib, test_smtplib
It looks like Christian originally requested autobackports to both 3.8 and 3.7 but both failed due to git checkout errors.  He then manually restarted the 3.8 backport but it looks like the 3.7 one did not get restarted.  Christian, was that intentional or just an oversight?  If the latter, you should try the 3.7 backport again.