CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2026/07/25 01:33:43
Modified files:
lib/libcrypto/ui: ui_lib.c
Log message:
Unlock CRYPTO_LOCK_UI on ui_open_session() failure
Both ui_open_session() implementations, open_console() in ui_openssl.c
in base, and the one in ui_openssl_win.c in portable, grab the lock of
type CRYPTO_LOCK_UI before doing anything else.
The only internal (and, as far as I can tell, the only existing) caller,
UI_process(), returns immediately on failure. The calling thread thus
keeps holding the lock and the next call to UI_process() will block
indefinitely. Fix this by using the common exit path, which calls
ui_close_session() aka close_console(), both implementations of which
release the lock.
Thanks to Kartik (@sage-mode-hunter) who proposed an alternative fix for
ui_openssl_win.c, which we would have to apply to ui_openssl.c as well.
Matches OpenSSL behavior since PR #2037
Closes https://github.com/libressl/portable/pull/1334
ok kenjiro