@@ -180,13 +180,6 @@ typedef unsigned int u_int;
180
180
# include <fcntl.h>
181
181
#endif
182
182
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
-
190
183
#undef PROG
191
184
#define PROG s_client_main
192
185
@@ -236,7 +229,6 @@ static BIO *bio_c_msg = NULL;
236
229
static int c_quiet = 0 ;
237
230
static int c_ign_eof = 0 ;
238
231
static int c_brief = 0 ;
239
- static int c_no_rand_screen = 0 ;
240
232
241
233
#ifndef OPENSSL_NO_PSK
242
234
/* Default PSK identity and key */
@@ -452,10 +444,6 @@ static void sc_usage(void)
452
444
" -keymatexport label - Export keying material using label\n" );
453
445
BIO_printf (bio_err ,
454
446
" -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
459
447
}
460
448
461
449
#ifndef OPENSSL_NO_TLSEXT
@@ -1148,10 +1136,6 @@ int MAIN(int argc, char **argv)
1148
1136
keymatexportlen = atoi (* (++ argv ));
1149
1137
if (keymatexportlen == 0 )
1150
1138
goto bad ;
1151
- #ifdef OPENSSL_SYS_WINDOWS
1152
- } else if (strcmp (* argv , "-no_rand_screen" ) == 0 ) {
1153
- c_no_rand_screen = 1 ;
1154
- #endif
1155
1139
} else {
1156
1140
BIO_printf (bio_err , "unknown option %s\n" , * argv );
1157
1141
badop = 1 ;
@@ -1268,7 +1252,7 @@ int MAIN(int argc, char **argv)
1268
1252
if (!load_excert (& exc , bio_err ))
1269
1253
goto end ;
1270
1254
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
1272
1256
&& !RAND_status ()) {
1273
1257
BIO_printf (bio_err ,
1274
1258
"warning , not much extra random data , consider using the - rand option \n ");
@@ -1683,6 +1667,8 @@ int MAIN(int argc, char **argv)
1683
1667
if (strstr (mbuf , "/stream :features > "))
1684
1668
goto shut ;
1685
1669
seen = BIO_read (sbio , mbuf , BUFSIZZ );
1670
+ if (seen <= 0 )
1671
+ goto shut ;
1686
1672
mbuf [seen ] = 0 ;
1687
1673
}
1688
1674
BIO_printf (sbio ,
@@ -1806,16 +1792,17 @@ int MAIN(int argc, char **argv)
1806
1792
tv .tv_usec = 0 ;
1807
1793
i = select (width , (void * )& readfds , (void * )& writefds ,
1808
1794
NULL , & tv );
1809
- #if defined(OPENSSL_USE_STD_INPUT_HANDLE )
1795
+ # if defined(OPENSSL_SYS_WINCE ) || defined(OPENSSL_SYS_MSDOS )
1796
+ if (!i && (!_kbhit () || !read_tty ))
1797
+ continue ;
1798
+ # else
1810
1799
if (!i && (!((_kbhit ())
1811
1800
|| (WAIT_OBJECT_0 ==
1812
1801
WaitForSingleObject (GetStdHandle
1813
1802
(STD_INPUT_HANDLE ),
1814
1803
0 )))
1815
1804
|| !read_tty ))
1816
1805
continue ;
1817
- #else
1818
- if (!i && (!_kbhit () || !read_tty ) ) continue ;
1819
1806
# endif
1820
1807
} else
1821
1808
i = select (width , (void * )& readfds , (void * )& writefds ,
@@ -2017,12 +2004,12 @@ int MAIN(int argc, char **argv)
2017
2004
}
2018
2005
}
2019
2006
#if defined(OPENSSL_SYS_WINDOWS ) || defined(OPENSSL_SYS_MSDOS )
2020
- #if defined(OPENSSL_USE_STD_INPUT_HANDLE )
2007
+ # if defined(OPENSSL_SYS_WINCE ) || defined(OPENSSL_SYS_MSDOS )
2008
+ else if (_kbhit ())
2009
+ # else
2021
2010
else if ((_kbhit ())
2022
2011
|| (WAIT_OBJECT_0 ==
2023
2012
WaitForSingleObject (GetStdHandle (STD_INPUT_HANDLE ), 0 )))
2024
- #else
2025
- else if (_kbhit ())
2026
2013
# endif
2027
2014
#elif defined (OPENSSL_SYS_NETWARE )
2028
2015
else if (_kbhit ())
0 commit comments