]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-34759: Fix error handling in ssl 'unwrap()' (GH-9468)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 22 Sep 2018 05:00:42 +0000 (22:00 -0700)
committerGitHub <noreply@github.com>
Sat, 22 Sep 2018 05:00:42 +0000 (22:00 -0700)
commitc00f7037df3607c89323e68db3ab996b7df394de
treed5b5d7343e3714c0b969f99c0e691c580677b72b
parent5c3d8b2efda1b99abe09ad925f366c5695bd66fb
bpo-34759: Fix error handling in ssl 'unwrap()' (GH-9468)

OpenSSL follows the convention that whenever you call a function, it
returns an error indicator value; and if this value is negative, then
you need to go look at the actual error code to see what happened.

Commit c6fd1c1c3a introduced a small mistake in
_ssl__SSLSocket_shutdown_impl: instead of checking whether the error
indicator was negative, it started checking whether the actual error
code was negative, and it turns out that the error codes are never
negative. So the effect was that 'unwrap()' lost the ability to raise
SSL errors.

https://bugs.python.org/issue34759
(cherry picked from commit c0da582b227f311126e278b5553a7fa89c79b054)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
Lib/test/test_ssl.py
Modules/_ssl.c