Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.7] closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) #21389

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
closes bpo-41235: Fix the error handling in SSLContext.load_dh_params…
…() (GH-21385)

(cherry picked from commit aebc049)

Co-authored-by: Zackery Spytz <[email protected]>
  • Loading branch information
ZackerySpytz authored and miss-islington committed Jul 8, 2020
commit 0e0be2999cf3fdcc21194bf9a4df730802f90956
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`.
6 changes: 4 additions & 2 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4189,8 +4189,10 @@ _ssl__SSLContext_load_dh_params(PySSLContext *self, PyObject *filepath)
}
return NULL;
}
if (SSL_CTX_set_tmp_dh(self->ctx, dh) == 0)
_setSSLError(NULL, 0, __FILE__, __LINE__);
if (!SSL_CTX_set_tmp_dh(self->ctx, dh)) {
DH_free(dh);
return _setSSLError(NULL, 0, __FILE__, __LINE__);
}
DH_free(dh);
Py_RETURN_NONE;
}
Expand Down