Skip to content

Allow tests to temporarily disable specific hash algorithms #136547

Open
@picnixz

Description

@picnixz

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

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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy