summaryrefslogtreecommitdiffstats
path: root/crypto/ui/ui_openssl.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2018-05-02 14:18:55 +0200
committerRichard Levitte <levitte@openssl.org>2018-05-14 11:00:23 +0200
commitde03cc92d1f3758ad1a525893c93e16b15e6cf45 (patch)
treef65cbca2d843fe439bf50ffe5a0c2bddb06ab8a9 /crypto/ui/ui_openssl.c
parent1c534560dc905b6d399dbde242422f0cf5543286 (diff)
UI console: Restore tty settings, do not force ECHO after prompt
The Console UI method always set echo on after prompting without echo. However, echo might not have been on originally, so just restore the original TTY settings. Fixes #2373 Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6156)
Diffstat (limited to 'crypto/ui/ui_openssl.c')
-rw-r--r--crypto/ui/ui_openssl.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 3ccd8a720e..078d10cadd 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -503,17 +503,13 @@ static int echo_console(UI *ui)
{
# if defined(TTY_set) && !defined(OPENSSL_SYS_VMS)
memcpy(&(tty_new), &(tty_orig), sizeof(tty_orig));
- tty_new.TTY_FLAGS |= ECHO;
-# endif
-
-# if defined(TTY_set) && !defined(OPENSSL_SYS_VMS)
if (is_a_tty && (TTY_set(fileno(tty_in), &tty_new) == -1))
return 0;
# endif
# ifdef OPENSSL_SYS_VMS
if (is_a_tty) {
tty_new[0] = tty_orig[0];
- tty_new[1] = tty_orig[1] & ~TT$M_NOECHO;
+ tty_new[1] = tty_orig[1];
tty_new[2] = tty_orig[2];
status = sys$qiow(0, channel, IO$_SETMODE, &iosb, 0, 0, tty_new, 12,
0, 0, 0, 0);
@@ -534,7 +530,6 @@ static int echo_console(UI *ui)
# if defined(_WIN32) && !defined(_WIN32_WCE)
if (is_a_tty) {
tty_new = tty_orig;
- tty_new |= ENABLE_ECHO_INPUT;
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), tty_new);
}
# endif