Skip to content

gh-134531: use EVP_MAC API for _hashlib.HMAC #135235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jun 7, 2025

Just a draft PR for the CI. I'll split the PR tomorrow. Some parts are part of #135234.

This is based on top of #135250 and #135254 so it's a bit messy.

@picnixz
Copy link
Member Author

picnixz commented Jun 7, 2025

!buildbot FIPS

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit c444180 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135235%2Fmerge

The command will test the builders whose names match following regular expression: FIPS

The builders matched are:

  • AMD64 CentOS9 FIPS No Builtin Hashes PR
  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 RHEL8 FIPS No Builtin Hashes PR
  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR

Copy link
Member Author

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, there is also something I wanted to investigate, namely "is it faster to use SN_* names or LN_* names for OpenSSL" and whether it's better to cache the NID (as it's only used in __repr__ or .name) or directly cache a const char *.

I'll need more experiments for this one but this also applies to the existing code where we work with EVP_MD objects instead of caching their properties.

@picnixz picnixz removed the skip news label Jun 23, 2025
@picnixz picnixz self-assigned this Jul 11, 2025
@picnixz
Copy link
Member Author

picnixz commented Jul 11, 2025

@gpshead Want to have a look at this one before I merge it (say by the end of the week)

@picnixz picnixz marked this pull request as draft July 20, 2025 11:52
@picnixz picnixz marked this pull request as ready for review July 20, 2025 17:11
@picnixz
Copy link
Member Author

picnixz commented Jul 20, 2025

!buildbot FIPS only

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @picnixz for commit b1f44a8 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F135235%2Fmerge

The command will test the builders whose names match following regular expression: FIPS only

The builders matched are:

  • AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PR
  • AMD64 CentOS9 FIPS Only Blake2 Builtin Hash PR

@picnixz
Copy link
Member Author

picnixz commented Jul 26, 2025

This PR is actually still too big. I'll break down changes again.

@picnixz picnixz marked this pull request as draft July 26, 2025 12:21
@picnixz picnixz force-pushed the feat/hashopenssl/refactoring-134531 branch from e8b4692 to b3b4a6a Compare July 26, 2025 12:48
@picnixz
Copy link
Member Author

picnixz commented Jul 26, 2025

Each time I stare at this PR I'm not happy because the naming of the hashlib functions is sometimes really confusing. I really want to reorder this file but at the same time it would be painful because reviewing moving pieces is not easy.

I will first draft something where we have a clear naming convention, so that one can distinguish helpers needed for Python and helpers wrapping OpenSSL functions only without any care for Python (except for setting exceptions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
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