summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <>2022-09-10 15:29:33 +0000
committerjsing <>2022-09-10 15:29:33 +0000
commit212aacd76080ec12b9b4f04d5c72dc835aad01dd (patch)
tree395bc1aafd1fc1c3d29d19b708320d8f8947325a /src/lib/libssl/ssl_lib.c
parent6ff688c7a2aa8f1ec524c72f0e010b60c8f12381 (diff)
downloadopenbsd-212aacd76080ec12b9b4f04d5c72dc835aad01dd.tar.gz
openbsd-212aacd76080ec12b9b4f04d5c72dc835aad01dd.tar.bz2
openbsd-212aacd76080ec12b9b4f04d5c72dc835aad01dd.zip
Provide a version of ssl_msg_callback() that takes a CBS.
Use this from the TLSv1.3 code. ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c16
1 files changed, 12 insertions, 4 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 */