Skip to content

[3.7] bpo-34759: Fix error handling in ssl 'unwrap()' (GH-9468)#9491

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-c0da582-3.7
Sep 22, 2018
Merged

[3.7] bpo-34759: Fix error handling in ssl 'unwrap()' (GH-9468)#9491
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-c0da582-3.7

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 22, 2018

Copy link
Copy Markdown
Contributor

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

Co-authored-by: Nathaniel J. Smith njs@pobox.com

https://bugs.python.org/issue34759

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

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
@miss-islington

Copy link
Copy Markdown
Contributor Author

@njsmith: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit c00f703 into python:3.7 Sep 22, 2018
@miss-islington miss-islington deleted the backport-c0da582-3.7 branch September 22, 2018 05:00
@miss-islington

Copy link
Copy Markdown
Contributor Author

@njsmith: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants