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-103256: Fix hmac algorithm to support fallback implementation#103286

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
corona10 merged 3 commits intopython:mainfromcorona10:gh-103256
Apr 7, 2023

Conversation

@corona10
Copy link
Member

@corona10corona10 commentedApr 5, 2023
edited by bedevere-bot
Loading

@corona10
Copy link
MemberAuthor

@gpshead

Would you like to take a look at this PR?
The change will not affect to backward compatibility.

@gpsheadgpshead added needs backport to 3.11only security fixes and removed skip news labelsApr 7, 2023
Copy link
Member

@gpsheadgpshead left a comment

Choose a reason for hiding this comment

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

Thanks! somewhat surprised we hadn't run into this at work, but I guess there isn't much demand for hmac-sha3 yet. the other folks who might hit this probably have openssl builds without md5 or sha1?

@corona10
Copy link
MemberAuthor

corona10 commentedApr 7, 2023
edited
Loading

I guess there isn't much demand for hmac-sha3 yet. the other folks who might hit this probably have openssl builds without md5 or sha1?

It looks so, and the latter looks minor case in this era :)

@corona10
Copy link
MemberAuthor

Thanks@gpshead for reviewing and supplementing this PR!

@corona10corona10 merged commitefb0a2c intopython:mainApr 7, 2023
@miss-islington
Copy link
Contributor

Thanks@corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-103328 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelApr 7, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 7, 2023
pythongh-103286)(cherry picked from commitefb0a2c)Co-authored-by: Dong-hee Na <donghee.na@python.org>Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington added a commit that referenced this pull requestApr 7, 2023
…103286)(cherry picked from commitefb0a2c)Co-authored-by: Dong-hee Na <donghee.na@python.org>Co-authored-by: Gregory P. Smith <greg@krypto.org>
@geitda
Copy link

Thanks! somewhat surprised we hadn't run into this at work, but I guess there isn't much demand for hmac-sha3 yet. the other folks who might hit this probably have openssl builds without md5 or sha1?

SHA3 is fine since OpenSSL (at least in Python 3.11.2) provides it;

Python 3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32>>> import hmac>>> hmac.digest(b'key', b'message', 'sha3_256').hex()'0f43852a24d5597a8200312a95993991581679d63264f1b1ad4b5ccac7fe8ba4'

The only hash algorithms that were a problem are ones that OpenSSL doesn't provide via named lookup. So none of the built-in algorithms would trigger it as OpenSSL providesall of them (even whirlpool, mdc2, and the composite md5-sha1 work as expected) - that's why it took me (ab)using hashlib to find it. But patching hashlib (directly in the file or on the fly) to include a new algorithm does trigger it (as that's what I was doing). But you're right that if md5 or sha1were removed from OpenSSL while still being kept in hashlib (e.g. with a stand-alone CPython implementation), then the problemwould get triggered.

@gpshead
Copy link
Member

Not everyone's OpenSSL provides it. 1.1.1 and BoringSSL do not.

geitda reacted with thumbs up emoji

warsaw pushed a commit to warsaw/cpython that referenced this pull requestApr 11, 2023
@corona10corona10 deleted the gh-103256 branchApril 24, 2023 19:26
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

@tirantiranAwaiting requested review from tiran

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@corona10@miss-islington@bedevere-bot@geitda@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp