mirror of
https://github.com/python/cpython.git
synced 2025-12-07 17:57:56 +00:00
closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385)
This commit is contained in:
parent
6f13adf59e
commit
aebc049557
2 changed files with 5 additions and 2 deletions
|
|
@ -0,0 +1 @@
|
||||||
|
Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`.
|
||||||
|
|
@ -4309,8 +4309,10 @@ _ssl__SSLContext_load_dh_params(PySSLContext *self, PyObject *filepath)
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (SSL_CTX_set_tmp_dh(self->ctx, dh) == 0)
|
if (!SSL_CTX_set_tmp_dh(self->ctx, dh)) {
|
||||||
_setSSLError(NULL, 0, __FILE__, __LINE__);
|
DH_free(dh);
|
||||||
|
return _setSSLError(NULL, 0, __FILE__, __LINE__);
|
||||||
|
}
|
||||||
DH_free(dh);
|
DH_free(dh);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue