diff options
Diffstat (limited to 'src/usr.bin/openssl/s_client.c')
| -rw-r--r-- | src/usr.bin/openssl/s_client.c | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c index f118672abb..aca9bbfc9e 100644 --- a/src/usr.bin/openssl/s_client.c +++ b/src/usr.bin/openssl/s_client.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: s_client.c,v 1.18 2015/09/10 16:01:06 jsing Exp $ */ | 1 | /* $OpenBSD: s_client.c,v 1.19 2015/09/11 14:30:23 bcook 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 | * |
| @@ -238,9 +238,6 @@ sc_usage(void) | |||
| 238 | BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); | 238 | BIO_printf(bio_err, " only \"smtp\", \"lmtp\", \"pop3\", \"imap\", \"ftp\" and \"xmpp\"\n"); |
| 239 | BIO_printf(bio_err, " are supported.\n"); | 239 | BIO_printf(bio_err, " are supported.\n"); |
| 240 | BIO_printf(bio_err, " -xmpphost host - connect to this virtual host on the xmpp server\n"); | 240 | BIO_printf(bio_err, " -xmpphost host - connect to this virtual host on the xmpp server\n"); |
| 241 | #ifndef OPENSSL_NO_ENGINE | ||
| 242 | BIO_printf(bio_err, " -engine id - Initialise and use the specified engine\n"); | ||
| 243 | #endif | ||
| 244 | BIO_printf(bio_err, " -sess_out arg - file to write SSL session to\n"); | 241 | BIO_printf(bio_err, " -sess_out arg - file to write SSL session to\n"); |
| 245 | BIO_printf(bio_err, " -sess_in arg - file to read SSL session from\n"); | 242 | BIO_printf(bio_err, " -sess_in arg - file to read SSL session from\n"); |
| 246 | BIO_printf(bio_err, " -servername host - Set TLS extension servername in ClientHello\n"); | 243 | BIO_printf(bio_err, " -servername host - Set TLS extension servername in ClientHello\n"); |
| @@ -356,12 +353,6 @@ s_client_main(int argc, char **argv) | |||
| 356 | int mbuf_len = 0; | 353 | int mbuf_len = 0; |
| 357 | struct timeval timeout; | 354 | struct timeval timeout; |
| 358 | const char *errstr = NULL; | 355 | const char *errstr = NULL; |
| 359 | #ifndef OPENSSL_NO_ENGINE | ||
| 360 | char *engine_id = NULL; | ||
| 361 | char *ssl_client_engine_id = NULL; | ||
| 362 | ENGINE *ssl_client_engine = NULL; | ||
| 363 | #endif | ||
| 364 | ENGINE *e = NULL; | ||
| 365 | char *servername = NULL; | 356 | char *servername = NULL; |
| 366 | tlsextctx tlsextcbp = | 357 | tlsextctx tlsextcbp = |
| 367 | {NULL, 0}; | 358 | {NULL, 0}; |
| @@ -578,17 +569,6 @@ s_client_main(int argc, char **argv) | |||
| 578 | else | 569 | else |
| 579 | goto bad; | 570 | goto bad; |
| 580 | } | 571 | } |
| 581 | #ifndef OPENSSL_NO_ENGINE | ||
| 582 | else if (strcmp(*argv, "-engine") == 0) { | ||
| 583 | if (--argc < 1) | ||
| 584 | goto bad; | ||
| 585 | engine_id = *(++argv); | ||
| 586 | } else if (strcmp(*argv, "-ssl_client_engine") == 0) { | ||
| 587 | if (--argc < 1) | ||
| 588 | goto bad; | ||
| 589 | ssl_client_engine_id = *(++argv); | ||
| 590 | } | ||
| 591 | #endif | ||
| 592 | else if (strcmp(*argv, "-4") == 0) { | 572 | else if (strcmp(*argv, "-4") == 0) { |
| 593 | af = AF_INET; | 573 | af = AF_INET; |
| 594 | } else if (strcmp(*argv, "-6") == 0) { | 574 | } else if (strcmp(*argv, "-6") == 0) { |
| @@ -654,17 +634,6 @@ bad: | |||
| 654 | } else | 634 | } else |
| 655 | next_proto.data = NULL; | 635 | next_proto.data = NULL; |
| 656 | 636 | ||
| 657 | #ifndef OPENSSL_NO_ENGINE | ||
| 658 | e = setup_engine(bio_err, engine_id, 1); | ||
| 659 | if (ssl_client_engine_id) { | ||
| 660 | ssl_client_engine = ENGINE_by_id(ssl_client_engine_id); | ||
| 661 | if (!ssl_client_engine) { | ||
| 662 | BIO_printf(bio_err, | ||
| 663 | "Error getting client auth engine\n"); | ||
| 664 | goto end; | ||
| 665 | } | ||
| 666 | } | ||
| 667 | #endif | ||
| 668 | if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) { | 637 | if (!app_passwd(bio_err, passarg, NULL, &pass, NULL)) { |
| 669 | BIO_printf(bio_err, "Error getting password\n"); | 638 | BIO_printf(bio_err, "Error getting password\n"); |
| 670 | goto end; | 639 | goto end; |
| @@ -675,7 +644,7 @@ bad: | |||
| 675 | 644 | ||
| 676 | if (key_file) { | 645 | if (key_file) { |
| 677 | 646 | ||
| 678 | key = load_key(bio_err, key_file, key_format, 0, pass, e, | 647 | key = load_key(bio_err, key_file, key_format, 0, pass, |
| 679 | "client certificate private key file"); | 648 | "client certificate private key file"); |
| 680 | if (!key) { | 649 | if (!key) { |
| 681 | ERR_print_errors(bio_err); | 650 | ERR_print_errors(bio_err); |
| @@ -684,7 +653,7 @@ bad: | |||
| 684 | } | 653 | } |
| 685 | if (cert_file) { | 654 | if (cert_file) { |
| 686 | cert = load_cert(bio_err, cert_file, cert_format, | 655 | cert = load_cert(bio_err, cert_file, cert_format, |
| 687 | NULL, e, "client certificate file"); | 656 | NULL, "client certificate file"); |
| 688 | 657 | ||
| 689 | if (!cert) { | 658 | if (!cert) { |
| 690 | ERR_print_errors(bio_err); | 659 | ERR_print_errors(bio_err); |
| @@ -708,18 +677,6 @@ bad: | |||
| 708 | if (vpm) | 677 | if (vpm) |
| 709 | SSL_CTX_set1_param(ctx, vpm); | 678 | SSL_CTX_set1_param(ctx, vpm); |
| 710 | 679 | ||
| 711 | #ifndef OPENSSL_NO_ENGINE | ||
| 712 | if (ssl_client_engine) { | ||
| 713 | if (!SSL_CTX_set_client_cert_engine(ctx, ssl_client_engine)) { | ||
| 714 | BIO_puts(bio_err, "Error setting client auth engine\n"); | ||
| 715 | ERR_print_errors(bio_err); | ||
| 716 | ENGINE_free(ssl_client_engine); | ||
| 717 | goto end; | ||
| 718 | } | ||
| 719 | ENGINE_free(ssl_client_engine); | ||
| 720 | } | ||
| 721 | #endif | ||
| 722 | |||
| 723 | #ifndef OPENSSL_NO_SRTP | 680 | #ifndef OPENSSL_NO_SRTP |
| 724 | if (srtp_profiles != NULL) | 681 | if (srtp_profiles != NULL) |
| 725 | SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles); | 682 | SSL_CTX_set_tlsext_use_srtp(ctx, srtp_profiles); |
