FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow tests to temporarily disable specific hash algorithms · Issue #136547 · python/cpython · GitHub

Repository navigation

Allow tests to temporarily disable specific hash algorithms #136547

Closed

Description

Feature or enhancement

Proposal:

This is feature I needed in order to test my fix for #136134. The idea is to simulate a disabled algorithm due to FIPS reasons on a machine that enables it. However, to that end, we need to mock multiple entry points. For instance, disabling MD5 means disabling both hashlib.md5 & co but also hmac.new(..., 'md5') & co.

I have a local branch with those changes that I will push tomorrow, but I needed an issue first. At the same time, it'll become useful for people who want to simulate FIPS-builds. Note that the support will not be universal and that tests using those helpers need to be written by people who know how the hash algorithm is used (in general, we use hashlib.new(NAME) and hmac.new(NAME) so the stdlib should avoid using explicit functions as they would not necessarily be mocked.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. self-assigned this
    on Jul 11, 2025
  2. added
    type-featureA feature request or enhancement
    testsTests in the Lib/test dir
    on Jul 11, 2025
  3. added a commit that references this issue on Jul 13, 2025
  4. added a commit that references this issue on Jul 13, 2025
  5. picnixz commented on Jul 18, 2025

    MemberAuthor

    There are issues with my approach when building with FIPS. I actually understood the reason so I'm reopening it for fixing this.

  6. added 2 commits that reference this issue on Jul 20, 2025
  7. added 2 commits that reference this issue on Aug 4, 2025
  8. added 2 commits that reference this issue on Aug 19, 2025
  9. added a commit that references this issue on Aug 22, 2025
  10. added 3 commits that reference this issue on Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL