]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 21 Mar 2021 15:32:19 +0000 (08:32 -0700)
committerGitHub <noreply@github.com>
Sun, 21 Mar 2021 15:32:19 +0000 (08:32 -0700)
commit93b0da7527ae1b7d705052cf352ef9da81e608ec
tree416e8eb788a416cdcbbfde4580cff75bca40423d
parent50511677f59464e612cfef0cd0e139fe07e87737
bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback (GH-24957)

OpenSSL copies the internal message callback from SSL_CTX->msg_callback to
SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback
to use the callback value of the new context.

PySSL_set_context() now resets the callback and _PySSL_msg_callback()
resets thread state in error path.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 77cde5042a2f1eae489c11a67540afaf43cd5cdf)

Co-authored-by: Christian Heimes <christian@python.org>
Lib/test/test_ssl.py
Misc/NEWS.d/next/Library/2021-03-21-10-13-17.bpo-43577.m7JnAV.rst [new file with mode: 0644]
Modules/_ssl.c
Modules/_ssl/debughelpers.c