Skip to content

Commit 83b94e8

Browse files
authored
gh-135234: improve _hashlib exceptions when reporting an OpenSSL function failure (#135250)
- Refactor `get_openssl_evp_md_by_utf8name` error branches. - Refactor `HASH.{digest,hexdigest}` computations. - Refactor `_hashlib_HASH_copy_locked` and `locked_HMAC_CTX_copy`.
1 parent 2677dd0 commit 83b94e8

File tree

2 files changed

+199
-122
lines changed

2 files changed

+199
-122
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:mod:`hashlib`: improve exception messages when an OpenSSL function failed.
2+
When memory allocation fails on OpenSSL's side, a :exc:`MemoryError` is
3+
raised instead of a :exc:`ValueError`. Patch by Bénédikt Tran.

0 commit comments

Comments
 (0)