Skip to content

gh-134531: prefer using _hashlib module state instead of module object#136865

Merged
picnixz merged 7 commits intopython:mainfrom
picnixz:feat/hashlib/use-modstate-134531
Jul 20, 2025
Merged

gh-134531: prefer using _hashlib module state instead of module object#136865
picnixz merged 7 commits intopython:mainfrom
picnixz:feat/hashlib/use-modstate-134531

Conversation

@picnixz
Copy link
Copy Markdown
Member

@picnixz picnixz commented Jul 20, 2025

In order to work on gh-134531, I actually observed that I'm always using the state object itself. By changing the signatures of EVP_MD getters & co, I can simplify the code a bit.

nachocab and others added 5 commits July 20, 2025 14:40
Co-authored-by: Nacho Caballero <nacho.caballero@astrazeneca.com>
Add an example on how to write a tarfile to stdout; general improvements.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
…ests (python#136762)

- Fix `hashlib_helper.block_algorithm` where the dummy functions were incorrectly defined.
- Rename `hashlib_helper.HashAPI` to `hashlib_helper.HashInfo` and add more helper methods.
- Simplify `hashlib_helper.requires_*()` functions.
- Rewrite some private helpers in `hashlib_helper`.
- Remove `find_{builtin,openssl}_hashdigest_constructor()` as they are no more needed and were
  not meant to be public in the first place.
- Fix some tests in `test_hashlib` when FIPS mode is on.
@picnixz
Copy link
Copy Markdown
Member Author

picnixz commented Jul 20, 2025

Sorry for the ping

@picnixz picnixz marked this pull request as ready for review July 20, 2025 12:46
@picnixz picnixz enabled auto-merge (squash) July 20, 2025 12:51
@picnixz picnixz merged commit 4a151ca into python:main Jul 20, 2025
42 checks passed
@picnixz picnixz deleted the feat/hashlib/use-modstate-134531 branch July 20, 2025 13:27
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…le object (python#136865)

Some internal helper functions taking the module object to retrieve its state
under some conditions now directly take the module's state instead as those
conditions hold most of the time.
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
…le object (python#136865)

Some internal helper functions taking the module object to retrieve its state
under some conditions now directly take the module's state instead as those
conditions hold most of the time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants