RT3544: Remove MWERKS support
[openssl.git] / crypto / des / read_pwd.c
index 00000190f8062ed8a7eed269bcedfdb3287cbaf3..7e3f9020dca619c3c27d4583bd8b1847053f19a2 100644 (file)
 
 #ifdef WIN_CONSOLE_BUG
 #include <windows.h>
+#ifndef OPENSSL_SYS_WINCE
 #include <wincon.h>
 #endif
+#endif
 
 
 /* There are 5 types of terminal interface supported,
 #undef  SGTTY
 #endif
 
-#if !defined(TERMIO) && !defined(TERMIOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MSDOS) && !defined(MAC_OS_pre_X) && !defined(MAC_OS_GUSI_SOURCE)
+#if !defined(TERMIO) && !defined(TERMIOS) && !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_MSDOS)
 #undef  TERMIOS
 #undef  TERMIO
 #define SGTTY
 #endif
 
-#if defined(OPENSSL_SYS_VSWORKS)
+#if defined(OPENSSL_SYS_VXWORKS)
 #undef TERMIOS
 #undef TERMIO
 #undef SGTTY
 #define TTY_set(tty,data)      ioctl(tty,TIOCSETP,data)
 #endif
 
-#if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS) && !defined(MAC_OS_pre_X)
+#if !defined(_LIBC) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_VMS)
 #include <sys/ioctl.h>
 #endif
 
-#if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__)
+#if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__) && !defined(OPENSSL_SYS_WINCE)
 #include <conio.h>
 #define fgets(a,b,c) noecho_fgets(a,b,c)
 #endif
@@ -184,14 +186,6 @@ struct IOSB {
        };
 #endif
 
-#if defined(MAC_OS_pre_X) || defined(MAC_OS_GUSI_SOURCE)
-/*
- * This one needs work. As a matter of fact the code is unoperational
- * and this is only a trick to get it compiled.
- *                                     <appro@fy.chalmers.se>
- */
-#define TTY_STRUCT int
-#endif
 
 #ifndef NX509_SIG
 #define NX509_SIG 32
@@ -218,11 +212,29 @@ int des_read_pw_string(char *buf, int length, const char *prompt,
        int ret;
 
        ret=des_read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify);
-       memset(buff,0,BUFSIZ);
+       OPENSSL_cleanse(buff,BUFSIZ);
        return(ret);
        }
 
-#ifndef OPENSSL_SYS_WIN16
+#ifdef OPENSSL_SYS_WINCE
+
+int des_read_pw(char *buf, char *buff, int size, const char *prompt, int verify)
+       { 
+       memset(buf,0,size);
+       memset(buff,0,size);
+       return(0);
+       }
+
+#elif defined(OPENSSL_SYS_WIN16)
+
+int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify)
+       { 
+       memset(buf,0,size);
+       memset(buff,0,size);
+       return(0);
+       }
+
+#else /* !OPENSSL_SYS_WINCE && !OPENSSL_SYS_WIN16 */
 
 static void read_till_nl(FILE *in)
        {
@@ -246,7 +258,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
        long status;
        unsigned short channel = 0;
 #else
-#ifndef OPENSSL_SYS_MSDOS
+#if !defined(OPENSSL_SYS_MSDOS) || defined(__DJGPP__)
        TTY_STRUCT tty_orig,tty_new;
 #endif
 #endif
@@ -274,7 +286,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt,
 #ifdef OPENSSL_SYS_MSDOS
        if ((tty=fopen("con","r")) == NULL)
                tty=stdin;
-#elif defined(MAC_OS_pre_X) || defined(OPENSSL_SYS_VSWORKS)
+#elif defined(OPENSSL_SYS_VXWORKS)
        tty=stdin;
 #else
 #ifndef OPENSSL_SYS_MPE
@@ -393,17 +405,6 @@ error:
        return(!ok);
        }
 
-#else /* OPENSSL_SYS_WIN16 */
-
-int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify)
-       { 
-       memset(buf,0,size);
-       memset(buff,0,size);
-       return(0);
-       }
-
-#endif
-
 static void pushsig(void)
        {
        int i;
@@ -466,7 +467,7 @@ static void recsig(int i)
 #endif
        }
 
-#if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN16)
+#ifdef OPENSSL_SYS_MSDOS
 static int noecho_fgets(char *buf, int size, FILE *tty)
        {
        int i;
@@ -509,3 +510,4 @@ static int noecho_fgets(char *buf, int size, FILE *tty)
        return(strlen(buf));
        }
 #endif
+#endif /* !OPENSSL_SYS_WINCE && !WIN16 */