diff options
Diffstat (limited to 'src/lib/libcrypto/des/read_pwd.c')
-rw-r--r-- | src/lib/libcrypto/des/read_pwd.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/lib/libcrypto/des/read_pwd.c b/src/lib/libcrypto/des/read_pwd.c index 9061935f21..ce5fa00a37 100644 --- a/src/lib/libcrypto/des/read_pwd.c +++ b/src/lib/libcrypto/des/read_pwd.c | |||
@@ -101,8 +101,10 @@ | |||
101 | 101 | ||
102 | #ifdef WIN_CONSOLE_BUG | 102 | #ifdef WIN_CONSOLE_BUG |
103 | #include <windows.h> | 103 | #include <windows.h> |
104 | #ifndef OPENSSL_SYS_WINCE | ||
104 | #include <wincon.h> | 105 | #include <wincon.h> |
105 | #endif | 106 | #endif |
107 | #endif | ||
106 | 108 | ||
107 | 109 | ||
108 | /* There are 5 types of terminal interface supported, | 110 | /* There are 5 types of terminal interface supported, |
@@ -133,7 +135,7 @@ | |||
133 | #define SGTTY | 135 | #define SGTTY |
134 | #endif | 136 | #endif |
135 | 137 | ||
136 | #if defined(OPENSSL_SYS_VSWORKS) | 138 | #if defined(OPENSSL_SYS_VXWORKS) |
137 | #undef TERMIOS | 139 | #undef TERMIOS |
138 | #undef TERMIO | 140 | #undef TERMIO |
139 | #undef SGTTY | 141 | #undef SGTTY |
@@ -167,7 +169,7 @@ | |||
167 | #include <sys/ioctl.h> | 169 | #include <sys/ioctl.h> |
168 | #endif | 170 | #endif |
169 | 171 | ||
170 | #if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__) | 172 | #if defined(OPENSSL_SYS_MSDOS) && !defined(__CYGWIN32__) && !defined(OPENSSL_SYS_WINCE) |
171 | #include <conio.h> | 173 | #include <conio.h> |
172 | #define fgets(a,b,c) noecho_fgets(a,b,c) | 174 | #define fgets(a,b,c) noecho_fgets(a,b,c) |
173 | #endif | 175 | #endif |
@@ -218,11 +220,29 @@ int des_read_pw_string(char *buf, int length, const char *prompt, | |||
218 | int ret; | 220 | int ret; |
219 | 221 | ||
220 | ret=des_read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify); | 222 | ret=des_read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify); |
221 | memset(buff,0,BUFSIZ); | 223 | OPENSSL_cleanse(buff,BUFSIZ); |
222 | return(ret); | 224 | return(ret); |
223 | } | 225 | } |
224 | 226 | ||
225 | #ifndef OPENSSL_SYS_WIN16 | 227 | #ifdef OPENSSL_SYS_WINCE |
228 | |||
229 | int des_read_pw(char *buf, char *buff, int size, const char *prompt, int verify) | ||
230 | { | ||
231 | memset(buf,0,size); | ||
232 | memset(buff,0,size); | ||
233 | return(0); | ||
234 | } | ||
235 | |||
236 | #elif defined(OPENSSL_SYS_WIN16) | ||
237 | |||
238 | int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify) | ||
239 | { | ||
240 | memset(buf,0,size); | ||
241 | memset(buff,0,size); | ||
242 | return(0); | ||
243 | } | ||
244 | |||
245 | #else /* !OPENSSL_SYS_WINCE && !OPENSSL_SYS_WIN16 */ | ||
226 | 246 | ||
227 | static void read_till_nl(FILE *in) | 247 | static void read_till_nl(FILE *in) |
228 | { | 248 | { |
@@ -274,7 +294,7 @@ int des_read_pw(char *buf, char *buff, int size, const char *prompt, | |||
274 | #ifdef OPENSSL_SYS_MSDOS | 294 | #ifdef OPENSSL_SYS_MSDOS |
275 | if ((tty=fopen("con","r")) == NULL) | 295 | if ((tty=fopen("con","r")) == NULL) |
276 | tty=stdin; | 296 | tty=stdin; |
277 | #elif defined(MAC_OS_pre_X) || defined(OPENSSL_SYS_VSWORKS) | 297 | #elif defined(MAC_OS_pre_X) || defined(OPENSSL_SYS_VXWORKS) |
278 | tty=stdin; | 298 | tty=stdin; |
279 | #else | 299 | #else |
280 | #ifndef OPENSSL_SYS_MPE | 300 | #ifndef OPENSSL_SYS_MPE |
@@ -393,17 +413,6 @@ error: | |||
393 | return(!ok); | 413 | return(!ok); |
394 | } | 414 | } |
395 | 415 | ||
396 | #else /* OPENSSL_SYS_WIN16 */ | ||
397 | |||
398 | int des_read_pw(char *buf, char *buff, int size, char *prompt, int verify) | ||
399 | { | ||
400 | memset(buf,0,size); | ||
401 | memset(buff,0,size); | ||
402 | return(0); | ||
403 | } | ||
404 | |||
405 | #endif | ||
406 | |||
407 | static void pushsig(void) | 416 | static void pushsig(void) |
408 | { | 417 | { |
409 | int i; | 418 | int i; |
@@ -466,7 +475,7 @@ static void recsig(int i) | |||
466 | #endif | 475 | #endif |
467 | } | 476 | } |
468 | 477 | ||
469 | #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN16) | 478 | #ifdef OPENSSL_SYS_MSDOS |
470 | static int noecho_fgets(char *buf, int size, FILE *tty) | 479 | static int noecho_fgets(char *buf, int size, FILE *tty) |
471 | { | 480 | { |
472 | int i; | 481 | int i; |
@@ -509,3 +518,4 @@ static int noecho_fgets(char *buf, int size, FILE *tty) | |||
509 | return(strlen(buf)); | 518 | return(strlen(buf)); |
510 | } | 519 | } |
511 | #endif | 520 | #endif |
521 | #endif /* !OPENSSL_SYS_WINCE && !WIN16 */ | ||