summaryrefslogtreecommitdiff
path: root/usr.bin/openssl/s_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/openssl/s_client.c')
-rw-r--r--usr.bin/openssl/s_client.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/usr.bin/openssl/s_client.c b/usr.bin/openssl/s_client.c
index 25d4c0c5dd2..12c9bd2c2d8 100644
--- a/usr.bin/openssl/s_client.c
+++ b/usr.bin/openssl/s_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_client.c,v 1.5 2014/10/22 13:51:31 jsing Exp $ */
+/* $OpenBSD: s_client.c,v 1.6 2014/11/06 14:50:12 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -179,10 +179,8 @@ extern int verify_return_error;
static int c_nbio = 0;
static int c_Pause = 0;
static int c_debug = 0;
-#ifndef OPENSSL_NO_TLSEXT
static int c_tlsextdebug = 0;
static int c_status_req = 0;
-#endif
static int c_msg = 0;
static int c_showcerts = 0;
@@ -191,9 +189,7 @@ static int keymatexportlen = 20;
static void sc_usage(void);
static void print_stuff(BIO * berr, SSL * con, int full);
-#ifndef OPENSSL_NO_TLSEXT
static int ocsp_resp_cb(SSL * s, void *arg);
-#endif
static BIO *bio_c_out = NULL;
static int c_quiet = 0;
static int c_ign_eof = 0;
@@ -251,7 +247,6 @@ sc_usage(void)
#endif
BIO_printf(bio_err, " -sess_out arg - file to write SSL session to\n");
BIO_printf(bio_err, " -sess_in arg - file to read SSL session from\n");
-#ifndef OPENSSL_NO_TLSEXT
BIO_printf(bio_err, " -servername host - Set TLS extension servername in ClientHello\n");
BIO_printf(bio_err, " -tlsextdebug - hex dump of all TLS extensions received\n");
BIO_printf(bio_err, " -status - request certificate status from server\n");
@@ -259,7 +254,6 @@ sc_usage(void)
#ifndef OPENSSL_NO_NEXTPROTONEG
BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");
#endif
-#endif
#ifndef OPENSSL_NO_SRTP
BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
#endif
@@ -267,7 +261,6 @@ sc_usage(void)
BIO_printf(bio_err, " -keymatexportlen len - Export len bytes of keying material (default 20)\n");
}
-#ifndef OPENSSL_NO_TLSEXT
/* This is a context that we pass to callbacks */
typedef struct tlsextctx_st {
@@ -324,7 +317,6 @@ next_proto_cb(SSL * s, unsigned char **out, unsigned char *outlen, const unsigne
return SSL_TLSEXT_ERR_OK;
}
#endif /* ndef OPENSSL_NO_NEXTPROTONEG */
-#endif
enum {
PROTO_OFF = 0,
@@ -378,14 +370,12 @@ s_client_main(int argc, char **argv)
ENGINE *ssl_client_engine = NULL;
#endif
ENGINE *e = NULL;
-#ifndef OPENSSL_NO_TLSEXT
char *servername = NULL;
tlsextctx tlsextcbp =
{NULL, 0};
#ifndef OPENSSL_NO_NEXTPROTONEG
const char *next_proto_neg_in = NULL;
#endif
-#endif
char *sess_in = NULL;
char *sess_out = NULL;
struct sockaddr peer;
@@ -475,12 +465,10 @@ s_client_main(int argc, char **argv)
c_Pause = 1;
else if (strcmp(*argv, "-debug") == 0)
c_debug = 1;
-#ifndef OPENSSL_NO_TLSEXT
else if (strcmp(*argv, "-tlsextdebug") == 0)
c_tlsextdebug = 1;
else if (strcmp(*argv, "-status") == 0)
c_status_req = 1;
-#endif
else if (strcmp(*argv, "-msg") == 0)
c_msg = 1;
else if (strcmp(*argv, "-showcerts") == 0)
@@ -548,7 +536,6 @@ s_client_main(int argc, char **argv)
else if (strcmp(*argv, "-no_comp") == 0) {
off |= SSL_OP_NO_COMPRESSION;
}
-#ifndef OPENSSL_NO_TLSEXT
else if (strcmp(*argv, "-no_ticket") == 0) {
off |= SSL_OP_NO_TICKET;
}
@@ -559,7 +546,6 @@ s_client_main(int argc, char **argv)
next_proto_neg_in = *(++argv);
}
#endif
-#endif
else if (strcmp(*argv, "-serverpref") == 0)
off |= SSL_OP_CIPHER_SERVER_PREFERENCE;
else if (strcmp(*argv, "-legacy_renegotiation") == 0)
@@ -611,14 +597,12 @@ s_client_main(int argc, char **argv)
} else if (strcmp(*argv, "-6") == 0) {
af = AF_INET6;
}
-#ifndef OPENSSL_NO_TLSEXT
else if (strcmp(*argv, "-servername") == 0) {
if (--argc < 1)
goto bad;
servername = *(++argv);
/* meth=TLSv1_client_method(); */
}
-#endif
#ifndef OPENSSL_NO_SRTP
else if (strcmp(*argv, "-use_srtp") == 0) {
if (--argc < 1)
@@ -777,13 +761,11 @@ bad:
ERR_print_errors(bio_err);
/* goto end; */
}
-#ifndef OPENSSL_NO_TLSEXT
if (servername != NULL) {
tlsextcbp.biodebug = bio_err;
SSL_CTX_set_tlsext_servername_callback(ctx, ssl_servername_cb);
SSL_CTX_set_tlsext_servername_arg(ctx, &tlsextcbp);
}
-#endif
con = SSL_new(ctx);
if (sess_in) {
@@ -806,7 +788,6 @@ bad:
SSL_set_session(con, sess);
SSL_SESSION_free(sess);
}
-#ifndef OPENSSL_NO_TLSEXT
if (servername != NULL) {
if (!SSL_set_tlsext_host_name(con, servername)) {
BIO_printf(bio_err, "Unable to set TLS servername extension.\n");
@@ -814,7 +795,6 @@ bad:
goto end;
}
}
-#endif
/* SSL_set_cipher_list(con,"RC4-MD5"); */
re_start:
@@ -881,7 +861,6 @@ re_start:
SSL_set_msg_callback(con, msg_cb);
SSL_set_msg_callback_arg(con, bio_c_out);
}
-#ifndef OPENSSL_NO_TLSEXT
if (c_tlsextdebug) {
SSL_set_tlsext_debug_callback(con, tlsext_cb);
SSL_set_tlsext_debug_arg(con, bio_c_out);
@@ -891,7 +870,6 @@ re_start:
SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb);
SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out);
}
-#endif
SSL_set_bio(con, sbio, sbio);
SSL_set_connect_state(con);
@@ -1472,7 +1450,6 @@ print_stuff(BIO * bio, SSL * s, int full)
(void) BIO_flush(bio);
}
-#ifndef OPENSSL_NO_TLSEXT
static int
ocsp_resp_cb(SSL * s, void *arg)
@@ -1499,4 +1476,3 @@ ocsp_resp_cb(SSL * s, void *arg)
return 1;
}
-#endif