@@ -180,13 +180,6 @@ typedef unsigned int u_int;
180180# include <fcntl.h>
181181#endif
182182
183- /* Use Windows API with STD_INPUT_HANDLE when checking for input?
184- Don't look at OPENSSL_SYS_MSDOS for this, since it is always defined if
185- OPENSSL_SYS_WINDOWS is defined */
186- #if defined(OPENSSL_SYS_WINDOWS ) && !defined(OPENSSL_SYS_WINCE ) && defined(STD_INPUT_HANDLE )
187- #define OPENSSL_USE_STD_INPUT_HANDLE
188- #endif
189-
190183#undef PROG
191184#define PROG s_client_main
192185
@@ -236,7 +229,6 @@ static BIO *bio_c_msg = NULL;
236229static int c_quiet = 0 ;
237230static int c_ign_eof = 0 ;
238231static int c_brief = 0 ;
239- static int c_no_rand_screen = 0 ;
240232
241233#ifndef OPENSSL_NO_PSK
242234/* Default PSK identity and key */
@@ -452,10 +444,6 @@ static void sc_usage(void)
452444 " -keymatexport label - Export keying material using label\n" );
453445 BIO_printf (bio_err ,
454446 " -keymatexportlen len - Export len bytes of keying material (default 20)\n" );
455- #ifdef OPENSSL_SYS_WINDOWS
456- BIO_printf (bio_err ,
457- " -no_rand_screen - Do not use RAND_screen() to initialize random state\n" );
458- #endif
459447}
460448
461449#ifndef OPENSSL_NO_TLSEXT
@@ -1148,10 +1136,6 @@ int MAIN(int argc, char **argv)
11481136 keymatexportlen = atoi (* (++ argv ));
11491137 if (keymatexportlen == 0 )
11501138 goto bad ;
1151- #ifdef OPENSSL_SYS_WINDOWS
1152- } else if (strcmp (* argv , "-no_rand_screen" ) == 0 ) {
1153- c_no_rand_screen = 1 ;
1154- #endif
11551139 } else {
11561140 BIO_printf (bio_err , "unknown option %s\n" , * argv );
11571141 badop = 1 ;
@@ -1268,7 +1252,7 @@ int MAIN(int argc, char **argv)
12681252 if (!load_excert (& exc , bio_err ))
12691253 goto end ;
12701254
1271- if (!app_RAND_load_file (NULL , bio_err , ++ c_no_rand_screen ) && inrand == NULL
1255+ if (!app_RAND_load_file (NULL, bio_err , 1 ) && inrand == NULL
12721256 && !RAND_status ()) {
12731257 BIO_printf (bio_err ,
12741258 "warning , not much extra random data , consider using the - rand option \n ");
@@ -1806,16 +1790,17 @@ int MAIN(int argc, char **argv)
18061790 tv .tv_usec = 0 ;
18071791 i = select (width , (void * )& readfds , (void * )& writefds ,
18081792 NULL , & tv );
1809- #if defined(OPENSSL_USE_STD_INPUT_HANDLE )
1793+ # if defined(OPENSSL_SYS_WINCE ) || defined(OPENSSL_SYS_MSDOS )
1794+ if (!i && (!_kbhit () || !read_tty ))
1795+ continue ;
1796+ # else
18101797 if (!i && (!((_kbhit ())
18111798 || (WAIT_OBJECT_0 ==
18121799 WaitForSingleObject (GetStdHandle
18131800 (STD_INPUT_HANDLE ),
18141801 0 )))
18151802 || !read_tty ))
18161803 continue ;
1817- #else
1818- if (!i && (!_kbhit () || !read_tty ) ) continue ;
18191804# endif
18201805 } else
18211806 i = select (width , (void * )& readfds , (void * )& writefds ,
@@ -2017,12 +2002,12 @@ int MAIN(int argc, char **argv)
20172002 }
20182003 }
20192004#if defined(OPENSSL_SYS_WINDOWS ) || defined(OPENSSL_SYS_MSDOS )
2020- #if defined(OPENSSL_USE_STD_INPUT_HANDLE )
2005+ # if defined(OPENSSL_SYS_WINCE ) || defined(OPENSSL_SYS_MSDOS )
2006+ else if (_kbhit ())
2007+ # else
20212008 else if ((_kbhit ())
20222009 || (WAIT_OBJECT_0 ==
20232010 WaitForSingleObject (GetStdHandle (STD_INPUT_HANDLE ), 0 )))
2024- #else
2025- else if (_kbhit ())
20262011# endif
20272012#elif defined (OPENSSL_SYS_NETWARE )
20282013 else if (_kbhit ())
0 commit comments