]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)...
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Tue, 18 Mar 2025 09:16:49 +0000 (10:16 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Mar 2025 09:16:49 +0000 (10:16 +0100)
commit170abd2199f45a6cb73cd231d936382b74cb7ae4
tree7697a9cb62159dfd0aafefec4a6e551739d16cd5
parente8e6e300544e8adab4f062589100c6263e83d8b3
[3.13] gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145) (#131347)

gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)

Refactor `_setException()` into different helpers that can be used separately:

- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.

(cherry-picked from commit ac50ece6cea8745834e4ec0a9617809a51245bfc).
Modules/_hashopenssl.c