summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libssl/src/apps/s_client.c15
-rw-r--r--src/lib/libssl/src/apps/s_server.c18
-rw-r--r--src/lib/libssl/src/apps/s_time.c8
3 files changed, 6 insertions, 35 deletions
diff --git a/src/lib/libssl/src/apps/s_client.c b/src/lib/libssl/src/apps/s_client.c
index 87966e30d9..2ec72876a0 100644
--- a/src/lib/libssl/src/apps/s_client.c
+++ b/src/lib/libssl/src/apps/s_client.c
@@ -136,6 +136,8 @@
136 */ 136 */
137 137
138#include <sys/types.h> 138#include <sys/types.h>
139#include <sys/ioctl.h>
140
139#include <netinet/in.h> 141#include <netinet/in.h>
140#include <assert.h> 142#include <assert.h>
141#include <ctype.h> 143#include <ctype.h>
@@ -177,9 +179,7 @@ extern int verify_depth;
177extern int verify_error; 179extern int verify_error;
178extern int verify_return_error; 180extern int verify_return_error;
179 181
180#ifdef FIONBIO
181static int c_nbio = 0; 182static int c_nbio = 0;
182#endif
183static int c_Pause = 0; 183static int c_Pause = 0;
184static int c_debug = 0; 184static int c_debug = 0;
185#ifndef OPENSSL_NO_TLSEXT 185#ifndef OPENSSL_NO_TLSEXT
@@ -296,9 +296,7 @@ sc_usage(void)
296 BIO_printf(bio_err, " -msg - Show protocol messages\n"); 296 BIO_printf(bio_err, " -msg - Show protocol messages\n");
297 BIO_printf(bio_err, " -nbio_test - more ssl protocol testing\n"); 297 BIO_printf(bio_err, " -nbio_test - more ssl protocol testing\n");
298 BIO_printf(bio_err, " -state - print the 'ssl' states\n"); 298 BIO_printf(bio_err, " -state - print the 'ssl' states\n");
299#ifdef FIONBIO
300 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); 299 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n");
301#endif
302 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); 300 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n");
303 BIO_printf(bio_err, " -quiet - no s_client output\n"); 301 BIO_printf(bio_err, " -quiet - no s_client output\n");
304 BIO_printf(bio_err, " -ign_eof - ignore input eof (default when -quiet)\n"); 302 BIO_printf(bio_err, " -ign_eof - ignore input eof (default when -quiet)\n");
@@ -629,9 +627,7 @@ s_client_main(int argc, char **argv)
629 } 627 }
630 verify_depth = 0; 628 verify_depth = 0;
631 verify_error = X509_V_OK; 629 verify_error = X509_V_OK;
632#ifdef FIONBIO
633 c_nbio = 0; 630 c_nbio = 0;
634#endif
635 631
636 argc--; 632 argc--;
637 argv++; 633 argv++;
@@ -838,11 +834,9 @@ s_client_main(int argc, char **argv)
838 goto bad; 834 goto bad;
839 cipher = *(++argv); 835 cipher = *(++argv);
840 } 836 }
841#ifdef FIONBIO
842 else if (strcmp(*argv, "-nbio") == 0) { 837 else if (strcmp(*argv, "-nbio") == 0) {
843 c_nbio = 1; 838 c_nbio = 1;
844 } 839 }
845#endif
846 else if (strcmp(*argv, "-starttls") == 0) { 840 else if (strcmp(*argv, "-starttls") == 0) {
847 if (--argc < 1) 841 if (--argc < 1)
848 goto bad; 842 goto bad;
@@ -1167,7 +1161,6 @@ re_start:
1167 } 1161 }
1168 BIO_printf(bio_c_out, "CONNECTED(%08X)\n", s); 1162 BIO_printf(bio_c_out, "CONNECTED(%08X)\n", s);
1169 1163
1170#ifdef FIONBIO
1171 if (c_nbio) { 1164 if (c_nbio) {
1172 unsigned long l = 1; 1165 unsigned long l = 1;
1173 BIO_printf(bio_c_out, "turning on non blocking io\n"); 1166 BIO_printf(bio_c_out, "turning on non blocking io\n");
@@ -1176,7 +1169,6 @@ re_start:
1176 goto end; 1169 goto end;
1177 } 1170 }
1178 } 1171 }
1179#endif
1180 if (c_Pause & 0x01) 1172 if (c_Pause & 0x01)
1181 SSL_set_debug(con, 1); 1173 SSL_set_debug(con, 1);
1182 1174
@@ -1389,7 +1381,8 @@ re_start:
1389 tty_on = 1; 1381 tty_on = 1;
1390 if (in_init) { 1382 if (in_init) {
1391 in_init = 0; 1383 in_init = 0;
1392#if 0 /* This test doesn't really work as intended 1384#if 0
1385 /* This test doesn't really work as intended
1393 * (needs to be fixed) */ 1386 * (needs to be fixed) */
1394#ifndef OPENSSL_NO_TLSEXT 1387#ifndef OPENSSL_NO_TLSEXT
1395 if (servername != NULL && !SSL_session_reused(con)) { 1388 if (servername != NULL && !SSL_session_reused(con)) {
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c
index 12f6c33c13..18717d8f23 100644
--- a/src/lib/libssl/src/apps/s_server.c
+++ b/src/lib/libssl/src/apps/s_server.c
@@ -146,6 +146,8 @@
146#undef OPENSSL_NO_DEPRECATED 146#undef OPENSSL_NO_DEPRECATED
147#endif 147#endif
148 148
149#include <sys/ioctl.h>
150
149#include <assert.h> 151#include <assert.h>
150#include <ctype.h> 152#include <ctype.h>
151#include <stdio.h> 153#include <stdio.h>
@@ -249,9 +251,7 @@ static const char *s_cert_file = TEST_CERT, *s_key_file = NULL;
249static const char *s_cert_file2 = TEST_CERT2, *s_key_file2 = NULL; 251static const char *s_cert_file2 = TEST_CERT2, *s_key_file2 = NULL;
250#endif 252#endif
251static char *s_dcert_file = NULL, *s_dkey_file = NULL; 253static char *s_dcert_file = NULL, *s_dkey_file = NULL;
252#ifdef FIONBIO
253static int s_nbio = 0; 254static int s_nbio = 0;
254#endif
255static int s_nbio_test = 0; 255static int s_nbio_test = 0;
256int s_crlf = 0; 256int s_crlf = 0;
257static SSL_CTX *ctx = NULL; 257static SSL_CTX *ctx = NULL;
@@ -406,9 +406,7 @@ s_server_init(void)
406 s_key_file2 = NULL; 406 s_key_file2 = NULL;
407 ctx2 = NULL; 407 ctx2 = NULL;
408#endif 408#endif
409#ifdef FIONBIO
410 s_nbio = 0; 409 s_nbio = 0;
411#endif
412 s_nbio_test = 0; 410 s_nbio_test = 0;
413 ctx = NULL; 411 ctx = NULL;
414 www = 0; 412 www = 0;
@@ -456,9 +454,7 @@ sv_usage(void)
456 " Use \"openssl ecparam -list_curves\" for all names\n" \ 454 " Use \"openssl ecparam -list_curves\" for all names\n" \
457 " (default is nistp256).\n"); 455 " (default is nistp256).\n");
458#endif 456#endif
459#ifdef FIONBIO
460 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); 457 BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n");
461#endif
462 BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); 458 BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n");
463 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); 459 BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n");
464 BIO_printf(bio_err, " -debug - Print more output\n"); 460 BIO_printf(bio_err, " -debug - Print more output\n");
@@ -798,9 +794,7 @@ s_server_main(int argc, char *argv[])
798 goto end; 794 goto end;
799 795
800 verify_depth = 0; 796 verify_depth = 0;
801#ifdef FIONBIO
802 s_nbio = 0; 797 s_nbio = 0;
803#endif
804 s_nbio_test = 0; 798 s_nbio_test = 0;
805 799
806 argc--; 800 argc--;
@@ -909,15 +903,11 @@ s_server_main(int argc, char *argv[])
909 goto bad; 903 goto bad;
910 CAfile = *(++argv); 904 CAfile = *(++argv);
911 } 905 }
912#ifdef FIONBIO
913 else if (strcmp(*argv, "-nbio") == 0) { 906 else if (strcmp(*argv, "-nbio") == 0) {
914 s_nbio = 1; 907 s_nbio = 1;
915 } 908 }
916#endif
917 else if (strcmp(*argv, "-nbio_test") == 0) { 909 else if (strcmp(*argv, "-nbio_test") == 0) {
918#ifdef FIONBIO
919 s_nbio = 1; 910 s_nbio = 1;
920#endif
921 s_nbio_test = 1; 911 s_nbio_test = 1;
922 } else if (strcmp(*argv, "-debug") == 0) { 912 } else if (strcmp(*argv, "-debug") == 0) {
923 s_debug = 1; 913 s_debug = 1;
@@ -1661,7 +1651,6 @@ sv_body(char *hostname, int s, unsigned char *context)
1661 BIO_printf(bio_err, "out of memory\n"); 1651 BIO_printf(bio_err, "out of memory\n");
1662 goto err; 1652 goto err;
1663 } 1653 }
1664#ifdef FIONBIO
1665 if (s_nbio) { 1654 if (s_nbio) {
1666 unsigned long sl = 1; 1655 unsigned long sl = 1;
1667 1656
@@ -1670,7 +1659,6 @@ sv_body(char *hostname, int s, unsigned char *context)
1670 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) 1659 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0)
1671 ERR_print_errors(bio_err); 1660 ERR_print_errors(bio_err);
1672 } 1661 }
1673#endif
1674 1662
1675 if (con == NULL) { 1663 if (con == NULL) {
1676 con = SSL_new(ctx); 1664 con = SSL_new(ctx);
@@ -2178,7 +2166,6 @@ www_body(char *hostname, int s, unsigned char *context)
2178 if ((io == NULL) || (ssl_bio == NULL)) 2166 if ((io == NULL) || (ssl_bio == NULL))
2179 goto err; 2167 goto err;
2180 2168
2181#ifdef FIONBIO
2182 if (s_nbio) { 2169 if (s_nbio) {
2183 unsigned long sl = 1; 2170 unsigned long sl = 1;
2184 2171
@@ -2187,7 +2174,6 @@ www_body(char *hostname, int s, unsigned char *context)
2187 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0) 2174 if (BIO_socket_ioctl(s, FIONBIO, &sl) < 0)
2188 ERR_print_errors(bio_err); 2175 ERR_print_errors(bio_err);
2189 } 2176 }
2190#endif
2191 2177
2192 /* lets make the output buffer a reasonable size */ 2178 /* lets make the output buffer a reasonable size */
2193 if (!BIO_set_write_buffer_size(io, bufsize)) 2179 if (!BIO_set_write_buffer_size(io, bufsize))
diff --git a/src/lib/libssl/src/apps/s_time.c b/src/lib/libssl/src/apps/s_time.c
index 4e95a22664..8ce2c671a2 100644
--- a/src/lib/libssl/src/apps/s_time.c
+++ b/src/lib/libssl/src/apps/s_time.c
@@ -118,9 +118,7 @@ static char *s_www_path = NULL;
118static long bytes_read = 0; 118static long bytes_read = 0;
119static int st_bugs = 0; 119static int st_bugs = 0;
120static int perform = 0; 120static int perform = 0;
121#ifdef FIONBIO
122static int t_nbio = 0; 121static int t_nbio = 0;
123#endif
124 122
125static void 123static void
126s_time_init(void) 124s_time_init(void)
@@ -140,9 +138,7 @@ s_time_init(void)
140 st_bugs = 0; 138 st_bugs = 0;
141 perform = 0; 139 perform = 0;
142 140
143#ifdef FIONBIO
144 t_nbio = 0; 141 t_nbio = 0;
145#endif
146} 142}
147 143
148/*********************************************************************** 144/***********************************************************************
@@ -164,7 +160,6 @@ s_time_usage(void)
164 printf("usage: s_time <args>\n\n"); 160 printf("usage: s_time <args>\n\n");
165 161
166 printf("-connect host:port - host:port to connect to (default is %s)\n", SSL_CONNECT_NAME); 162 printf("-connect host:port - host:port to connect to (default is %s)\n", SSL_CONNECT_NAME);
167#ifdef FIONBIO
168 printf("-nbio - Run with non-blocking IO\n"); 163 printf("-nbio - Run with non-blocking IO\n");
169 printf("-ssl2 - Just use SSLv2\n"); 164 printf("-ssl2 - Just use SSLv2\n");
170 printf("-ssl3 - Just use SSLv3\n"); 165 printf("-ssl3 - Just use SSLv3\n");
@@ -172,7 +167,6 @@ s_time_usage(void)
172 printf("-new - Just time new connections\n"); 167 printf("-new - Just time new connections\n");
173 printf("-reuse - Just time connection reuse\n"); 168 printf("-reuse - Just time connection reuse\n");
174 printf("-www page - Retrieve 'page' from the site\n"); 169 printf("-www page - Retrieve 'page' from the site\n");
175#endif
176 printf(umsg, SECONDS); 170 printf(umsg, SECONDS);
177} 171}
178 172
@@ -251,11 +245,9 @@ parseArgs(int argc, char **argv)
251 goto bad; 245 goto bad;
252 tm_cipher = *(++argv); 246 tm_cipher = *(++argv);
253 } 247 }
254#ifdef FIONBIO
255 else if (strcmp(*argv, "-nbio") == 0) { 248 else if (strcmp(*argv, "-nbio") == 0) {
256 t_nbio = 1; 249 t_nbio = 1;
257 } 250 }
258#endif
259 else if (strcmp(*argv, "-www") == 0) { 251 else if (strcmp(*argv, "-www") == 0) {
260 if (--argc < 1) 252 if (--argc < 1)
261 goto bad; 253 goto bad;