diff options
| author | inoguchi <> | 2020-07-09 13:07:46 +0000 |
|---|---|---|
| committer | inoguchi <> | 2020-07-09 13:07:46 +0000 |
| commit | 214992a8f72de0281fffb0f8c37067b79d50232d (patch) | |
| tree | 5f833108edd85cb77f36e3b0911e821e5f133f7c /src | |
| parent | bad3bb3e05c9313a4bb86df1c1b642371eddec03 (diff) | |
| download | openbsd-214992a8f72de0281fffb0f8c37067b79d50232d.tar.gz openbsd-214992a8f72de0281fffb0f8c37067b79d50232d.tar.bz2 openbsd-214992a8f72de0281fffb0f8c37067b79d50232d.zip | |
Remove c_ prefix from s_client_config member
Diffstat (limited to 'src')
| -rw-r--r-- | src/usr.bin/openssl/s_client.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c index 2b47bf7ff9..98cab18489 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.47 2020/07/09 12:48:19 inoguchi Exp $ */ | 1 | /* $OpenBSD: s_client.c,v 1.48 2020/07/09 13:07:46 inoguchi 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 | * |
| @@ -191,25 +191,18 @@ static struct { | |||
| 191 | int bugs; | 191 | int bugs; |
| 192 | char *CAfile; | 192 | char *CAfile; |
| 193 | char *CApath; | 193 | char *CApath; |
| 194 | int c_debug; | ||
| 195 | int c_ign_eof; | ||
| 196 | int c_msg; | ||
| 197 | int c_nbio; | ||
| 198 | int c_Pause; | ||
| 199 | int c_quiet; | ||
| 200 | int c_showcerts; | ||
| 201 | int c_status_req; | ||
| 202 | int c_tlsextdebug; | ||
| 203 | char *cert_file; | 194 | char *cert_file; |
| 204 | int cert_format; | 195 | int cert_format; |
| 205 | char *cipher; | 196 | char *cipher; |
| 206 | unsigned int clr; | 197 | unsigned int clr; |
| 207 | char *connect; | 198 | char *connect; |
| 208 | int crlf; | 199 | int crlf; |
| 200 | int debug; | ||
| 209 | int enable_timeouts; | 201 | int enable_timeouts; |
| 210 | const char *errstr; | 202 | const char *errstr; |
| 211 | char *groups_in; | 203 | char *groups_in; |
| 212 | char *host; | 204 | char *host; |
| 205 | int ign_eof; | ||
| 213 | char *key_file; | 206 | char *key_file; |
| 214 | int key_format; | 207 | int key_format; |
| 215 | char *keymatexportlabel; | 208 | char *keymatexportlabel; |
| @@ -217,18 +210,23 @@ static struct { | |||
| 217 | uint16_t max_version; | 210 | uint16_t max_version; |
| 218 | uint16_t min_version; | 211 | uint16_t min_version; |
| 219 | const SSL_METHOD *meth; | 212 | const SSL_METHOD *meth; |
| 213 | int msg; | ||
| 214 | int nbio; | ||
| 220 | int nbio_test; | 215 | int nbio_test; |
| 221 | char *npn_in; | 216 | char *npn_in; |
| 222 | unsigned int off; | 217 | unsigned int off; |
| 223 | char *passarg; | 218 | char *passarg; |
| 219 | int pause; | ||
| 224 | int peekaboo; | 220 | int peekaboo; |
| 225 | char *port; | 221 | char *port; |
| 226 | int prexit; | 222 | int prexit; |
| 227 | char *proxy; | 223 | char *proxy; |
| 224 | int quiet; | ||
| 228 | int reconnect; | 225 | int reconnect; |
| 229 | char *servername; | 226 | char *servername; |
| 230 | char *sess_in; | 227 | char *sess_in; |
| 231 | char *sess_out; | 228 | char *sess_out; |
| 229 | int showcerts; | ||
| 232 | int socket_type; | 230 | int socket_type; |
| 233 | long socket_mtu; | 231 | long socket_mtu; |
| 234 | #ifndef OPENSSL_NO_SRTP | 232 | #ifndef OPENSSL_NO_SRTP |
| @@ -236,6 +234,8 @@ static struct { | |||
| 236 | #endif | 234 | #endif |
| 237 | int starttls_proto; | 235 | int starttls_proto; |
| 238 | int state; | 236 | int state; |
| 237 | int status_req; | ||
| 238 | int tlsextdebug; | ||
| 239 | int verify; | 239 | int verify; |
| 240 | X509_VERIFY_PARAM *vpm; | 240 | X509_VERIFY_PARAM *vpm; |
| 241 | char *xmpphost; | 241 | char *xmpphost; |
| @@ -324,8 +324,8 @@ s_client_opt_protocol_version_tls1_3(void) | |||
| 324 | static int | 324 | static int |
| 325 | s_client_opt_quiet(void) | 325 | s_client_opt_quiet(void) |
| 326 | { | 326 | { |
| 327 | s_client_config.c_quiet = 1; | 327 | s_client_config.quiet = 1; |
| 328 | s_client_config.c_ign_eof = 1; | 328 | s_client_config.ign_eof = 1; |
| 329 | return (0); | 329 | return (0); |
| 330 | } | 330 | } |
| 331 | 331 | ||
| @@ -464,7 +464,7 @@ static const struct option s_client_options[] = { | |||
| 464 | .name = "debug", | 464 | .name = "debug", |
| 465 | .desc = "Print extensive debugging information", | 465 | .desc = "Print extensive debugging information", |
| 466 | .type = OPTION_FLAG, | 466 | .type = OPTION_FLAG, |
| 467 | .opt.flag = &s_client_config.c_debug, | 467 | .opt.flag = &s_client_config.debug, |
| 468 | }, | 468 | }, |
| 469 | #ifndef OPENSSL_NO_DTLS1 | 469 | #ifndef OPENSSL_NO_DTLS1 |
| 470 | { | 470 | { |
| @@ -492,7 +492,7 @@ static const struct option s_client_options[] = { | |||
| 492 | .name = "ign_eof", | 492 | .name = "ign_eof", |
| 493 | .desc = "Ignore input EOF (default when -quiet)", | 493 | .desc = "Ignore input EOF (default when -quiet)", |
| 494 | .type = OPTION_VALUE, | 494 | .type = OPTION_VALUE, |
| 495 | .opt.value = &s_client_config.c_ign_eof, | 495 | .opt.value = &s_client_config.ign_eof, |
| 496 | .value = 1, | 496 | .value = 1, |
| 497 | }, | 497 | }, |
| 498 | { | 498 | { |
| @@ -538,7 +538,7 @@ static const struct option s_client_options[] = { | |||
| 538 | .name = "msg", | 538 | .name = "msg", |
| 539 | .desc = "Show all protocol messages with hex dump", | 539 | .desc = "Show all protocol messages with hex dump", |
| 540 | .type = OPTION_FLAG, | 540 | .type = OPTION_FLAG, |
| 541 | .opt.flag = &s_client_config.c_msg, | 541 | .opt.flag = &s_client_config.msg, |
| 542 | }, | 542 | }, |
| 543 | #ifndef OPENSSL_NO_DTLS1 | 543 | #ifndef OPENSSL_NO_DTLS1 |
| 544 | { | 544 | { |
| @@ -553,7 +553,7 @@ static const struct option s_client_options[] = { | |||
| 553 | .name = "nbio", | 553 | .name = "nbio", |
| 554 | .desc = "Turn on non-blocking I/O", | 554 | .desc = "Turn on non-blocking I/O", |
| 555 | .type = OPTION_FLAG, | 555 | .type = OPTION_FLAG, |
| 556 | .opt.flag = &s_client_config.c_nbio, | 556 | .opt.flag = &s_client_config.nbio, |
| 557 | }, | 557 | }, |
| 558 | { | 558 | { |
| 559 | .name = "nbio_test", | 559 | .name = "nbio_test", |
| @@ -577,7 +577,7 @@ static const struct option s_client_options[] = { | |||
| 577 | .name = "no_ign_eof", | 577 | .name = "no_ign_eof", |
| 578 | .desc = "Don't ignore input EOF", | 578 | .desc = "Don't ignore input EOF", |
| 579 | .type = OPTION_VALUE, | 579 | .type = OPTION_VALUE, |
| 580 | .opt.value = &s_client_config.c_ign_eof, | 580 | .opt.value = &s_client_config.ign_eof, |
| 581 | .value = 0, | 581 | .value = 0, |
| 582 | }, | 582 | }, |
| 583 | { | 583 | { |
| @@ -645,7 +645,7 @@ static const struct option s_client_options[] = { | |||
| 645 | .name = "pause", | 645 | .name = "pause", |
| 646 | .desc = "Pause 1 second between each read and write call", | 646 | .desc = "Pause 1 second between each read and write call", |
| 647 | .type = OPTION_FLAG, | 647 | .type = OPTION_FLAG, |
| 648 | .opt.flag = &s_client_config.c_Pause, | 648 | .opt.flag = &s_client_config.pause, |
| 649 | }, | 649 | }, |
| 650 | { | 650 | { |
| 651 | .name = "peekaboo", | 651 | .name = "peekaboo", |
| @@ -717,7 +717,7 @@ static const struct option s_client_options[] = { | |||
| 717 | .name = "showcerts", | 717 | .name = "showcerts", |
| 718 | .desc = "Show all server certificates in the chain", | 718 | .desc = "Show all server certificates in the chain", |
| 719 | .type = OPTION_FLAG, | 719 | .type = OPTION_FLAG, |
| 720 | .opt.flag = &s_client_config.c_showcerts, | 720 | .opt.flag = &s_client_config.showcerts, |
| 721 | }, | 721 | }, |
| 722 | { | 722 | { |
| 723 | .name = "starttls", | 723 | .name = "starttls", |
| @@ -737,7 +737,7 @@ static const struct option s_client_options[] = { | |||
| 737 | .name = "status", | 737 | .name = "status", |
| 738 | .desc = "Send a certificate status request to the server (OCSP)", | 738 | .desc = "Send a certificate status request to the server (OCSP)", |
| 739 | .type = OPTION_FLAG, | 739 | .type = OPTION_FLAG, |
| 740 | .opt.flag = &s_client_config.c_status_req, | 740 | .opt.flag = &s_client_config.status_req, |
| 741 | }, | 741 | }, |
| 742 | #ifndef OPENSSL_NO_DTLS1 | 742 | #ifndef OPENSSL_NO_DTLS1 |
| 743 | { | 743 | { |
| @@ -775,7 +775,7 @@ static const struct option s_client_options[] = { | |||
| 775 | .name = "tlsextdebug", | 775 | .name = "tlsextdebug", |
| 776 | .desc = "Hex dump of all TLS extensions received", | 776 | .desc = "Hex dump of all TLS extensions received", |
| 777 | .type = OPTION_FLAG, | 777 | .type = OPTION_FLAG, |
| 778 | .opt.flag = &s_client_config.c_tlsextdebug, | 778 | .opt.flag = &s_client_config.tlsextdebug, |
| 779 | }, | 779 | }, |
| 780 | #ifndef OPENSSL_NO_SRTP | 780 | #ifndef OPENSSL_NO_SRTP |
| 781 | { | 781 | { |
| @@ -960,7 +960,7 @@ s_client_main(int argc, char **argv) | |||
| 960 | } | 960 | } |
| 961 | } | 961 | } |
| 962 | if (bio_c_out == NULL) { | 962 | if (bio_c_out == NULL) { |
| 963 | if (s_client_config.c_quiet && !s_client_config.c_debug && !s_client_config.c_msg) { | 963 | if (s_client_config.quiet && !s_client_config.debug && !s_client_config.msg) { |
| 964 | bio_c_out = BIO_new(BIO_s_null()); | 964 | bio_c_out = BIO_new(BIO_s_null()); |
| 965 | } else { | 965 | } else { |
| 966 | if (bio_c_out == NULL) | 966 | if (bio_c_out == NULL) |
| @@ -1085,15 +1085,15 @@ re_start: | |||
| 1085 | } | 1085 | } |
| 1086 | BIO_printf(bio_c_out, "CONNECTED(%08X)\n", s); | 1086 | BIO_printf(bio_c_out, "CONNECTED(%08X)\n", s); |
| 1087 | 1087 | ||
| 1088 | if (s_client_config.c_nbio) { | 1088 | if (s_client_config.nbio) { |
| 1089 | if (!s_client_config.c_quiet) | 1089 | if (!s_client_config.quiet) |
| 1090 | BIO_printf(bio_c_out, "turning on non blocking io\n"); | 1090 | BIO_printf(bio_c_out, "turning on non blocking io\n"); |
| 1091 | if (!BIO_socket_nbio(s, 1)) { | 1091 | if (!BIO_socket_nbio(s, 1)) { |
| 1092 | ERR_print_errors(bio_err); | 1092 | ERR_print_errors(bio_err); |
| 1093 | goto end; | 1093 | goto end; |
| 1094 | } | 1094 | } |
| 1095 | } | 1095 | } |
| 1096 | if (s_client_config.c_Pause & 0x01) | 1096 | if (s_client_config.pause & 0x01) |
| 1097 | SSL_set_debug(con, 1); | 1097 | SSL_set_debug(con, 1); |
| 1098 | 1098 | ||
| 1099 | if (SSL_version(con) == DTLS1_VERSION) { | 1099 | if (SSL_version(con) == DTLS1_VERSION) { |
| @@ -1133,20 +1133,20 @@ re_start: | |||
| 1133 | test = BIO_new(BIO_f_nbio_test()); | 1133 | test = BIO_new(BIO_f_nbio_test()); |
| 1134 | sbio = BIO_push(test, sbio); | 1134 | sbio = BIO_push(test, sbio); |
| 1135 | } | 1135 | } |
| 1136 | if (s_client_config.c_debug) { | 1136 | if (s_client_config.debug) { |
| 1137 | SSL_set_debug(con, 1); | 1137 | SSL_set_debug(con, 1); |
| 1138 | BIO_set_callback(sbio, bio_dump_callback); | 1138 | BIO_set_callback(sbio, bio_dump_callback); |
| 1139 | BIO_set_callback_arg(sbio, (char *) bio_c_out); | 1139 | BIO_set_callback_arg(sbio, (char *) bio_c_out); |
| 1140 | } | 1140 | } |
| 1141 | if (s_client_config.c_msg) { | 1141 | if (s_client_config.msg) { |
| 1142 | SSL_set_msg_callback(con, msg_cb); | 1142 | SSL_set_msg_callback(con, msg_cb); |
| 1143 | SSL_set_msg_callback_arg(con, bio_c_out); | 1143 | SSL_set_msg_callback_arg(con, bio_c_out); |
| 1144 | } | 1144 | } |
| 1145 | if (s_client_config.c_tlsextdebug) { | 1145 | if (s_client_config.tlsextdebug) { |
| 1146 | SSL_set_tlsext_debug_callback(con, tlsext_cb); | 1146 | SSL_set_tlsext_debug_callback(con, tlsext_cb); |
| 1147 | SSL_set_tlsext_debug_arg(con, bio_c_out); | 1147 | SSL_set_tlsext_debug_arg(con, bio_c_out); |
| 1148 | } | 1148 | } |
| 1149 | if (s_client_config.c_status_req) { | 1149 | if (s_client_config.status_req) { |
| 1150 | SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp); | 1150 | SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp); |
| 1151 | SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb); | 1151 | SSL_CTX_set_tlsext_status_cb(ctx, ocsp_resp_cb); |
| 1152 | SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out); | 1152 | SSL_CTX_set_tlsext_status_arg(ctx, bio_c_out); |
| @@ -1556,12 +1556,12 @@ re_start: | |||
| 1556 | } else | 1556 | } else |
| 1557 | i = read(fileno(stdin), cbuf, BUFSIZZ); | 1557 | i = read(fileno(stdin), cbuf, BUFSIZZ); |
| 1558 | 1558 | ||
| 1559 | if ((!s_client_config.c_ign_eof) && ((i <= 0) || (cbuf[0] == 'Q'))) { | 1559 | if ((!s_client_config.ign_eof) && ((i <= 0) || (cbuf[0] == 'Q'))) { |
| 1560 | BIO_printf(bio_err, "DONE\n"); | 1560 | BIO_printf(bio_err, "DONE\n"); |
| 1561 | ret = 0; | 1561 | ret = 0; |
| 1562 | goto shut; | 1562 | goto shut; |
| 1563 | } | 1563 | } |
| 1564 | if ((!s_client_config.c_ign_eof) && (cbuf[0] == 'R')) { | 1564 | if ((!s_client_config.ign_eof) && (cbuf[0] == 'R')) { |
| 1565 | BIO_printf(bio_err, "RENEGOTIATING\n"); | 1565 | BIO_printf(bio_err, "RENEGOTIATING\n"); |
| 1566 | SSL_renegotiate(con); | 1566 | SSL_renegotiate(con); |
| 1567 | cbuf_len = 0; | 1567 | cbuf_len = 0; |
| @@ -1635,7 +1635,7 @@ print_stuff(BIO * bio, SSL * s, int full) | |||
| 1635 | X509_NAME_oneline(X509_get_issuer_name( | 1635 | X509_NAME_oneline(X509_get_issuer_name( |
| 1636 | sk_X509_value(sk, i)), buf, sizeof buf); | 1636 | sk_X509_value(sk, i)), buf, sizeof buf); |
| 1637 | BIO_printf(bio, " i:%s\n", buf); | 1637 | BIO_printf(bio, " i:%s\n", buf); |
| 1638 | if (s_client_config.c_showcerts) | 1638 | if (s_client_config.showcerts) |
| 1639 | PEM_write_bio_X509(bio, sk_X509_value(sk, i)); | 1639 | PEM_write_bio_X509(bio, sk_X509_value(sk, i)); |
| 1640 | } | 1640 | } |
| 1641 | } | 1641 | } |
| @@ -1643,7 +1643,7 @@ print_stuff(BIO * bio, SSL * s, int full) | |||
| 1643 | peer = SSL_get_peer_certificate(s); | 1643 | peer = SSL_get_peer_certificate(s); |
| 1644 | if (peer != NULL) { | 1644 | if (peer != NULL) { |
| 1645 | BIO_printf(bio, "Server certificate\n"); | 1645 | BIO_printf(bio, "Server certificate\n"); |
| 1646 | if (!(s_client_config.c_showcerts && got_a_chain)) /* Redundant if we | 1646 | if (!(s_client_config.showcerts && got_a_chain)) /* Redundant if we |
| 1647 | * showed the whole | 1647 | * showed the whole |
| 1648 | * chain */ | 1648 | * chain */ |
| 1649 | PEM_write_bio_X509(bio, peer); | 1649 | PEM_write_bio_X509(bio, peer); |
