mirror of
https://github.com/python/cpython.git
synced 2025-12-09 02:35:14 +00:00
bpo-43789: OpenSSL 3.0.0 Don't call passwd callback again in error case (GH-25303)
This commit is contained in:
parent
bd88ccb943
commit
d3b73f32ef
2 changed files with 9 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
||||||
|
OpenSSL 3.0.0: Don't call the password callback function a second time when
|
||||||
|
first call has signaled an error condition.
|
||||||
|
|
@ -3926,6 +3926,13 @@ _password_callback(char *buf, int size, int rwflag, void *userdata)
|
||||||
|
|
||||||
PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
|
PySSL_END_ALLOW_THREADS_S(pw_info->thread_state);
|
||||||
|
|
||||||
|
if (pw_info->error) {
|
||||||
|
/* already failed previously. OpenSSL 3.0.0-alpha14 invokes the
|
||||||
|
* callback multiple times which can lead to fatal Python error in
|
||||||
|
* exception check. */
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (pw_info->callable) {
|
if (pw_info->callable) {
|
||||||
fn_ret = _PyObject_CallNoArg(pw_info->callable);
|
fn_ret = _PyObject_CallNoArg(pw_info->callable);
|
||||||
if (!fn_ret) {
|
if (!fn_ret) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue