Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-134531: cleanup_hashopenssl.c to supportEVP_MAC#134626

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

picnixz
Copy link
Member

@picnixzpicnixz commentedMay 24, 2025
edited by bedevere-appbot
Loading

Previously, we usedEVP to denote anything related to hash functions. We didn't need to distinguish betweenEVP_MD andEVP_MAC. However, we will need to distinguish them and honestly, I always wanted to refactor this module.

So, I decided to rewrite many function names. The logic is as follows:

  • use_hashlib_HASH_* for HASH methods (previouslyEVPobject)
  • use_hashlib_HASHXOF_* for SHAKE methods (previouslyEVPXOF)
  • only useEVP in function names when we're actually dealing with OpenSSL itself. It's confusing otherwise. On CPython's side, we're only wrapping an EVP_MD object, but we'renot an EVP_MD object IMO. We are a HASH or a HASHXOF object since we export them as such.

Note that wecan backport this to 3.14, and, ideally, to 3.13 as well because if I were to fix a bug in 3.15, then we'll likely have conflicts if I were to backport the fix to 3.13.

@picnixzpicnixz requested a review fromgpshead as acode ownerMay 24, 2025 10:41
@picnixzpicnixz added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 24, 2025
@bedevere-bot
Copy link

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

Results will be shown at:

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

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 24, 2025
@gpsheadgpshead added needs backport to 3.13bugs and security fixes needs backport to 3.14bugs and security fixes labelsMay 25, 2025
@gpshead
Copy link
Member

I suggest adding a small news entry regardless, as this will land in a release branch it is nice to indicate to people reading the changelog where a name cleanup refactoring was done to the internals.

picnixz reacted with heart emoji

@picnixz
Copy link
MemberAuthor

I suggest adding a small news entry regardless, as this will land in a release branch it is nice to indicate to people reading the changelog where a name cleanup refactoring was done to the internals.

Sure, I'll write a NEWS entry tomorrow and will merge this.

@picnixz
Copy link
MemberAuthor

picnixz commentedMay 26, 2025
edited
Loading

Note: failures are related to GH. And if the backport fails to 3.13 due to conflicts, I'll ignore it as well (this liokely means I would anyway need to work harder :'))

@picnixzpicnixzenabled auto-merge (squash)May 26, 2025 10:12
@picnixzpicnixz merged commitcb8045e intopython:mainMay 26, 2025
39 checks passed
@miss-islington-app
Copy link

Thanks@picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@picnixzpicnixz deleted the feat/hmac/prepare-for-openssl-3x-134531 branchMay 26, 2025 10:12
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 26, 2025
…nGH-134626)Rename components related to `_hashlib.{HASH,HASHXOF}` objects.- The `EVPobject` structure is renamed `HASHobject`.- Non-clinic `HASH` methods are now prefixed by `_hashlib_HASH_*`.  A similar change is made for non-clinic `HASHXOF` methods.- Functions extracting information from `EVP_MD` objects and functions  constructing `EVP_MD` objects now include `openssl_evp_md` in their name.This change allows us to avoid future ambiguities between the `EVP_MD`and the `EVP_MAC` APIs (currently, we only use `EVP_MD` for hash functionsand rely on the legacy interface for HMAC instead of using `EVP_MAC`).(cherry picked from commitcb8045e)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@miss-islington-app
Copy link

Sorry,@picnixz, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker cb8045e86c4fadfd847d614193f2b38ec03933b8 3.13

@bedevere-app
Copy link

GH-134703 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelMay 26, 2025
@picnixz
Copy link
MemberAuthor

Ok let's have a look at the conflicts.

@picnixz
Copy link
MemberAuthor

Ok, forget it, the conflicts are too hard to fix because of UBSan failures that were fixed and clinic that was fixed differently.

@picnixzpicnixz removed the needs backport to 3.13bugs and security fixes labelMay 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees

@picnixzpicnixz

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@picnixz@bedevere-bot@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp