summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/s_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/openssl/s_client.c')
-rw-r--r--src/usr.bin/openssl/s_client.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c
index 4476852cdb..a079c39b9e 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.10 2014/12/10 15:24:01 jsing Exp $ */ 1/* $OpenBSD: s_client.c,v 1.11 2014/12/14 14:42:06 jsing 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 *
@@ -250,9 +250,7 @@ sc_usage(void)
250 BIO_printf(bio_err, " -tlsextdebug - hex dump of all TLS extensions received\n"); 250 BIO_printf(bio_err, " -tlsextdebug - hex dump of all TLS extensions received\n");
251 BIO_printf(bio_err, " -status - request certificate status from server\n"); 251 BIO_printf(bio_err, " -status - request certificate status from server\n");
252 BIO_printf(bio_err, " -no_ticket - disable use of RFC4507bis session tickets\n"); 252 BIO_printf(bio_err, " -no_ticket - disable use of RFC4507bis session tickets\n");
253#ifndef OPENSSL_NO_NEXTPROTONEG
254 BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n"); 253 BIO_printf(bio_err, " -nextprotoneg arg - enable NPN extension, considering named protocols supported (comma-separated list)\n");
255#endif
256 BIO_printf(bio_err, " -alpn arg - enable ALPN extension, considering named protocols supported (comma-separated list)\n"); 254 BIO_printf(bio_err, " -alpn arg - enable ALPN extension, considering named protocols supported (comma-separated list)\n");
257#ifndef OPENSSL_NO_SRTP 255#ifndef OPENSSL_NO_SRTP
258 BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n"); 256 BIO_printf(bio_err, " -use_srtp profiles - Offer SRTP key management with a colon-separated profile list\n");
@@ -286,7 +284,6 @@ ssl_servername_cb(SSL * s, int *ad, void *arg)
286char *srtp_profiles = NULL; 284char *srtp_profiles = NULL;
287#endif 285#endif
288 286
289#ifndef OPENSSL_NO_NEXTPROTONEG
290/* This the context that we pass to next_proto_cb */ 287/* This the context that we pass to next_proto_cb */
291typedef struct tlsextnextprotoctx_st { 288typedef struct tlsextnextprotoctx_st {
292 unsigned char *data; 289 unsigned char *data;
@@ -316,7 +313,6 @@ next_proto_cb(SSL * s, unsigned char **out, unsigned char *outlen, const unsigne
316 ctx->status = SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len); 313 ctx->status = SSL_select_next_proto(out, outlen, in, inlen, ctx->data, ctx->len);
317 return SSL_TLSEXT_ERR_OK; 314 return SSL_TLSEXT_ERR_OK;
318} 315}
319#endif /* ndef OPENSSL_NO_NEXTPROTONEG */
320 316
321enum { 317enum {
322 PROTO_OFF = 0, 318 PROTO_OFF = 0,
@@ -372,9 +368,7 @@ s_client_main(int argc, char **argv)
372 char *servername = NULL; 368 char *servername = NULL;
373 tlsextctx tlsextcbp = 369 tlsextctx tlsextcbp =
374 {NULL, 0}; 370 {NULL, 0};
375#ifndef OPENSSL_NO_NEXTPROTONEG
376 const char *next_proto_neg_in = NULL; 371 const char *next_proto_neg_in = NULL;
377#endif
378 const char *alpn_in = NULL; 372 const char *alpn_in = NULL;
379 char *sess_in = NULL; 373 char *sess_in = NULL;
380 char *sess_out = NULL; 374 char *sess_out = NULL;
@@ -539,13 +533,11 @@ s_client_main(int argc, char **argv)
539 else if (strcmp(*argv, "-no_ticket") == 0) { 533 else if (strcmp(*argv, "-no_ticket") == 0) {
540 off |= SSL_OP_NO_TICKET; 534 off |= SSL_OP_NO_TICKET;
541 } 535 }
542#ifndef OPENSSL_NO_NEXTPROTONEG
543 else if (strcmp(*argv, "-nextprotoneg") == 0) { 536 else if (strcmp(*argv, "-nextprotoneg") == 0) {
544 if (--argc < 1) 537 if (--argc < 1)
545 goto bad; 538 goto bad;
546 next_proto_neg_in = *(++argv); 539 next_proto_neg_in = *(++argv);
547 } 540 }
548#endif
549 else if (strcmp(*argv, "-alpn") == 0) { 541 else if (strcmp(*argv, "-alpn") == 0) {
550 if (--argc < 1) 542 if (--argc < 1)
551 goto bad; 543 goto bad;
@@ -642,7 +634,6 @@ bad:
642 goto end; 634 goto end;
643 } 635 }
644 636
645#if !defined(OPENSSL_NO_NEXTPROTONEG)
646 next_proto.status = -1; 637 next_proto.status = -1;
647 if (next_proto_neg_in) { 638 if (next_proto_neg_in) {
648 next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in); 639 next_proto.data = next_protos_parse(&next_proto.len, next_proto_neg_in);
@@ -652,7 +643,6 @@ bad:
652 } 643 }
653 } else 644 } else
654 next_proto.data = NULL; 645 next_proto.data = NULL;
655#endif
656 646
657#ifndef OPENSSL_NO_ENGINE 647#ifndef OPENSSL_NO_ENGINE
658 e = setup_engine(bio_err, engine_id, 1); 648 e = setup_engine(bio_err, engine_id, 1);
@@ -738,10 +728,8 @@ bad:
738 if (socket_type == SOCK_DGRAM) 728 if (socket_type == SOCK_DGRAM)
739 SSL_CTX_set_read_ahead(ctx, 1); 729 SSL_CTX_set_read_ahead(ctx, 1);
740 730
741#if !defined(OPENSSL_NO_NEXTPROTONEG)
742 if (next_proto.data) 731 if (next_proto.data)
743 SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &next_proto); 732 SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &next_proto);
744#endif
745 if (alpn_in) { 733 if (alpn_in) {
746 unsigned short alpn_len; 734 unsigned short alpn_len;
747 unsigned char *alpn = next_protos_parse(&alpn_len, alpn_in); 735 unsigned char *alpn = next_protos_parse(&alpn_len, alpn_in);
@@ -1274,9 +1262,7 @@ end:
1274 print_stuff(bio_c_out, con, 1); 1262 print_stuff(bio_c_out, con, 1);
1275 SSL_free(con); 1263 SSL_free(con);
1276 } 1264 }
1277#if !defined(OPENSSL_NO_NEXTPROTONEG)
1278 free(next_proto.data); 1265 free(next_proto.data);
1279#endif
1280 if (ctx != NULL) 1266 if (ctx != NULL)
1281 SSL_CTX_free(ctx); 1267 SSL_CTX_free(ctx);
1282 if (cert) 1268 if (cert)
@@ -1430,7 +1416,6 @@ print_stuff(BIO * bio, SSL * s, int full)
1430 } 1416 }
1431#endif 1417#endif
1432 1418
1433#if !defined(OPENSSL_NO_NEXTPROTONEG)
1434 if (next_proto.status != -1) { 1419 if (next_proto.status != -1) {
1435 const unsigned char *proto; 1420 const unsigned char *proto;
1436 unsigned int proto_len; 1421 unsigned int proto_len;
@@ -1439,7 +1424,6 @@ print_stuff(BIO * bio, SSL * s, int full)
1439 BIO_write(bio, proto, proto_len); 1424 BIO_write(bio, proto, proto_len);
1440 BIO_write(bio, "\n", 1); 1425 BIO_write(bio, "\n", 1);
1441 } 1426 }
1442#endif
1443 { 1427 {
1444 const unsigned char *proto; 1428 const unsigned char *proto;
1445 unsigned int proto_len; 1429 unsigned int proto_len;