summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/src/apps/s_apps.h10
-rw-r--r--src/lib/libssl/src/apps/s_client.c50
-rw-r--r--src/lib/libssl/src/apps/s_server.c22
3 files changed, 0 insertions, 82 deletions
diff --git a/src/lib/libssl/src/apps/s_apps.h b/src/lib/libssl/src/apps/s_apps.h
index 95a13119cb..87d739d6c1 100644
--- a/src/lib/libssl/src/apps/s_apps.h
+++ b/src/lib/libssl/src/apps/s_apps.h
@@ -108,19 +108,9 @@
108 * Hudson (tjh@cryptsoft.com). 108 * Hudson (tjh@cryptsoft.com).
109 * 109 *
110 */ 110 */
111#if !defined(OPENSSL_SYS_NETWARE) /* conflicts with winsock2 stuff on netware */
112#include <sys/types.h> 111#include <sys/types.h>
113#endif
114#include <openssl/opensslconf.h> 112#include <openssl/opensslconf.h>
115 113
116#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
117#include <conio.h>
118#endif
119
120#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
121#define _kbhit kbhit
122#endif
123
124#define PORT 4433 114#define PORT 4433
125#define PORT_STR "4433" 115#define PORT_STR "4433"
126#define PROTOCOL "tcp" 116#define PROTOCOL "tcp"
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c
index 3f0d570433..d7552b1f1f 100644
--- a/src/lib/libssl/src/apps/s_client.c
+++ b/src/lib/libssl/src/apps/s_client.c
@@ -590,9 +590,6 @@ int MAIN(int argc, char **argv)
590 ENGINE *ssl_client_engine=NULL; 590 ENGINE *ssl_client_engine=NULL;
591#endif 591#endif
592 ENGINE *e=NULL; 592 ENGINE *e=NULL;
593#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
594 struct timeval tv;
595#endif
596#ifndef OPENSSL_NO_TLSEXT 593#ifndef OPENSSL_NO_TLSEXT
597 char *servername = NULL; 594 char *servername = NULL;
598 tlsextctx tlsextcbp = 595 tlsextctx tlsextcbp =
@@ -1554,7 +1551,6 @@ SSL_set_tlsext_status_ids(con, ids);
1554 1551
1555 if (!ssl_pending) 1552 if (!ssl_pending)
1556 { 1553 {
1557#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5)
1558 if (tty_on) 1554 if (tty_on)
1559 { 1555 {
1560 if (read_tty) openssl_fdset(fileno(stdin),&readfds); 1556 if (read_tty) openssl_fdset(fileno(stdin),&readfds);
@@ -1564,14 +1560,6 @@ SSL_set_tlsext_status_ids(con, ids);
1564 openssl_fdset(SSL_get_fd(con),&readfds); 1560 openssl_fdset(SSL_get_fd(con),&readfds);
1565 if (write_ssl) 1561 if (write_ssl)
1566 openssl_fdset(SSL_get_fd(con),&writefds); 1562 openssl_fdset(SSL_get_fd(con),&writefds);
1567#else
1568 if(!tty_on || !write_tty) {
1569 if (read_ssl)
1570 openssl_fdset(SSL_get_fd(con),&readfds);
1571 if (write_ssl)
1572 openssl_fdset(SSL_get_fd(con),&writefds);
1573 }
1574#endif
1575/* printf("mode tty(%d %d%d) ssl(%d%d)\n", 1563/* printf("mode tty(%d %d%d) ssl(%d%d)\n",
1576 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ 1564 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
1577 1565
@@ -1581,33 +1569,8 @@ SSL_set_tlsext_status_ids(con, ids);
1581 * will choke the compiler: if you do have a cast then 1569 * will choke the compiler: if you do have a cast then
1582 * you can either go for (int *) or (void *). 1570 * you can either go for (int *) or (void *).
1583 */ 1571 */
1584#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
1585 /* Under Windows/DOS we make the assumption that we can
1586 * always write to the tty: therefore if we need to
1587 * write to the tty we just fall through. Otherwise
1588 * we timeout the select every second and see if there
1589 * are any keypresses. Note: this is a hack, in a proper
1590 * Windows application we wouldn't do this.
1591 */
1592 i=0;
1593 if(!write_tty) {
1594 if(read_tty) {
1595 tv.tv_sec = 1;
1596 tv.tv_usec = 0;
1597 i=select(width,(void *)&readfds,(void *)&writefds,
1598 NULL,&tv);
1599#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1600 if(!i && (!_kbhit() || !read_tty) ) continue;
1601#else
1602 if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
1603#endif
1604 } else i=select(width,(void *)&readfds,(void *)&writefds,
1605 NULL,timeoutp);
1606 }
1607#else
1608 i=select(width,(void *)&readfds,(void *)&writefds, 1572 i=select(width,(void *)&readfds,(void *)&writefds,
1609 NULL,timeoutp); 1573 NULL,timeoutp);
1610#endif
1611 if ( i < 0) 1574 if ( i < 0)
1612 { 1575 {
1613 BIO_printf(bio_err,"bad select %d\n", 1576 BIO_printf(bio_err,"bad select %d\n",
@@ -1690,12 +1653,7 @@ SSL_set_tlsext_status_ids(con, ids);
1690 goto shut; 1653 goto shut;
1691 } 1654 }
1692 } 1655 }
1693#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
1694 /* Assume Windows/DOS/BeOS can always write */
1695 else if (!ssl_pending && write_tty)
1696#else
1697 else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds)) 1656 else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
1698#endif
1699 { 1657 {
1700 i=raw_write_stdout(&(sbuf[sbuf_off]),sbuf_len); 1658 i=raw_write_stdout(&(sbuf[sbuf_off]),sbuf_len);
1701 1659
@@ -1771,15 +1729,7 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
1771 } 1729 }
1772 } 1730 }
1773 1731
1774#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS)
1775#if defined(OPENSSL_SYS_WINCE) || defined(OPENSSL_SYS_MSDOS)
1776 else if (_kbhit())
1777#else
1778 else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
1779#endif
1780#else
1781 else if (FD_ISSET(fileno(stdin),&readfds)) 1732 else if (FD_ISSET(fileno(stdin),&readfds))
1782#endif
1783 { 1733 {
1784 if (crlf) 1734 if (crlf)
1785 { 1735 {
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index 7fafe56359..7309f740e4 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -1780,11 +1780,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
1780 KSSL_CTX *kctx; 1780 KSSL_CTX *kctx;
1781#endif 1781#endif
1782 struct timeval timeout; 1782 struct timeval timeout;
1783#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5)
1784 struct timeval tv;
1785#else
1786 struct timeval *timeoutp; 1783 struct timeval *timeoutp;
1787#endif
1788 1784
1789 if ((buf=malloc(bufsize)) == NULL) 1785 if ((buf=malloc(bufsize)) == NULL)
1790 { 1786 {
@@ -1915,9 +1911,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
1915 if (!read_from_sslcon) 1911 if (!read_from_sslcon)
1916 { 1912 {
1917 FD_ZERO(&readfds); 1913 FD_ZERO(&readfds);
1918#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5)
1919 openssl_fdset(fileno(stdin),&readfds); 1914 openssl_fdset(fileno(stdin),&readfds);
1920#endif
1921 openssl_fdset(s,&readfds); 1915 openssl_fdset(s,&readfds);
1922 /* Note: under VMS with SOCKETSHR the second parameter is 1916 /* Note: under VMS with SOCKETSHR the second parameter is
1923 * currently of type (int *) whereas under other systems 1917 * currently of type (int *) whereas under other systems
@@ -1925,19 +1919,6 @@ static int sv_body(char *hostname, int s, unsigned char *context)
1925 * the compiler: if you do have a cast then you can either 1919 * the compiler: if you do have a cast then you can either
1926 * go for (int *) or (void *). 1920 * go for (int *) or (void *).
1927 */ 1921 */
1928#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE)
1929 /* Under DOS (non-djgpp) and Windows we can't select on stdin: only
1930 * on sockets. As a workaround we timeout the select every
1931 * second and check for any keypress. In a proper Windows
1932 * application we wouldn't do this because it is inefficient.
1933 */
1934 tv.tv_sec = 1;
1935 tv.tv_usec = 0;
1936 i=select(width,(void *)&readfds,NULL,NULL,&tv);
1937 if((i < 0) || (!i && !_kbhit() ) )continue;
1938 if(_kbhit())
1939 read_from_terminal = 1;
1940#else
1941 if ((SSL_version(con) == DTLS1_VERSION) && 1922 if ((SSL_version(con) == DTLS1_VERSION) &&
1942 DTLSv1_get_timeout(con, &timeout)) 1923 DTLSv1_get_timeout(con, &timeout))
1943 timeoutp = &timeout; 1924 timeoutp = &timeout;
@@ -1954,7 +1935,6 @@ static int sv_body(char *hostname, int s, unsigned char *context)
1954 if (i <= 0) continue; 1935 if (i <= 0) continue;
1955 if (FD_ISSET(fileno(stdin),&readfds)) 1936 if (FD_ISSET(fileno(stdin),&readfds))
1956 read_from_terminal = 1; 1937 read_from_terminal = 1;
1957#endif
1958 if (FD_ISSET(s,&readfds)) 1938 if (FD_ISSET(s,&readfds))
1959 read_from_sslcon = 1; 1939 read_from_sslcon = 1;
1960 } 1940 }
@@ -2475,9 +2455,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
2475 else 2455 else
2476 { 2456 {
2477 BIO_printf(bio_s_out,"read R BLOCK\n"); 2457 BIO_printf(bio_s_out,"read R BLOCK\n");
2478#if !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__)
2479 sleep(1); 2458 sleep(1);
2480#endif
2481 continue; 2459 continue;
2482 } 2460 }
2483 } 2461 }