summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/ssl_lib.c16
-rw-r--r--src/lib/libssl/ssl_locl.h3
-rw-r--r--src/lib/libssl/tls13_lib.c6
3 files changed, 17 insertions, 8 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index c0ca19c7c1..f5f7bf66c1 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.304 2022/08/21 19:42:15 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.305 2022/09/10 15:29:33 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 *
@@ -2939,9 +2939,17 @@ void
2939ssl_msg_callback(SSL *s, int is_write, int content_type, 2939ssl_msg_callback(SSL *s, int is_write, int content_type,
2940 const void *msg_buf, size_t msg_len) 2940 const void *msg_buf, size_t msg_len)
2941{ 2941{
2942 if (s->internal->msg_callback != NULL) 2942 if (s->internal->msg_callback == NULL)
2943 s->internal->msg_callback(is_write, s->version, content_type, 2943 return;
2944 msg_buf, msg_len, s, s->internal->msg_callback_arg); 2944
2945 s->internal->msg_callback(is_write, s->version, content_type,
2946 msg_buf, msg_len, s, s->internal->msg_callback_arg);
2947}
2948
2949void
2950ssl_msg_callback_cbs(SSL *s, int is_write, int content_type, CBS *cbs)
2951{
2952 ssl_msg_callback(s, is_write, content_type, CBS_data(cbs), CBS_len(cbs));
2945} 2953}
2946 2954
2947/* Fix this function so that it takes an optional type parameter */ 2955/* Fix this function so that it takes an optional type parameter */
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index fa3a5f9cfd..a6fc6eaa32 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_locl.h,v 1.424 2022/08/21 19:39:44 jsing Exp $ */ 1/* $OpenBSD: ssl_locl.h,v 1.425 2022/09/10 15:29:33 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 *
@@ -1290,6 +1290,7 @@ int ssl_clear_bad_session(SSL *s);
1290void ssl_info_callback(const SSL *s, int type, int value); 1290void ssl_info_callback(const SSL *s, int type, int value);
1291void ssl_msg_callback(SSL *s, int is_write, int content_type, 1291void ssl_msg_callback(SSL *s, int is_write, int content_type,
1292 const void *msg_buf, size_t msg_len); 1292 const void *msg_buf, size_t msg_len);
1293void ssl_msg_callback_cbs(SSL *s, int is_write, int content_type, CBS *cbs);
1293 1294
1294SSL_CERT *ssl_cert_new(void); 1295SSL_CERT *ssl_cert_new(void);
1295SSL_CERT *ssl_cert_dup(SSL_CERT *cert); 1296SSL_CERT *ssl_cert_dup(SSL_CERT *cert);
diff --git a/src/lib/libssl/tls13_lib.c b/src/lib/libssl/tls13_lib.c
index 57c58a3d30..651c34ca29 100644
--- a/src/lib/libssl/tls13_lib.c
+++ b/src/lib/libssl/tls13_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_lib.c,v 1.70 2022/07/24 14:28:16 jsing Exp $ */ 1/* $OpenBSD: tls13_lib.c,v 1.71 2022/09/10 15:29:33 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2019 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2019 Bob Beck <beck@openbsd.org>
@@ -162,7 +162,7 @@ tls13_legacy_handshake_message_recv_cb(void *arg)
162 return; 162 return;
163 163
164 tls13_handshake_msg_data(ctx->hs_msg, &cbs); 164 tls13_handshake_msg_data(ctx->hs_msg, &cbs);
165 ssl_msg_callback(s, 0, SSL3_RT_HANDSHAKE, CBS_data(&cbs), CBS_len(&cbs)); 165 ssl_msg_callback_cbs(s, 0, SSL3_RT_HANDSHAKE, &cbs);
166} 166}
167 167
168static void 168static void
@@ -176,7 +176,7 @@ tls13_legacy_handshake_message_sent_cb(void *arg)
176 return; 176 return;
177 177
178 tls13_handshake_msg_data(ctx->hs_msg, &cbs); 178 tls13_handshake_msg_data(ctx->hs_msg, &cbs);
179 ssl_msg_callback(s, 1, SSL3_RT_HANDSHAKE, CBS_data(&cbs), CBS_len(&cbs)); 179 ssl_msg_callback_cbs(s, 1, SSL3_RT_HANDSHAKE, &cbs);
180} 180}
181 181
182static void 182static void