From f3dc1299799248360fcda3d1663b42be7cb54d5f Mon Sep 17 00:00:00 2001 From: jsing Date: Fri, 18 Apr 2014 01:07:13 +0000 Subject: [PATCH] Remove support for unwanted operating systems. ok miod@ --- lib/libssl/src/apps/s_apps.h | 10 ------- lib/libssl/src/apps/s_client.c | 50 ---------------------------------- lib/libssl/src/apps/s_server.c | 22 --------------- 3 files changed, 82 deletions(-) diff --git a/lib/libssl/src/apps/s_apps.h b/lib/libssl/src/apps/s_apps.h index 95a13119cbd..87d739d6c11 100644 --- a/lib/libssl/src/apps/s_apps.h +++ b/lib/libssl/src/apps/s_apps.h @@ -108,19 +108,9 @@ * Hudson (tjh@cryptsoft.com). * */ -#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */ #include -#endif #include -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -#include -#endif - -#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32) -#define _kbhit kbhit -#endif - #define PORT 4433 #define PORT_STR "4433" #define PROTOCOL "tcp" diff --git a/lib/libssl/src/apps/s_client.c b/lib/libssl/src/apps/s_client.c index 3f0d5704336..d7552b1f1fe 100644 --- a/lib/libssl/src/apps/s_client.c +++ b/lib/libssl/src/apps/s_client.c @@ -590,9 +590,6 @@ int MAIN(int argc, char **argv) ENGINE *ssl_client_engine=NULL; #endif ENGINE *e=NULL; -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) - struct timeval tv; -#endif #ifndef OPENSSL_NO_TLSEXT char *servername = NULL; tlsextctx tlsextcbp = @@ -1554,7 +1551,6 @@ SSL_set_tlsext_status_ids(con, ids); if (!ssl_pending) { -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5) if (tty_on) { if (read_tty) openssl_fdset(fileno(stdin),&readfds); @@ -1564,14 +1560,6 @@ SSL_set_tlsext_status_ids(con, ids); openssl_fdset(SSL_get_fd(con),&readfds); if (write_ssl) openssl_fdset(SSL_get_fd(con),&writefds); -#else - if(!tty_on || !write_tty) { - if (read_ssl) - openssl_fdset(SSL_get_fd(con),&readfds); - if (write_ssl) - openssl_fdset(SSL_get_fd(con),&writefds); - } -#endif /* printf("mode tty(%d %d%d) ssl(%d%d)\n", tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ @@ -1581,33 +1569,8 @@ SSL_set_tlsext_status_ids(con, ids); * will choke the compiler: if you do have a cast then * you can either go for (int *) or (void *). */ -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) - /* Under Windows/DOS we make the assumption that we can - * always write to the tty: therefore if we need to - * write to the tty we just fall through. Otherwise - * we timeout the select every second and see if there - * are any keypresses. Note: this is a hack, in a proper - * Windows application we wouldn't do this. - */ - i=0; - if(!write_tty) { - if(read_tty) { - tv.tv_sec = 1; - tv.tv_usec = 0; - i=select(width,(void *)&readfds,(void *)&writefds, - NULL,&tv); -#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS) - if(!i && (!_kbhit() || !read_tty) ) continue; -#else - if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue; -#endif - } else i=select(width,(void *)&readfds,(void *)&writefds, - NULL,timeoutp); - } -#else i=select(width,(void *)&readfds,(void *)&writefds, NULL,timeoutp); -#endif if ( i < 0) { BIO_printf(bio_err,"bad select %d\n", @@ -1690,12 +1653,7 @@ SSL_set_tlsext_status_ids(con, ids); goto shut; } } -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) - /* Assume Windows/DOS/BeOS can always write */ - else if (!ssl_pending && write_tty) -#else else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds)) -#endif { i=raw_write_stdout(&(sbuf[sbuf_off]),sbuf_len); @@ -1771,15 +1729,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240 } } -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) -#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS) - else if (_kbhit()) -#else - else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) -#endif -#else else if (FD_ISSET(fileno(stdin),&readfds)) -#endif { if (crlf) { diff --git a/lib/libssl/src/apps/s_server.c b/lib/libssl/src/apps/s_server.c index 7fafe563594..7309f740e4f 100644 --- a/lib/libssl/src/apps/s_server.c +++ b/lib/libssl/src/apps/s_server.c @@ -1780,11 +1780,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) KSSL_CTX *kctx; #endif struct timeval timeout; -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) - struct timeval tv; -#else struct timeval *timeoutp; -#endif if ((buf=malloc(bufsize)) == NULL) { @@ -1915,9 +1911,7 @@ static int sv_body(char *hostname, int s, unsigned char *context) if (!read_from_sslcon) { FD_ZERO(&readfds); -#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5) openssl_fdset(fileno(stdin),&readfds); -#endif openssl_fdset(s,&readfds); /* Note: under VMS with SOCKETSHR the second parameter is * currently of type (int *) whereas under other systems @@ -1925,19 +1919,6 @@ static int sv_body(char *hostname, int s, unsigned char *context) * the compiler: if you do have a cast then you can either * go for (int *) or (void *). */ -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) - /* Under DOS (non-djgpp) and Windows we can't select on stdin: only - * on sockets. As a workaround we timeout the select every - * second and check for any keypress. In a proper Windows - * application we wouldn't do this because it is inefficient. - */ - tv.tv_sec = 1; - tv.tv_usec = 0; - i=select(width,(void *)&readfds,NULL,NULL,&tv); - if((i < 0) || (!i && !_kbhit() ) )continue; - if(_kbhit()) - read_from_terminal = 1; -#else if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_get_timeout(con, &timeout)) timeoutp = &timeout; @@ -1954,7 +1935,6 @@ static int sv_body(char *hostname, int s, unsigned char *context) if (i <= 0) continue; if (FD_ISSET(fileno(stdin),&readfds)) read_from_terminal = 1; -#endif if (FD_ISSET(s,&readfds)) read_from_sslcon = 1; } @@ -2475,9 +2455,7 @@ static int www_body(char *hostname, int s, unsigned char *context) else { BIO_printf(bio_s_out,"read R BLOCK\n"); -#if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) sleep(1); -#endif continue; } } -- 2.20.1