-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-135234: improve _hashlib
exceptions when reporting an OpenSSL function failure
#135250
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
Merged
picnixz
merged 19 commits into
python:main
from
picnixz:feat/hashlib/smart-exceptions-135234
Jun 9, 2025
+199
−122
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
eb3cb2e
add helpers for setting exceptions
picnixz e242865
refactor `get_openssl_evp_md_by_utf8name` error branches
picnixz ac6dea4
refactor `HASH.{digest,hexdigest}` computations
picnixz 4bc2808
refactor `_hashlib_HASH_copy_locked` and `locked_HMAC_CTX_copy`
picnixz 14b87df
set remaining exceptions after an OpenSSL failure
picnixz e5b2ef3
blurb
picnixz 5b41242
wrap OpenSSL context allocators
picnixz 2a8cf55
fix compilation, remove unused functions and update messages
picnixz ea2ce0e
update wrappers
picnixz 43739c5
align exception messages
picnixz e226431
context allocators can only set an ERR_R_MALLOC_FAILURE error
picnixz 7201e0a
update exception message for `get_openssl_evp_md_by_utf8name`
picnixz f8c2aed
refactor logic for mapping NIDs to EVP_MD objects
picnixz 380f5a0
Update Modules/_hashopenssl.c
picnixz 7036df8
remove TODO
picnixz b7f0947
Merge branch 'refactor/hashlib/evp-nid-interface-134531' into feat/ha…
picnixz a1066fe
pull main
picnixz 76c7dd2
Merge branch 'main' into feat/hashlib/smart-exceptions-135234
picnixz 35e6d1e
Update Misc/NEWS.d/next/Library/2025-06-08-11-11-07.gh-issue-135234.w…
picnixz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
Misc/NEWS.d/next/Library/2025-06-08-11-11-07.gh-issue-135234.wJCdh0.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:mod:`hashlib`: improve exception messages when an OpenSSL function failed. | ||
When memory allocation fails on OpenSSL's side, a :exc:`MemoryError` is | ||
raised instead of a :exc:`ValueError`. Patch by Bénédikt Tran. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.