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)
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