summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-12-29 12:24:33 +0000
committertb <>2023-12-29 12:24:33 +0000
commit478738b6c1a32e580360e52244a9f70a6d84b967 (patch)
tree63b098be008d3bd6041d78d9a5fe9c6c51396721
parentbabb3323a9b758848d4756d3ea704a02aa7f586f (diff)
downloadopenbsd-478738b6c1a32e580360e52244a9f70a6d84b967.tar.gz
openbsd-478738b6c1a32e580360e52244a9f70a6d84b967.tar.bz2
openbsd-478738b6c1a32e580360e52244a9f70a6d84b967.zip
Neuter the SSL_set_debug(3) API
The TLSv1.3 stack didn't support this in the first place, and in the legacy stack it only added some dubious BIO_flush(3) calls. The sleep call between SSL_read(3) and SSL_write(3) advertised in the comment next to the flag has been a sleep call in the s_server since time immemorial, nota bene between calls to BIO_gets(3). Anyway. This can all go and what remains will go with the next major bump. ok jsing
-rw-r--r--src/lib/libssl/ssl_clnt.c7
-rw-r--r--src/lib/libssl/ssl_lib.c6
-rw-r--r--src/lib/libssl/ssl_local.h5
-rw-r--r--src/lib/libssl/ssl_srvr.c8
4 files changed, 5 insertions, 21 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index 76ed10f806..52f5de35a4 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.162 2023/11/19 15:50:29 tb Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.163 2023/12/29 12:24:33 tb 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 *
@@ -631,11 +631,6 @@ ssl3_connect(SSL *s)
631 631
632 /* did we do anything */ 632 /* did we do anything */
633 if (!s->s3->hs.tls12.reuse_message && !skip) { 633 if (!s->s3->hs.tls12.reuse_message && !skip) {
634 if (s->debug) {
635 if ((ret = BIO_flush(s->wbio)) <= 0)
636 goto end;
637 }
638
639 if (s->s3->hs.state != state) { 634 if (s->s3->hs.state != state) {
640 new_state = s->s3->hs.state; 635 new_state = s->s3->hs.state;
641 s->s3->hs.state = state; 636 s->s3->hs.state = state;
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index ce14ce710a..c97441c9c0 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.317 2023/11/29 13:39:34 tb Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.318 2023/12/29 12:24:33 tb 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 *
@@ -2933,8 +2933,6 @@ SSL_dup(SSL *s)
2933 2933
2934 SSL_set_info_callback(ret, SSL_get_info_callback(s)); 2934 SSL_set_info_callback(ret, SSL_get_info_callback(s));
2935 2935
2936 ret->debug = s->debug;
2937
2938 /* copy app data, a little dangerous perhaps */ 2936 /* copy app data, a little dangerous perhaps */
2939 if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_SSL, 2937 if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_SSL,
2940 &ret->ex_data, &s->ex_data)) 2938 &ret->ex_data, &s->ex_data))
@@ -3488,7 +3486,7 @@ LSSL_ALIAS(SSL_set_msg_callback);
3488void 3486void
3489SSL_set_debug(SSL *s, int debug) 3487SSL_set_debug(SSL *s, int debug)
3490{ 3488{
3491 s->debug = debug; 3489 SSLerror(s, ERR_R_DISABLED);
3492} 3490}
3493LSSL_ALIAS(SSL_set_debug); 3491LSSL_ALIAS(SSL_set_debug);
3494 3492
diff --git a/src/lib/libssl/ssl_local.h b/src/lib/libssl/ssl_local.h
index a2c2588c38..bd6275fac7 100644
--- a/src/lib/libssl/ssl_local.h
+++ b/src/lib/libssl/ssl_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_local.h,v 1.11 2023/11/29 13:39:34 tb Exp $ */ 1/* $OpenBSD: ssl_local.h,v 1.12 2023/12/29 12:24:33 tb 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 *
@@ -1074,9 +1074,6 @@ struct ssl_st {
1074 /* for server side, keep the list of CA_dn we can use */ 1074 /* for server side, keep the list of CA_dn we can use */
1075 STACK_OF(X509_NAME) *client_CA; 1075 STACK_OF(X509_NAME) *client_CA;
1076 1076
1077 /* set this flag to 1 and a sleep(1) is put into all SSL_read()
1078 * and SSL_write() calls, good for nbio debugging :-) */
1079 int debug;
1080 long max_cert_list; 1077 long max_cert_list;
1081 int first_packet; 1078 int first_packet;
1082 1079
diff --git a/src/lib/libssl/ssl_srvr.c b/src/lib/libssl/ssl_srvr.c
index a571549b64..f26fde5061 100644
--- a/src/lib/libssl/ssl_srvr.c
+++ b/src/lib/libssl/ssl_srvr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_srvr.c,v 1.157 2023/11/18 10:51:09 tb Exp $ */ 1/* $OpenBSD: ssl_srvr.c,v 1.158 2023/12/29 12:24:33 tb 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 *
@@ -740,12 +740,6 @@ ssl3_accept(SSL *s)
740 } 740 }
741 741
742 if (!s->s3->hs.tls12.reuse_message && !skip) { 742 if (!s->s3->hs.tls12.reuse_message && !skip) {
743 if (s->debug) {
744 if ((ret = BIO_flush(s->wbio)) <= 0)
745 goto end;
746 }
747
748
749 if (s->s3->hs.state != state) { 743 if (s->s3->hs.state != state) {
750 new_state = s->s3->hs.state; 744 new_state = s->s3->hs.state;
751 s->s3->hs.state = state; 745 s->s3->hs.state = state;