bpo-38270: Check for hash digest algorithms and avoid MD5#16382
Conversation
The new test helper requires_hashdigest() marks tests that require a specific hashlib algorithm. If the algorithm is not available or blocked by a security policy, the test case is skipped. Signed-off-by: Christian Heimes <christian@python.org>
test_hmac now uses SHA256 instead of MD5 for default constructor tests. All tests now use requires_hashdigest(), too. Signed-off-by: Christian Heimes <christian@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
Some test cases for imaplib, poplib, smptlib, and urllib2 require MD5 to perform digest auth / CRAM-MD5 auth testing. These tests are now marked as requiring MD5 and skipped when MD5 is not available. Signed-off-by: Christian Heimes <christian@python.org>
vstinner
left a comment
There was a problem hiding this comment.
LGTM. I just have a minor suggestion on the NEWS entry.
Signed-off-by: Christian Heimes <christian@python.org>
f81708a to
0ad9fe2
Compare
vstinner
left a comment
There was a problem hiding this comment.
LGTM. The updated NEWS entry is even better ;-)
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
|
I'm having trouble backporting to |
|
Sorry, @tiran, I could not cleanly backport this to |
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
Sorry @tiran, I had trouble checking out the |
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…6382) Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270 (cherry picked from commit c64a1a6) Co-authored-by: Christian Heimes <christian@python.org>
|
GH-16393 is a backport of this pull request to the 3.8 branch. |
…6382) (GH-16393) Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270 (cherry picked from commit c64a1a6) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270 Automerge-Triggered-By: @tiran
…onGH-16382) (pythonGH-16393) Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270 (cherry picked from commit c64a1a6) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270 Automerge-Triggered-By: @tiran
…6382) Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270
…onGH-16382) (pythonGH-16393) Make it easier to run and test Python on systems with restrict crypto policies: * add requires_hashdigest to test.support to check if a hash digest algorithm is available and working * avoid MD5 in test_hmac * replace MD5 with SHA256 in test_tarfile * mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5 https://bugs.python.org/issue38270 (cherry picked from commit c64a1a6) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270 Automerge-Triggered-By: @tiran
Make it easier to run and test Python on systems with restrict crypto policies:
https://bugs.python.org/issue38270
Automerge-Triggered-By: @tiran
Automerge-Triggered-By: @tiran