diff options
Diffstat (limited to 'src/lib/libssl/src/apps/s_server.c')
-rw-r--r-- | src/lib/libssl/src/apps/s_server.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/src/lib/libssl/src/apps/s_server.c b/src/lib/libssl/src/apps/s_server.c index 1f80a8f7d9..1c13d5517d 100644 --- a/src/lib/libssl/src/apps/s_server.c +++ b/src/lib/libssl/src/apps/s_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_server.c,v 1.55 2014/07/09 20:59:41 tedu Exp $ */ | 1 | /* $OpenBSD: s_server.c,v 1.56 2014/07/09 21:02:35 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -173,16 +173,12 @@ | |||
173 | #include <openssl/dh.h> | 173 | #include <openssl/dh.h> |
174 | #endif | 174 | #endif |
175 | 175 | ||
176 | #ifndef OPENSSL_NO_RSA | ||
177 | #include <openssl/rsa.h> | 176 | #include <openssl/rsa.h> |
178 | #endif | ||
179 | 177 | ||
180 | #include "s_apps.h" | 178 | #include "s_apps.h" |
181 | #include "timeouts.h" | 179 | #include "timeouts.h" |
182 | 180 | ||
183 | #ifndef OPENSSL_NO_RSA | ||
184 | static RSA *tmp_rsa_cb(SSL * s, int is_export, int keylength); | 181 | static RSA *tmp_rsa_cb(SSL * s, int is_export, int keylength); |
185 | #endif | ||
186 | static int sv_body(char *hostname, int s, unsigned char *context); | 182 | static int sv_body(char *hostname, int s, unsigned char *context); |
187 | static int www_body(char *hostname, int s, unsigned char *context); | 183 | static int www_body(char *hostname, int s, unsigned char *context); |
188 | static void close_accept_socket(void); | 184 | static void close_accept_socket(void); |
@@ -406,11 +402,9 @@ sv_usage(void) | |||
406 | BIO_printf(bio_err, " -dpass arg - second private key file pass phrase source\n"); | 402 | BIO_printf(bio_err, " -dpass arg - second private key file pass phrase source\n"); |
407 | BIO_printf(bio_err, " -dhparam arg - DH parameter file to use, in cert file if not specified\n"); | 403 | BIO_printf(bio_err, " -dhparam arg - DH parameter file to use, in cert file if not specified\n"); |
408 | BIO_printf(bio_err, " or a default set of parameters is used\n"); | 404 | BIO_printf(bio_err, " or a default set of parameters is used\n"); |
409 | #ifndef OPENSSL_NO_ECDH | ||
410 | BIO_printf(bio_err, " -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \ | 405 | BIO_printf(bio_err, " -named_curve arg - Elliptic curve name to use for ephemeral ECDH keys.\n" \ |
411 | " Use \"openssl ecparam -list_curves\" for all names\n" \ | 406 | " Use \"openssl ecparam -list_curves\" for all names\n" \ |
412 | " (default is nistp256).\n"); | 407 | " (default is nistp256).\n"); |
413 | #endif | ||
414 | BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); | 408 | BIO_printf(bio_err, " -nbio - Run with non-blocking IO\n"); |
415 | BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); | 409 | BIO_printf(bio_err, " -nbio_test - test with the non-blocking test bio\n"); |
416 | BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); | 410 | BIO_printf(bio_err, " -crlf - convert LF from terminal into CRLF\n"); |
@@ -444,9 +438,7 @@ sv_usage(void) | |||
444 | #ifndef OPENSSL_NO_DH | 438 | #ifndef OPENSSL_NO_DH |
445 | BIO_printf(bio_err, " -no_dhe - Disable ephemeral DH\n"); | 439 | BIO_printf(bio_err, " -no_dhe - Disable ephemeral DH\n"); |
446 | #endif | 440 | #endif |
447 | #ifndef OPENSSL_NO_ECDH | ||
448 | BIO_printf(bio_err, " -no_ecdhe - Disable ephemeral ECDH\n"); | 441 | BIO_printf(bio_err, " -no_ecdhe - Disable ephemeral ECDH\n"); |
449 | #endif | ||
450 | BIO_printf(bio_err, " -bugs - Turn on SSL bug compatibility\n"); | 442 | BIO_printf(bio_err, " -bugs - Turn on SSL bug compatibility\n"); |
451 | BIO_printf(bio_err, " -www - Respond to a 'GET /' with a status page\n"); | 443 | BIO_printf(bio_err, " -www - Respond to a 'GET /' with a status page\n"); |
452 | BIO_printf(bio_err, " -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); | 444 | BIO_printf(bio_err, " -WWW - Respond to a 'GET /<path> HTTP/1.0' with file ./<path>\n"); |
@@ -681,9 +673,7 @@ s_server_main(int argc, char *argv[]) | |||
681 | char *CApath = NULL, *CAfile = NULL; | 673 | char *CApath = NULL, *CAfile = NULL; |
682 | unsigned char *context = NULL; | 674 | unsigned char *context = NULL; |
683 | char *dhfile = NULL; | 675 | char *dhfile = NULL; |
684 | #ifndef OPENSSL_NO_ECDH | ||
685 | char *named_curve = NULL; | 676 | char *named_curve = NULL; |
686 | #endif | ||
687 | int badop = 0, bugs = 0; | 677 | int badop = 0, bugs = 0; |
688 | int ret = 1; | 678 | int ret = 1; |
689 | int off = 0; | 679 | int off = 0; |
@@ -783,13 +773,11 @@ s_server_main(int argc, char *argv[]) | |||
783 | goto bad; | 773 | goto bad; |
784 | dhfile = *(++argv); | 774 | dhfile = *(++argv); |
785 | } | 775 | } |
786 | #ifndef OPENSSL_NO_ECDH | ||
787 | else if (strcmp(*argv, "-named_curve") == 0) { | 776 | else if (strcmp(*argv, "-named_curve") == 0) { |
788 | if (--argc < 1) | 777 | if (--argc < 1) |
789 | goto bad; | 778 | goto bad; |
790 | named_curve = *(++argv); | 779 | named_curve = *(++argv); |
791 | } | 780 | } |
792 | #endif | ||
793 | else if (strcmp(*argv, "-dcertform") == 0) { | 781 | else if (strcmp(*argv, "-dcertform") == 0) { |
794 | if (--argc < 1) | 782 | if (--argc < 1) |
795 | goto bad; | 783 | goto bad; |
@@ -1123,9 +1111,7 @@ bad: | |||
1123 | bio_s_out = BIO_new_fp(stdout, BIO_NOCLOSE); | 1111 | bio_s_out = BIO_new_fp(stdout, BIO_NOCLOSE); |
1124 | } | 1112 | } |
1125 | } | 1113 | } |
1126 | #if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_ECDSA) | ||
1127 | if (nocert) | 1114 | if (nocert) |
1128 | #endif | ||
1129 | { | 1115 | { |
1130 | s_cert_file = NULL; | 1116 | s_cert_file = NULL; |
1131 | s_key_file = NULL; | 1117 | s_key_file = NULL; |
@@ -1286,7 +1272,6 @@ bad: | |||
1286 | } | 1272 | } |
1287 | #endif | 1273 | #endif |
1288 | 1274 | ||
1289 | #ifndef OPENSSL_NO_ECDH | ||
1290 | if (!no_ecdhe) { | 1275 | if (!no_ecdhe) { |
1291 | EC_KEY *ecdh = NULL; | 1276 | EC_KEY *ecdh = NULL; |
1292 | 1277 | ||
@@ -1324,7 +1309,6 @@ bad: | |||
1324 | #endif | 1309 | #endif |
1325 | EC_KEY_free(ecdh); | 1310 | EC_KEY_free(ecdh); |
1326 | } | 1311 | } |
1327 | #endif | ||
1328 | 1312 | ||
1329 | if (!set_cert_key_stuff(ctx, s_cert, s_key)) | 1313 | if (!set_cert_key_stuff(ctx, s_cert, s_key)) |
1330 | goto end; | 1314 | goto end; |
@@ -1336,7 +1320,6 @@ bad: | |||
1336 | if (!set_cert_key_stuff(ctx, s_dcert, s_dkey)) | 1320 | if (!set_cert_key_stuff(ctx, s_dcert, s_dkey)) |
1337 | goto end; | 1321 | goto end; |
1338 | } | 1322 | } |
1339 | #ifndef OPENSSL_NO_RSA | ||
1340 | if (!no_tmp_rsa) { | 1323 | if (!no_tmp_rsa) { |
1341 | SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb); | 1324 | SSL_CTX_set_tmp_rsa_callback(ctx, tmp_rsa_cb); |
1342 | #ifndef OPENSSL_NO_TLSEXT | 1325 | #ifndef OPENSSL_NO_TLSEXT |
@@ -1344,7 +1327,6 @@ bad: | |||
1344 | SSL_CTX_set_tmp_rsa_callback(ctx2, tmp_rsa_cb); | 1327 | SSL_CTX_set_tmp_rsa_callback(ctx2, tmp_rsa_cb); |
1345 | #endif | 1328 | #endif |
1346 | } | 1329 | } |
1347 | #endif | ||
1348 | 1330 | ||
1349 | #ifndef OPENSSL_NO_PSK | 1331 | #ifndef OPENSSL_NO_PSK |
1350 | if (psk_key != NULL) { | 1332 | if (psk_key != NULL) { |
@@ -2213,7 +2195,6 @@ err: | |||
2213 | return (ret); | 2195 | return (ret); |
2214 | } | 2196 | } |
2215 | 2197 | ||
2216 | #ifndef OPENSSL_NO_RSA | ||
2217 | static RSA * | 2198 | static RSA * |
2218 | tmp_rsa_cb(SSL * s, int is_export, int keylength) | 2199 | tmp_rsa_cb(SSL * s, int is_export, int keylength) |
2219 | { | 2200 | { |
@@ -2241,7 +2222,6 @@ tmp_rsa_cb(SSL * s, int is_export, int keylength) | |||
2241 | } | 2222 | } |
2242 | return (rsa_tmp); | 2223 | return (rsa_tmp); |
2243 | } | 2224 | } |
2244 | #endif | ||
2245 | 2225 | ||
2246 | #define MAX_SESSION_ID_ATTEMPTS 10 | 2226 | #define MAX_SESSION_ID_ATTEMPTS 10 |
2247 | static int | 2227 | static int |