summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/read_pwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/read_pwd.c')
-rw-r--r--src/lib/libcrypto/des/read_pwd.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/libcrypto/des/read_pwd.c b/src/lib/libcrypto/des/read_pwd.c
index fa2d67da64..c27ec336e7 100644
--- a/src/lib/libcrypto/des/read_pwd.c
+++ b/src/lib/libcrypto/des/read_pwd.c
@@ -161,7 +161,7 @@
161#include <sys/ioctl.h> 161#include <sys/ioctl.h>
162#endif 162#endif
163 163
164#ifdef MSDOS 164#if defined(MSDOS) && !defined(__CYGWIN32__)
165#include <conio.h> 165#include <conio.h>
166#define fgets(a,b,c) noecho_fgets(a,b,c) 166#define fgets(a,b,c) noecho_fgets(a,b,c)
167#endif 167#endif
@@ -265,13 +265,17 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
265 is_a_tty=1; 265 is_a_tty=1;
266 tty=NULL; 266 tty=NULL;
267 267
268#ifndef MSDOS 268#ifdef MSDOS
269 if ((tty=fopen("/dev/tty","r")) == NULL)
270 tty=stdin;
271#else /* MSDOS */
272 if ((tty=fopen("con","r")) == NULL) 269 if ((tty=fopen("con","r")) == NULL)
273 tty=stdin; 270 tty=stdin;
274#endif /* MSDOS */ 271#elif defined(MAC_OS_pre_X)
272 tty=stdin;
273#else
274#ifndef MPE
275 if ((tty=fopen("/dev/tty","r")) == NULL)
276#endif
277 tty=stdin;
278#endif
275 279
276#if defined(TTY_get) && !defined(VMS) 280#if defined(TTY_get) && !defined(VMS)
277 if (TTY_get(fileno(tty),&tty_orig) == -1) 281 if (TTY_get(fileno(tty),&tty_orig) == -1)
@@ -310,8 +314,12 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
310 314
311#if defined(TTY_set) && !defined(VMS) 315#if defined(TTY_set) && !defined(VMS)
312 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1)) 316 if (is_a_tty && (TTY_set(fileno(tty),&tty_new) == -1))
317#ifdef MPE
318 ; /* MPE lies -- echo really has been disabled */
319#else
313 return(-1); 320 return(-1);
314#endif 321#endif
322#endif
315#ifdef VMS 323#ifdef VMS
316 tty_new[0] = tty_orig[0]; 324 tty_new[0] = tty_orig[0];
317 tty_new[1] = tty_orig[1] | TT$M_NOECHO; 325 tty_new[1] = tty_orig[1] | TT$M_NOECHO;